How to Append JSON Data to an Existing CSV File on local Disk in n8n?

Hi everyone,
I’m currently automating my invoice workflow with n8n. After reading and processing each PDF invoice, I want to append extracted data (e.g., vendor name, invoice number, amount, and date) as a new row to a centralized .csv file on my Synology NAS.

So far, everything works:

  • The PDF is copied and renamed correctly
  • Metadata is extracted with an OpenAI node
  • The renamed file is stored in the correct location

:white_check_mark: Now I want to append the extracted invoice data to a CSV file without overwriting it — one row per processed invoice.

What is the best way to achieve this in n8n?

Information on your n8n setup

  • n8n version: 1.103.2
  • Database: SQLite
  • n8n EXECUTIONS_PROCESS setting: default
  • Running n8n via: Docker on Synology
  • Operating system: DSM 7 (Synology NAS)

@StephanS so if you must use csv and on local nas, you can just load the CSV from bin, and convert to json store new data, and save back to file, but why not use a table or db? Be much easier with a node to upsert, you can probably upsert via some custom JS or python too. I prefer google drive tbh, as many nodes work quite well.

Samuel

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.