Hey,
I’d like to combine 2 json snippets into 1 prompt, for which I’m pulling 2 separate lists of data from a db.
To combine both into one json, I’m using Merge+Append.
The issue is the input that I link as Input 2 is always empty when I Test the Merge node. On the Output section, if I use Json view I can see both lists appended, but if I switch to table view, the second column is always [undefined].
If I switch the order of the Inputs, it always happens to be the second.
Isn’t Merge supposed to wait for both Inputs? I CAN see both inputs on the left.
Merge - Append emits a list of objects that contains the items from input A, followed by more items from input B. That would not appear as a “second column” (or second attribute) of a single output object.
Ok, then if I look to the LLM where the Merge is inputting, I still see that ‘input2’ object (second in the json created by the Merge) is invalid.
What I don’t understand is why I can see it if I expand on the left side, but the value dragged into the prompt is invalid. If I Test, it fails
I think you are missing how the data is structured at the top level. The array of things you see, is the whole-view of the list of (2) items. Each of those items runs the next node 1 time, so you are running the LLM step twice. If you want to map those together in a single object, Merge won’t do it. It wouldn’t be the most flexible approach, but you could use a Set - Edit Fields node, configured (toggle in Settings) to Run Once - giving you only one output object, and reference each of the incoming objects by its index. Then forward that single item on to the LLM.
Here’s an isolated example that you can pull into a separate workflow and run to see what it is doing.
To help others find the response that has the actual answer, please unmark this as the solution, and instead mark the post above, the one with the answer, as the solution. Thx.