Skip to main content
The simplest possible Step Workflow: a single step with instructions and no data collection.

Objective

In this example, you’ll learn:
  • The basic structure of a Step Workflow definition
  • How workflows initialize automatically
  • What a terminal step is and how it completes a workflow
  • How the submit tool works

The Scenario

You want to create a simple greeting workflow. When users interact with your agent, it should deliver a friendly welcome message and then complete. This forms the foundation for everything that follows—once you understand this pattern, you can build increasingly complex workflows.

Implementation

Here’s the complete tool definition:
{
  "type": "context",
  "context": {
    "task": {
      "type": "steps",
      "version": "v1alpha",
      "id": "hello-world",
      "tool": {
        "name": "complete_greeting",
        "description": "Complete the greeting workflow"
      },
      "steps": [
        {
          "id": "GREET",
          "goal": "Greet the user",
          "instructions": [
            "Say: 'Hello! This is a simple one-step workflow.'",
            "Then call the complete_greeting tool to finish."
          ]
        }
      ]
    }
  },
  "tool": {
    "type": "function",
    "function": {
      "name": "hello_world_workflow",
      "description": "A simple greeting workflow",
      "parameters": {
        "type": "object",
        "properties": {},
        "required": []
      }
    }
  }
}

Key Concepts

Tool Definition Structure

Every Step Workflow has two main parts:
  1. context.task: The workflow definition itself
    • type: "steps" — Identifies this as a Step Workflow
    • tool.name — The submit tool name the agent will call
    • steps — Array of steps in the workflow
  2. tool: The external tool definition
    • This is how the tool appears in the Syllable Console
    • The function.name is used for tool management (not by the agent)

The Submit Tool

The tool.name field (complete_greeting in this example) defines the submit tool—a special tool the agent calls to advance the workflow. The workflow engine:
  • Generates the tool’s schema based on the current step
  • Uses the step’s goal as the tool description
  • Adds input parameters from the step’s inputs field (none in this example)

Terminal Steps

A step is terminal when it has no next field. The GREET step in this example is terminal—when the agent calls complete_greeting, the workflow completes. After completion:
  • The submit tool is removed from the agent’s available tools
  • The workflow state is preserved for reference
  • The agent can respond freely to the user

Workflow Initialization

When the workflow starts, the platform automatically:
  1. Creates workflow state tracking the current step
  2. Presents the first step’s instructions to the agent
  3. Makes the submit tool available with the appropriate schema
The agent receives the step instructions and knows exactly what to do.

How It Works

Here’s the conversation flow:
User: "Hello"

[Platform initializes workflow]
  → Current step: GREET
  → Agent receives instructions:
    "Say: 'Hello! This is a simple one-step workflow.'
     Then call the complete_greeting tool to finish."

Agent: "Hello! This is a simple one-step workflow."

User: "Okay"

[Agent calls complete_greeting tool]
  → No inputs to validate (step has no inputs)
  → No next step defined (terminal)
  → Workflow completes

Agent: "If there's anything else you need, feel free to ask!"

State Changes

After initialization:
{
  "current_step_id": "GREET",
  "current_step_inputs": {},
  "completed_steps": [],
  "workflow_completed": false
}
After agent submits:
{
  "current_step_id": "GREET",
  "current_step_inputs": {},
  "completed_steps": ["GREET"],
  "workflow_completed": true
}

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. Observe the agent delivering the greeting
  5. Say “okay” and watch the workflow complete

What’s Next

This example showed a workflow with no data collection. In Example 2: Collect Input, you’ll learn how to:
  • Define input parameters for a step
  • Validate that required information is collected
  • Access collected inputs in your workflow