Question about loops / flows etc

Hi All,

Fairly new to n8n here and I’ve got a flow question. Basically I’m trying to work out how to make the flow shown in “C” in n8n. I’ve gotten A and B to work, and this is all that’s missing. B was implemented using a Code node that outputs a structure similar to B. Thanks for any assistance!

Information on your n8n setup

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

hello @Bez

didn’t get the point. Anyway, that’s how you can flatten the input data.

If you return the variable data, you will get the option B.

Thanks @barn4k - my question is how can I run “C”, the loop-inside-a-loop after getting my result B (your code is doing the reverse). I’m new to n8n so maybe I’m missing something really basic?

Given input data of a structure that contains 1 or more Items and 1 or more SubItems, what workflow would iterate through the structure, create (e.g.) a new Monday.com item for each Item, and then Monday.com sub-items under this item for each SubItem in the input structure?

Any node (e.g. Split Out) added immediately after the initial Item is created in Monday, can’t see the subItems, the same goes for a Loop Over Items node.

Thanks!

Can you provide an example of the json input and expected output? It’s not clear what you are going to do with it

You can iterate over items via standard n8n logic and iterate over sub items via Loop Node

1 Like

Hi,

Thanks for the reply. This is more or less the direction I was trying and found your workflow very useful. Here’s what I’m trying to do:

I’d like “1” to execute for every top-level item, and “3” for every sub-item. The problem is that “2” doesn’t receive the original item to split since “1” is in the way (if that makes sense). “3” needs to use the output from “1” as well as from “2”.

Thanks!

please, share the workflow.

You can copy the content with ctrl+a > ctrl+c and then past it with ctrl+v after pressing the button </>

Sure - I just had to change some of the values (real URLs etc.) but here it is:

Thanks!

That one should work

Or you can even remove the Loop part

1 Like

Thanks for the quick reply! I’ll test them both out.

Tried the 2nd one and it’s perfect! Thanks for all the help!

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