Skip to main content
Building on input collection, this example chains multiple steps together to create a complete contact form workflow.

Objective

In this example, you’ll learn:
  • How to connect multiple steps using the next field
  • How to persist data across steps with the save action
  • The difference between transitional and terminal steps
  • How workflow state evolves as steps complete

The Scenario

You want to build a contact form that collects:
  1. User’s name
  2. Email address
  3. Preferred contact time
Each piece of information is collected in a separate step, and the data persists across the entire workflow.

Implementation

Here’s the complete tool definition:

Key Concepts

Step Transitions with next

The next field defines which step to go to after successful submission:
Key behaviors:
  • Evaluated after validation passes: The workflow only transitions if all required inputs are present
  • Evaluated in order: If multiple entries exist, the first matching one wins (more on this in Example 5)
  • Terminal if missing: A step without next ends the workflow

The save Action

By default, inputs are cleared when transitioning to a new step. The save action persists them:
Without parameters: Saves all step inputs to global variables with matching names. With specific inputs:
With a custom name:

Transitional vs Terminal Steps

In this example:
  • COLLECT_NAME → transitional (goes to COLLECT_EMAIL)
  • COLLECT_EMAIL → transitional (goes to COLLECT_TIME)
  • COLLECT_TIME → terminal (ends workflow)

Dynamic Tool Schema Per Step

As the workflow progresses, the submit tool’s schema changes: At COLLECT_NAME:
At COLLECT_EMAIL:
The agent always sees the correct schema for the current step.

How It Works

Here’s the conversation flow:

State Evolution

After Step 1 (COLLECT_NAME):
After Step 2 (COLLECT_EMAIL):
After Step 3 (COLLECT_TIME):

Try It

To test this workflow in the Syllable Console:
  1. Create a new tool with the JSON above
  2. Assign it to an agent
  3. Start a conversation and say “hello”
  4. Provide your name when asked
  5. Provide your email when asked
  6. Provide your preferred time when asked
  7. Observe the workflow completing after all three steps

What’s Next

This example creates a functional contact form, but the experience feels robotic—no greeting, no sense of progress. In Example 4: Lifecycle Actions, you’ll learn how to:
  • Add welcome messages with on.enter hooks
  • Display progress indicators (“Step 1 of 3”)
  • Use the say action for verbatim text delivery
  • Track progress with counters