Shapes

Start a flow

When a chat command arrives

Starts the flow from a Slack slash command or button, or a Teams message or card button, with no AI involved.

Nodes › TriggersOpen in Neblex
Good for
ChatOps
Role
Starts a flow
Find it in
Nodes › Triggers

When to use it

  • People should start a flow from Slack or Teams with a command such as /deploy api env=prod.
  • A button in a chat message should approve or run something.
  • The flow should reply in the conversation when it is done.

Reach for something else when

Example

/deploy api env=prod in Slack starts a deployment flow that replies at once and posts the outcome when it is done.

  1. When a chat command arrives
  2. Run another flow
  3. Slack

How it works

Settings
Chat app: Slack or Microsoft Teams; Chat URL: the address to give the chat app (/api/hooks/{workspace}/{flow}/chat); for Slack, Slack signing secret: a connection holding your Slack app's signing secret; for Teams, Bot app ID: your Azure Bot's Microsoft App ID; Commands: the commands it answers, separated by commas [every command]; Reply: what the person sees at once [nothing].
Behaviour
In Slack, set the Chat URL as the Request URL of each slash command and as the Interactivity Request URL for buttons; in Teams, as the bot's messaging endpoint. Only an active flow answers. Every Slack request is checked with the signing secret and must be at most five minutes old; every Teams request must carry a token Microsoft signed for your bot. Each command or button press starts one run, also if the chat app sends it again, with one record: platform, command, text, args (the command's words; quotes keep words together), params (its name=value words; for a Teams card button, the fields of its data), user, channel, team and action (the button pressed). A Slack button's command is its action id and its text its value. In Teams the command is the first word of the message (a mention of the bot is left out), or the command field of a card button's data. Slack adds response_url and trigger_id, so a later step can post the result; Teams adds service_url, activity_id and bot, so a Teams step can answer in the conversation. A command the flow does not answer starts nothing. When the run cannot start (the monthly runs are used up, the flow is busy), Slack shows the person why; Teams is told to send it again.
Example
/deploy api env=prod in Slack starts a deployment flow with params.env = prod, which replies "Deploying api to prod" at once and posts the outcome to response_url when it is done.
More in the guide

Add it to a flow

  1. Open the flow from Build › Workflows.
  2. Open Nodes and find When a chat command arrives under Triggers. Drag it onto the canvas as the first step.
  3. Connect it to the next step and open its settings with ✎ Edit.
  4. Save and test with Run, then set the flow Active so it starts on its own.