How to combine 2+ arrays into a single array

Describe the problem/error/question

I’ve got an api that returns 2 separate arrays (best_flights & other_flights) with same schema. I am trying to concat the two arrays to form 1 single one.

I’ve tried using Set node, but it’ll only take it results from one node. Are there other nodes that can make this easier aside from using Code?

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Is this kind of what you’re looking to achieve? If no, could you provide a sample JSON output you’re looking to achieve, will help better tailor an answer. Either way I suspect the merge node is your key.

2 Likes

Merge is exactly what I needed!

1 Like

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