I get hot posts from reddit by get many posts node(NODE A) and get posts comment from reddit using getting post comment node(NODE B). when I want to Combine Post & Comments using code node, I find code node cannot line two node SEPERATELY BUT in a point. GEMINI said it is wrong with my n8n.
the question is that code node only have one point to input even I connect two node to code node. THERE IS NO INPUT0 INPUT1. How to handle two input for one code node, so I can combine post and comment?
The very last code node will effectively be executed twice, each with different input data. You might have over-complicated your workflow. If you want to combine the two lists, then I would suggest using the merge by condition. Otherwise if you want to do it by code, the way you can access previously executed nodes, is by referencing them by name like this:
So from the Process Comments code block you can reference the data output of the filter node with $('Filter & Prep Posts').first().json
thank you for you reply. I am not a dev and would you please share me some relative workflow in a simple way to combine the post and comment in reddit?
Great, thank you for your help. Is there any solution only use merge or other node to combine the submission and its’ comments? using code node seems a little difficulty to me .