Advanced Routing: Adapting Flow Logic Based on the Channel Used

Introduction: Flows can run on multiple channels (SMS, Telegram, Messenger, WhatsApp, and more). If you need different behavior per channel—or you want to block a flow from continuing on certain channels—you can add a routing “gate” at the start of the flow using a Split by Expression and the channel name variable.

Route your flow by channel (SMS vs Telegram vs Messenger)

If you just need the essentials, follow this quick path:

  1. Decide which channels should run the flow (and which should exit)
  2. Add a Split by Expression at the start using @channel.name
  3. Create categories that match your channel names exactly
  4. Connect “allowed” channels to the flow and route other channels to a safe exit
  5. Test with the Simulator (and a real message if possible)

This keeps one flow reusable across channels while still enforcing channel-specific behavior.

Step-by-Step Process

1
Decide what should change by channel

Start by defining your routing goal. Common patterns include:

  • Run the flow only on one channel (e.g., Telegram-only onboarding)
  • Show different wording per channel (short SMS vs richer Messenger copy)
  • Block channels that can’t support a feature (attachments, long text, etc.)
  • Send a “switch channel” instruction when the contact arrives on the wrong channel

[CAPTURE: A simple flow map with a first node “Split by Expression” branching into “Telegram” and “Other”.]

💡
Tip: Put channel routing before any Send Message actions so the flow doesn’t accidentally send the first message on the wrong channel.

2
Add a Split by Expression at the start of the flow

  1. Open the flow in the flow editor.
  2. Create a new node near the beginning.
  3. Select Split by Expression.
  4. Set the expression to @channel.name.
  5. Save the split.

[CAPTURE: Split by Expression configuration showing the expression set to @channel.name.]

⚙️
Technical Detail: @channel.name resolves to the name of the channel the contact is currently using to interact with your workspace.

3
Create categories that match your channel name exactly

Add categories/rules for the channels you want to handle. For example, to run only on Telegram:

  1. Create a category named Telegram (or any label you prefer).
  2. Set the rule to match your Telegram channel’s name exactly as shown in Workspace Settings → Channels.
  3. Keep an Other path for everything else.

[CAPTURE: Split rule showing a match against the exact channel name (e.g., “Telegram Bot – Main”).]

If you want to handle multiple channels, add one category per channel (SMS, WhatsApp, Messenger, etc.).

4
Route allowed channels and safely exit other channels

Connect each category to the correct next step:

  • Allowed channel (e.g., Telegram) → continue the main flow.
  • Other channels → either end the flow or send a short instruction message (example: “Please message us on Telegram to continue.”) and then exit.

[CAPTURE: Telegram branch continuing to the next node, while “Other” goes to a short exit message.]

💡
Tip: If your goal is permanent channel selection (not just “this run”), set the preferred channel using Update the Contact → Channel instead of relying only on the split.

5
Test and debug the channel value

  1. Open the Simulator and run through the first steps.
  2. If matching fails, temporarily add a debug message that includes @channel.name.
  3. Confirm the exact value and update your split rules to match it.
  4. Remove the debug message before publishing.

[CAPTURE: A debug Send Message showing “Debug: channel=@channel.name”.]

⚠️
Warning: A flow run started in an unusual test context may not reflect real channel behavior. Always validate with at least one real inbound message on the target channel.

Common Issues & Quick Fixes

The split never matches the channel I expect

Problem: Contacts always go to “Other” even on the right channel.

Fix:

  • Confirm the channel name you’re matching is exactly correct (spacing/case matters).
  • Temporarily send @channel.name in a debug message to see the actual value.
  • Update your category rules to match the exact name shown in Workspace Settings → Channels.
Contacts still receive messages on the “wrong” channel

Problem: The flow still sends at least one message on a channel you wanted to block.

Fix:

  • Place the Split by Expression before any Send Message actions.
  • If you want a contact permanently mapped to a channel, set it via Update the Contact → Channel (preferred channel), not only a split.
@channel.name doesn’t seem to work in my flow

Problem: The expression fails or returns an unexpected/blank value.

Fix:

  • Confirm you’re using Split by Expression (not Split by Contact Field).
  • Ensure the flow is being triggered via a real channel interaction.
  • Use the Simulator Context Explorer to inspect what channel variables are available in that run.