Actions40
- AI Actions
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Generate Actions
- Operator Actions
- PDF Actions
- Storage Actions
Overview
This node provides a utility to convert CSV data into JSON format. It is particularly useful in workflows where you need to process, analyze, or transform tabular data received as CSV (e.g., from files, APIs, or user input) into structured JSON objects for further automation steps. Common scenarios include importing spreadsheet data, integrating with systems that export CSV, or preparing data for use in other n8n nodes that require JSON input.
Practical examples:
- Importing contact lists from a CSV file and sending personalized emails.
- Converting exported sales data into JSON for aggregation or reporting.
- Parsing CSV logs for automated monitoring or alerting.
Properties
| Name | Meaning |
|---|---|
| CSV | The raw CSV string to be converted. This is the main input containing your tabular data. |
| Options | Additional settings for the conversion process: - Delimiter: Character used to separate columns (default: auto-detect). - Trim CSV: Whether to trim spaces around column content. - CSV Headers: Indicates if the CSV lacks a header row. - Ignore Empty Values: Whether to skip empty values in columns. |
Output
The output is a JSON array where each object represents a row from the original CSV. Each key corresponds to a column header (or a generated field name if no headers are present), and each value is the cell content from the CSV.
Example output:
[
{
"column1": "value1",
"column2": "value2"
},
{
"column1": "value3",
"column2": "value4"
}
]
If an error occurs and "Continue On Fail" is enabled, the output will contain an error field with the error message.
Dependencies
- Requires valid credentials for the "codeKitApi".
- No additional environment variables or external services are needed beyond the API connection.
Troubleshooting
Common issues:
- Malformed CSV: If the CSV input is not properly formatted, the conversion may fail or produce unexpected results.
- Incorrect delimiter: If the delimiter is set incorrectly, columns may not be parsed as expected. Use "auto" if unsure.
- Missing headers: If "CSV Headers" is set incorrectly, the first row may be treated as data or headers unintentionally.
Error messages:
"Error: ...": General errors during parsing or API communication. Check the CSV format and options.- If "Continue On Fail" is enabled, errors will appear in the output as
{ "error": "..." }.