Skip to content

Switch node

Guidone edited this page Sep 5, 2018 · 9 revisions

This node is deprecated and will be removed in version 0.15.0, use the Rule node.

Used to control the flow of the chatbot based on the type message.

The first matched topic skips the rest of the matching. To get a else-like behaviour, use the default value Any at the end of the list to capture all messages that don't match any type.

The message type is stored in the payload of the message

{
  originalMessage: { 
  // ...
  },
  payload: {
    type: 'document',
    // ... 
  }
}

This is useful for example when a Telegram and inline queries: since the inline query comes out a Telegram Receiver node with the type inline-query, id could be useful to intercept this kind of messages and redirect to a proper parser.

Example Switch

Telegram Facebook Slack Smooch

Clone this wiki locally