Dynamically send a telegram message based on the previous node executed

Hi everyone :waving_hand:,

I have a workflow where I’m using two separate Notion Trigger nodes:

  • Notion-IG → Monitors updates for Notion Instagram DB

  • Notion-YT → Monitors updates for Notion YouTube DB

Both triggers eventually send a message to Telegram in the next node.

Problem:
Right now, I want the Telegram message to include a marker or label showing which Notion trigger caused the update — e.g.:

  • If the update comes from Notion-IG, the message should start with:
    "[Instagram] Status of <Title> updated to <Status>"

  • If the update comes from Notion-YT, it should say:
    "[YouTube] Status of <Title> updated to <Status>"

I tried using a Function node, an IF node, and even a Switch node before the Telegram node, but I couldn’t figure out how to dynamically detect which Notion node executed and then customise the message accordingly.

Is there a way in n8n to identify the source node and pass a custom message to Telegram based on that?

Here is my workflow image for better understanding.

Hey @mridu hope all is good.

Here is one way to do it:

If this was helpful, kindly mark my answer as solution. Thank you.

Cheers.

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