Merge behavior

Hi dear friends

In my case:

  • I use 2 stream in one workflow.
  • Because I use telegram nodes and trigger I can’t connect straight stream 1 to stream 2.
  • In stream 2 I need some data from stream 1 and from external api (and telegram trigger)
  • I started stream 2 with 2 Webhook. First one get information from “http url node” in the end of stream 1and the second Webhook get information from external api.
  • I merge them by “merge node” on wait feature.

My problem is that:

The “merge node” on wait feature should force workflow wait for income information from both Webhook and then when both information is ready it allow run remaining stream, but I don’t know why it doesn’t work and when the first Webhook is triggered my stream got continue without attention to wait feature on merge node.

Sorry that is not possible and is sadly not how it works. Trigger and Webhook nodes start a workflow and a workflow does always just get started by one trigger. It is not possible to get data from to trigger nodes.
If you have two Webhook Nodes it simply means that the workflow can get started via two different URLs.

You right.
My problem is about “merge node”.
It should be wait for data from tow different stream, isn’t it?
Do you think I make mistake?
Best regards;

Ah only one of the inputs is a webhook or trigger? Then it should wait. Did you connect only one node per input or multiple ones?

Really I connect two Webhook to one merge node.
I connect Webhook 1 to input 1 and Webhook 2 to input 2.

Ah ok. So then it can not work. A merge node waits for the data of all inputs but if the second input is a Trigger or Webhook node it simply resolves it with an empty item.

Emmm
Can you probably add options to add this feature (wait for multiple Webhooks or triggers) or basically it can not possible?

That is nothing that can be added easily. That would be a big change.

oooooh thank you.
I try to find another way to solve my way.

another thing please:
In Webhook setting I see “response mode” that I can’t understand how can I use it, can you please help me?

changer_014

Can you please open a new topic for that as it is a totally different and unrelated question.

1 Like

I don’t know if it’s a bad practice to reopen an old topic (if it is, i’m sorry) but the author described well my problem (my topic is here if needed : Wait the end of the 2 nodes to merge)

Is there a way to make the merge wait the 2 nodes before merging ? Right now when the first one finished, the workflow continue, then when the second one finish the workflow start again so in my case I have some datas in double in AirTable.

Thanks a lot,

Romain

@jan have the same problem.

my whole N8N flow starts with a Telegram Trigger (Message). I am also using a Webhook from Stripe (On_checkout_session_completed) BUT I need to know IF Checkout Session was completed for that specific user_id and chat_id. So I am using a Merge node so the flow has to wait for the Telegram trigger to start, pass variables (user_id and chat_id) to webhook node, merge, then continue…

How can I do this?

Because right now either the telegram trigger runs or webhook node

Hi @pooria, this sounds like you have two separate executions here (one triggered using a webhook node, and another one using the Telegram trigger). n8n’s Merge node is only aware of to the current workflow execution and won’t be able to take previous executions into account.

So you’d have to either

a) persists your session data somewhere (for example in a database) during your first execution, then fetch the required data in your second execution
b) consider using the Wait node where possible (it might not be in your case). The Wait node isn’t just able to wait a specified amount of time, it can also wait for incoming webhooks as shown here.

If you’re running into trouble with this perhaps you can open a new topic and share your workflow along with any other relevant details (such as suitable example data)?

1 Like

Tried option a with persisting it in a database.

This is a learning experience!!

Learned that webhook trigger is a trigger indeed and you can basically have one trigger in a flow to avoid concurrency issues

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