header
login

Next Step (register_next_step)

The register_next_step function registers a step that will be executed when the user sends their next message. This is the foundation for building multi-step dialogs.

How It Works

  1. The bot sends the user a message (e.g., a question)
  2. register_next_step specifies which step will handle the next response
  3. The user replies — the registered step executes

Without this function, every message would be processed from the beginning of the workflow.

Parameters

Parameter Description
step Step number (starting from 1)

In the editor, enter the step number where you want to direct the user's next message.

Example: Survey

Step 1: send_message → "What's your name?"
        register_next_step → step: 2

Step 2: add_var → name = {=message=}
        send_message → "How old are you?"
        register_next_step → step: 3

Step 3: add_var → age = {=message=}
        send_message → "Thanks, {=name=}! You're {=age=} years old."

Display in Editor

On the canvas, the block shows the step number for quick workflow navigation.

Difference from continue_with

  • register_next_stepwaits for the user's next message and routes it to the specified step
  • continue_withimmediately redirects execution to another function