Generating multiple files

Describe the problem/error/question

Trying to create multiple simple text files to send as email attachments and/or write to file system or services.

What is the error message (if any)?

None

Please share your workflow

Share the output returned by the last node

Obviously, the two code nodes at the start here are in reality the end of another chain of nodes. Everything works fine, it just feels like I’m missing something very obvious to generate all the files in one go without all that mess. Can it be done in a code node?

Information on your n8n setup

  • n8n version: 1.31.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux/Ubuntu

hello @TomSpidge

I don’t know why you need so many nodes, as it can be simplified like in the example below

2 Likes

Thanks. I didn’t know why I needed so many nodes either, but it was all a bit ‘Friday afternoon’ and I couldn’t plow through the mess to see what I needed.
The real code is more complex so needed a little more prodding to get into that shape, but it’s so much easier when someone’s pointed out what you’re aiming for (and it’s monday morning, apparently). All seems to be working with one code node → files → aggregate now.

1 Like

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