How to clean up input from various sources

Say I have a workflow and at the end I have a bunch of fields I need. Call this set A.

Then I need to call a rest API for the next step. I got it spitting out name:key pairs Call this set B.

How do I merge these 2 sets of data while discarding the other fields I don’t need?

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

hello @bally

it depends on how are you planning to merge them. If you need to join two sets into one payload, then the easiest way would be to pack each set into one variable (e.g. set1: data for set1, set2: data for set2) with the Edit Fields node.

Well I guess I want them to be flat


A contains

B contains some more fields - in this case some keys I have to get from https.

The output would just be all of them in the same set.
Basically I want everything that came from A and then when I call the HTTP I only want to pick out these two fields 4 B.

The problem is at the next step Ill also get a new bunch of stuff of which I only want one or two items and so on

I’m not sure if I should be doing the sub flows, does it make it harder too?

The Web service I’m using requires me to do the following steps

  1. Get pipeline name to key mapping
  2. Get pipeline fields using a pipeline key
  3. Create a box using pipeline key and save the box key
  4. Set the fields in the box using the box key and field keys from 2

That’s a lot of steps where I want to carry forward certain fields and throw away dozens of unneeded fields

And before all of this are all the fields from set A

I’m really not sure how to do this cleanly.

As far as I know, you don’t need a sub-workflow for that.

technically, you can add all properties from one node (oldData in my example) to the output of another (HTTP node) with a Code node.

1 Like

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