Building a Flow

When creating a new Flow, the canvas will automatically display the Start step. This step is the initial step of any Flow. The Start step allows you to set up the triggers that will execute the Flow to the user. The combination of a trigger with replies is a step. Each Flow consists of several steps.

Using the sidebar on the right, you can set up messages, triggers, or actions to enable the Flow.

Flow Builder canvas with the start step and actions selected
click to enlargeFlow Builder canvas with the start step and actions selected
click to enlarge

Flow Builder canvas with the start step and actions selected
click to enlarge

Everything in Flow Builder happens from top to bottom until it reaches a good branching action from one step to another.

Saving Variables

There are two ways to save variables in Flow Builder:

  • The Context: these are key:value pairs saved temporarily and deleted when the session ends (typically 24 hours after the first message).
  • The Profile: these are key:value pairs saved permanently for a specific user in a specific Flow. These are encrypted by default.

User Start

The user start component gets triggered when a user sends a message to the Flow for the first time in a session. When this happens, this component evaluates actions top to bottom.

click to enlargeclick to enlarge

click to enlarge

Webhook Start

The webhook start component gets triggered when a webhook sends a valid HTTP POST request to the URL automatically generated in Studio. When this happens, this component evaluates actions top to bottom.

click to enlargeclick to enlarge

click to enlarge

To trigger this type of webhook start component, you need to send a payload like the following:

-- A valid HTTP POST request with a JSON payload like the one below. The userId is mandatory, the data fields are optional.

{
  "userId": "phone number including area code",
  "data": {
    "key": "value",
    "key": "value",
    "key": "value"
  }
}
```

Steps

A Step is the representation of a step in a Flow. Each Step can interact using content, retrieve an input, invoke and run business logic, and decide which step to transition to.

Visually, steps are represented as white boxes in the canvas, and their configuration is shown in a sidebar when clicking on the name.

click to enlargeclick to enlarge

click to enlarge

A message step basic metadata includes:

  • Name - You must assign this required value when creating a step. In the step's sidebar, you can edit this value after completing the step.
  • Message - This field allows you to enter the message displayed to the user.
  • Wait for the user to execute actions - This trigger allows you to set up a wait time to move to the next step.
  • Actions - This allows you to enter the triggers that will continue the Flow. The following options are available:
    • Condition
    • Go to
    • Variable
    • Web API
    • Code

📘

More Information

For more information on actions, see Activities

To configure and edit a step:

Click on the step's name. Edit the sidebar parameters.
Click the Save icon to update the step.

Activities

click to enlargeclick to enlarge

click to enlarge


What’s Next
Did this page help you?