Objective
In this example, you’ll learn:- How to define input parameters for a step
- How the submit tool schema adapts to include inputs
- How validation works for required fields
- How to access collected inputs
The Scenario
You want to collect the user’s name before proceeding. The workflow should:- Ask for the user’s name
- Validate that a name was provided
- Complete once the name is collected
Implementation
Here’s the complete tool definition:Key Concepts
Input Parameters
Theinputs array defines what data the agent should collect:
| Field | Purpose |
|---|---|
name | Parameter name (used in tool schema and variables) |
type | JSON Schema type (string, number, boolean, etc.) |
description | Help text shown to the agent |
required | Whether the field must be provided |
Dynamic Tool Schema
When inputs are defined, the submit tool’s schema automatically includes them:Automatic Validation
When the agent calls the submit tool:- Check required fields: All
required: trueinputs must be present - Type validation: Values must match their declared types
- Retry on failure: If validation fails, the step remains active
user_name, the workflow rejects the submission and the agent must try again.
Accessing Inputs
After the agent submits valid data, the collected inputs are available atinputs.*:
inputs.user_name— The value the agent provided
- Step instructions (via templates):
"Welcome, {{inputs.user_name}}!" - Conditions:
"if": "inputs.user_name == 'Admin'" - Actions:
{"action": "set", "name": "name", "value_from": "inputs.user_name"}
How It Works
Here’s the conversation flow:State Changes
After initialization:What Happens Without a Name?
If the agent callssubmit_user_info({}) without providing user_name:
- Validation fails (required field missing)
- The workflow returns an error response
- The step remains active
- The agent should ask the user again
Try It
To test this workflow in the Syllable Console:- Create a new tool with the JSON above
- Assign it to an agent
- Start a conversation and say “hello”
- Observe the agent asking for your name
- Provide your name and watch the workflow complete
What’s Next
This example collected a single input. In Example 3: Multi-Step Flow, you’ll learn how to:- Chain multiple steps together with transitions
- Persist data across steps using variables
- Build a complete contact form workflow

