Excel Automation Examples Using n8n, No Code
You searched excel automation examples because moving rows by hand between a spreadsheet and another system gets old.
Auto-plays · click a tile to jump to its section · all nine in one zip
- 01 JSON rows to a CSV file
- 02 A CSV file to JSON rows
- 03 Flatten nested JSON
- 04 Split an array field into rows
- 05 Combine many items into one array
- 06 Rename fields all at once
- 07 Clean up strings and dates
- 08 Dedupe while ignoring one field
- 09 Group and sum by category
The nine follow the order data actually runs into trouble. Two change the file itself first (01 JSON to CSV, 02 CSV to JSON), three reshape the structure next (03 flattening, 04 splitting, 05 combining), two clean up names and values after that (06 field names, 07 strings and dates), and two filter and roll up at the end (08 deduping, 09 grouping). Real spreadsheet work tends to snarl in this same order — the shape is wrong, then the structure, then the mess, then you need one number out of it all.
01JSON rows to a CSV file
A Code node makes 6 product rows, and Convert to File bundles them into a real CSV binary. That node stores its result only in binary, not json, so a second Code node reads the file's name and size back out to confirm the conversion actually happened. Reach for this when you need a downloadable report or an email attachment ready to send.
{
"name": "Build CSV File",
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"parameters": {
"operation": "csv",
"binaryPropertyName": "data",
"options": {
"fileName": "products.csv",
"headerRow": true
}
}
}
02A CSV file to JSON rows
HTTP Request pulls a public CSV file down as binary, and Extract from File unpacks every row into its own JSON item. Limit trims the result down to the first 5. This is the move for turning a received CSV into workflow data, like when importing a spreadsheet someone emailed you.
{
"name": "Parse CSV Rows",
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1.1,
"parameters": {
"operation": "csv",
"binaryPropertyName": "data",
"options": {
"headerRow": true
}
}
}
03Flatten nested JSON
A Code node builds one customer record with an address and coordinates nested two levels deep, then a second Code node recursively unpacks it into a flat object with dot-notation keys like address.city. Use this for tidying a nested API response before it goes into a spreadsheet, or for flattening form data from a webhook.
{
"name": "Flatten Record",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"parameters": {
"jsCode": "function flatten(obj, prefix, out) {\n prefix = prefix || '';\n out = out || {};\n for (const [k, v] of Object.entries(obj)) {\n const key = prefix ? prefix + '.' + k : k;\n if (v && typeof v === 'object' && !Array.isArray(v)) {\n flatten(v, key, out);\n } else {\n out[key] = v;\n }\n }\n return out;\n}\nconst record = $input.first().json;\nreturn [{ json: flatten(record) }];"
}
}
04Split an array field into rows
A Code node makes one order carrying an array of line items, and Split Out unrolls that array so each line item lands as its own item. This is what you reach for when processing each line item of one order separately, or splitting invoice lines before totaling them.
{
"name": "Split Line Items",
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"parameters": {
"fieldToSplitOut": "lineItems",
"include": "noOtherFields",
"options": {}
}
}
05Combine many items into one array
A Code node makes 8 log lines as 8 separate items, and Aggregate's Aggregate All Item Data option folds all of them into a single array under one logs field. It's handy for bundling logs into one file to send, or for building the raw array behind a summary report.
{
"name": "Combine Into List",
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"parameters": {
"aggregate": "aggregateAllItemData",
"destinationFieldName": "logs",
"options": {}
}
}
06Rename fields all at once
A Code node makes a row with legacy field names like usr_nm, usr_em, and ord_amt, and Rename Keys swaps all three over to name, email, and amount in one pass. Reach for this when mapping a legacy API's field names to your own, or unifying spreadsheet column names across sources.
{
"name": "Rename To Our Schema",
"type": "n8n-nodes-base.renameKeys",
"typeVersion": 1,
"parameters": {
"keys": {
"key": [
{ "currentKey": "usr_nm", "newKey": "name" },
{ "currentKey": "usr_em", "newKey": "email" },
{ "currentKey": "ord_amt", "newKey": "amount" }
]
}
}
}
07Clean up strings and dates
A Code node makes rows with stray whitespace, mixed casing, and dates in three different formats, and a second Code node trims and title-cases the names while normalizing every date down to YYYY-MM-DD. This is for cleaning up form input, or unifying mismatched date formats before they hit a database.
{
"name": "Clean Records",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"parameters": {
"jsCode": "function toTitleCase(s) {\n return s.trim().replace(/\\s+/g, ' ').toLowerCase().replace(/\\b\\w/g, c => c.toUpperCase());\n}\nfunction toDateOnly(raw) {\n const d = new Date(raw);\n return d.toISOString().slice(0, 10);\n}\nreturn $input.all().map(item => ({\n json: {\n name: toTitleCase(item.json.name),\n email: item.json.email.trim().toLowerCase(),\n date: toDateOnly(item.json.raw_date)\n }\n}));"
}
}
08Dedupe while ignoring one field
A Code node creates rows that share the same customer and product but carry a different seenAt timestamp, and Remove Duplicates excludes just seenAt from the comparison, clearing repeats by every other field. This is exactly for when the same event arrives multiple times with only the timestamp different, such as cleaning up duplicate logs from a retrying webhook.
{
"name": "Dedupe Ignoring seenAt",
"type": "n8n-nodes-base.removeDuplicates",
"typeVersion": 2,
"parameters": {
"compare": "allFieldsExcept",
"fieldsToExclude": "seenAt"
}
}
09Group and sum by category
A Code node makes 12 orders, and Summarize groups them by category, sums the amount, and counts the orders, handing back one item per category. Reach for this when rolling up revenue by category, or building group totals for a dashboard.
{
"name": "Group By Category",
"type": "n8n-nodes-base.summarize",
"typeVersion": 1.1,
"parameters": {
"fieldsToSplitBy": "category",
"fieldsToSummarize": {
"values": [
{ "aggregation": "sum", "field": "amount" },
{ "aggregation": "count", "field": "category" }
]
}
}
}
Requirements — accounts, permissions, versions
Every requirements cell below reads "none," but the table still matters because the grade and the n8n version behind each check differ item by item. All nine hit V2 (execution-verified) in this post — nothing here needs a live webhook URL, so every item cleared execution with zero accounts involved.
| Item | Grade | Requirements | n8n version |
|---|---|---|---|
| 01 JSON rows to a CSV file | V2 | None | 2.38.5 |
| 02 A CSV file to JSON rows | V2 | None | 2.38.5 |
| 03 Flatten nested JSON | V2 | None | 2.38.5 |
| 04 Split an array field into rows | V2 | None | 2.38.5 |
| 05 Combine many items into one array | V2 | None | 2.38.5 |
| 06 Rename fields all at once | V2 | None | 2.38.5 |
| 07 Clean up strings and dates | V2 | None | 2.38.5 |
| 08 Dedupe while ignoring one field | V2 | None | 2.38.5 |
| 09 Group and sum by category | V2 | None | 2.38.5 |
Getting these into n8n takes whichever path is closest at hand: paste the JSON straight onto the canvas with Ctrl/Cmd+V, pick a file from the zip through Import from File, or run n8n import:workflow --input=file.json if you're on the CLI. Once it's loaded, the Test workflow button at the top left (or the play icon on the Manual Trigger node) runs it right there.
Where this breaks
The part that trips people up is where Convert to File actually puts its result — like in item 01, a node that turns data into CSV stores everything in binary, not json, so putting it at the very end of a workflow makes the next step look like it has nothing to read. The zip password is 497s6r8z, and unzipping it drops nine files straight into a workflows/ folder. Summarize hides a similar trap: sum the amount field and the result key isn't amount but sum_amount. Skip verifying that, and whatever comes next can't find the field it's looking for.
FAQ
What is n8n, and how is it different from an Excel macro?
n8n is a no-code tool that wires apps and APIs together into workflows that run on their own. A macro only works inside one Excel file; n8n can chain a spreadsheet, an inbox, and another system's API into a single flow.
Do these examples need an account to try?
No. All nine run the moment you hit Manual Trigger, with no login or API key involved. Item 02, the one pulling a public file, was checked for a real 200 response too.
My data doesn't look exactly like these examples — what do I change?
Usually just the field names. Item 06's Rename Keys node, for instance, only needs its currentKey/newKey pairs swapped to fit whatever field names your own data actually uses.
New to n8n? The automation category and 9 n8n workflow examples cover more of the same ground, and the about page lays out how this site verifies what it publishes.