How to configure “OR” triggers for WhatsApp and Telegram? – Questions


Hi everyone,

I have a flow in n8n with two triggers: one for WhatsApp and one for Telegram. I want to trigger a Redis database action when a message is received on either platform.

However, the flow only triggers the Redis action if messages are received on both triggers. How can I configure the triggers as “OR” so that the action happens if either trigger is activated?

I’d prefer not to parallelize and create two separate flows, as both triggers will be performing similar actions moving forward.

Thanks!

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

This shold actually not happen.

There are several points to note here:

  • triggers cannot really fire simultaneously, it’s an illusion
  • and each trigger firing creates a separate execution (look in execution history)

To troubleshoot this:

  • disconnect Telegram trigger, save workflow, try to send message in WhatsApp and make sure your workflow executes correctly
  • disconnect WhatsApp trigger, reconnect Telegram, save workflow, try to send message in Telegram and make sure your workflow executes correctly.
  • connect all back again

If still you face the same issue with 2 things colliding, I suggest a workaround:

  • create a separate workflow
  • start it with “Execute Workflow Trigger”
  • move Redis and all subsequent nodes to that workflow, connecting that trigger to Redis node.
  • in your original workflow add 2 “Execute workflow” nodes which executes newly created workflow, and make 2 parallel lines:
    • WhatsApp → Execute Workflow
    • Telegram Trigger → Execute Workflow

That way you can for sure remove the ambiguity still having a great node reuse.

However, I saw your case myself at develop stage, when I connect 2 triggers (manual and schedule) to one node and try to execute nodes step-by-step in editor. When I execute shcedule trigger node manually and then execute next node (which has 2 incoming connections), I see data coming from manual trigger, which should not happen of course.

But when I save and activate the workflow to run itself, all works well as expected – only schedule trigger data is passed to next node. I can clearly see that in Execution History.



Source link

Leave a Comment