Merge webhook data with dynamic data before LLM

Describe the problem/error/question

I trigger my workflow using a web hook that receives some data. That data isn’t used until later in the flow where I merge it with some data from a loop and pass it to an LLM. I am having issues with the merge since on the first run of the loop it passes both the web hook data as well as the loop data to the LLM however on subsequent runs, only the loop data is passed to the LLM.

What is the error message (if any)?

There are no error messages

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

I’ve adjusted the workflow to remove the need for the Merge Node.
Merge nodes always wait for both inputs. Once they’ve processed data and only one input stream is providing new data, they might not behave as expected.

For clarity, I’ve added a Set Node with Include Other Input Fields directly after the Trigger Node.

I’ve removed the Merge Node and updated the prompt in the LLM Node to use the data from this node: feedback: {{ $('webhook data').item.json.body }} and the article/content: {{ $json.data }}.

1 Like

Okay thank you very much for your explanation. It is really appreciated