Overview
This node, named "Best Channel - UNEXO," is designed to route input data items based on their best communication channel ranking. It inspects each incoming item for a list of preferred channels and directs the item to one of several outputs corresponding to different communication channels such as SMS, Email, WhatsApp, Web Push, App Push, or Telegram. If the specified channel position does not exist or is unrecognized, the item is routed to a default output.
This node is useful in scenarios where you want to automate message delivery by selecting the most appropriate communication channel per user or event. For example, if you have a ranked list of preferred contact methods for customers, this node can split the workflow so that messages are sent via the customer's top choice channel.
Properties
| Name | Meaning |
|---|---|
| Channel Position | Selects which ranked channel to use: First (0), Second (1), or Third (2) best channel |
Output
The node has seven outputs, each representing a routing path for items based on their best channel:
- not-defined: Items without a valid best channel at the selected position or with an unrecognized channel.
- sms: Items whose best channel at the selected position is SMS.
- email: Items whose best channel at the selected position is Email.
- whatsapp: Items whose best channel at the selected position is WhatsApp.
- webPush: Items whose best channel at the selected position is Web Push notifications.
- appPush: Items whose best channel at the selected position is App Push notifications.
- telegram: Items whose best channel at the selected position is Telegram.
Each output contains the original input items filtered according to the channel criteria.
Dependencies
- The node expects input data items to have a
bestChannelsarray property inside their JSON data. - No external API calls or credentials are required.
- The node relies on the presence and correctness of the
bestChannelsarray to function properly.
Troubleshooting
- Missing or empty
bestChannelsarray: Items will be routed to the "not-defined" output. Ensure that upstream nodes provide this property correctly. - Invalid channel names: If a channel name in the array does not match any of the recognized channels (
sms,email,whatsApp,webPush,appPush,telegram), the item will go to the "not-defined" output. - Index out of range: Selecting a channel position greater than the length of the
bestChannelsarray results in routing to "not-defined". - Case sensitivity: The channel names are case-sensitive; for example, "whatsApp" must be spelled exactly as such to be recognized.
Links and References
- n8n Documentation: Creating Custom Nodes
- Messaging Channels Overview (general concepts):
- SMS: https://en.wikipedia.org/wiki/SMS
- Email: https://en.wikipedia.org/wiki/Email
- WhatsApp: https://www.whatsapp.com/
- Web Push Notifications: https://developer.mozilla.org/en-US/docs/Web/API/Push_API
- App Push Notifications: https://developer.apple.com/notifications/
- Telegram: https://telegram.org/