Skip to main content

Parse CSV and convert to JSON using n8n action

PDF4me Parse CSV translates text-based CSV/TSV files into clean JSON arrays from any n8n workflow. Drop in files from SharePoint, S3, or email attachments, pick a delimiter, decide whether to use custom headers or the first row, and instantly receive structured JSON for APIs, databases, or Excel insertion.

Setup

Add the PDF4me “Parse CSV” node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites

  • PDF4me API credentials
  • n8n workflow access

Configuration

  1. Add the PDF4me node to the workflow
  2. Select the "Parse CSV and convert to JSON" action
  3. Provide the CSV source, delimiter, and header strategy
Parse CSV in n8n

Parameters

Important: Parameters marked with an asterisk (***) are required. PDF4me outputs a JSON array serialized as UTF-8 bytes.

ParameterTypeDescriptionExample
Input Data Type***StringCSV source (Binary Data, Base64 String, URL).Binary Data
Input Binary Field***BinaryRequired when reading from a binary attachment.{{ $binary.data }}
Base64 Document Content***StringRequired when providing base64 CSV text.VXNlcm5hbWUsRW1haWwK...
Document URL***StringRequired for public HTTP(S) URLs.https://files.example.com/leads.csv
File Name***StringName of the CSV file (for reference/logging).leads.csv
Delimiter***StringField separator (,, ;, \t, ``, or custom multi-character string).
Column HeadersStringOptional comma-separated list of headers. Overrides file headers when provided.FirstName,LastName,Email
Skip First LineBooleanWhen true and Column Headers is empty, the first CSV line becomes headers. false auto-generates Column1, Column2...true
Binary Data Output Name***StringBinary slot storing the JSON file (e.g., parsed_data.json).document

Output

Output Parameters

ParameterTypeDescriptionExample
txtFileNameStringTXT output filename - The name of the generated TXT file containing parsed CSV dataparsed_data.txt
jsonFileNameStringJSON output filename - The name of the generated JSON file containing parsed CSV dataparsed_data.json
txtFileSizeNumberTXT file size in bytes - The size of the TXT output file in bytes657614
jsonFileSizeNumberJSON file size in bytes - The size of the JSON output file in bytes657614
successBooleanPDF4me operation status - Boolean flag indicating the success or failure of the CSV parsing process. PDF4me returns true for successful operations and false for any errorstrue
originalFileNameStringOriginal CSV filename - The name of the input CSV filedata.csv
delimiterStringDelimiter used - The field separator character(s) that was used for parsing the CSV,
skipFirstLineBooleanFirst line skip status - Indicates whether the first line was skipped. true if first line was used as headers, false if first line was treated as datafalse
columnHeadersStringColumn headers source - Description of where column headers came from. Shows "from CSV" if headers were read from the file, or the custom headers if providedfrom CSV
cultureNameStringCulture/Locale code - Culture code used for parsing (e.g., "en-US", "de-DE", "fr-FR")en-US
messageStringOperation message - Descriptive message indicating the result of the CSV parsing operationSuccessfully converted CSV and created TXT and JSON outputs

N8N Action Response

The PDF4me Parse CSV and convert to JSON API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"txtFileName": "parsed_data.txt",
"jsonFileName": "parsed_data.json",
"txtFileSize": 657614,
"jsonFileSize": 657614,
"success": true,
"originalFileName": "data.csv",
"delimiter": ",",
"skipFirstLine": false,
"columnHeaders": "from CSV",
"cultureName": "en-US",
"message": "Successfully converted CSV and created TXT and JSON outputs"
}
]

Use Cases

  • Database loads: Convert CSV exports to JSON before executing SQL inserts or REST calls.
  • Excel population: Parse CSV, then feed the resulting JSON straight into “Add Rows”.
  • Data validation/masking: Turn CSV submissions into JSON for rule checks, transformations, or redaction workflows.

Get Help