Skip to main content

Workflow Basics

Workflow configuration defines the conversation flow, states, behavior, and business logic of your agent. This is the most complex part of agent setup and typically requires experimentation.

This article explains the basic concepts of workflow. For practical tips on writing an effective workflow, refer to the Workflow Configuration article. If you wish to create an agent without using workflow, follow the Quick Start flow.


Workflows

A workflow determines how the agent handles customer interactions, what steps it follows, and how it moves from the start of a conversation to finishing a task.

In practice, a workflow helps you:

  • Break complex agent behavior into manageable steps
  • Control how the agent responds in different situations
  • Define when the agent should perform actions
  • Make agent behavior more predictable and easier to debug

The following sections introduce the basic workflow structure and key components.

States

Workflows use a state machine approach. Instead of relying on a single prompt, the agent operates within defined states.

A state represents a specific step in the conversation and defines how the agent behaves at that moment. By splitting interactions into states, you can break down complex behavior and control the conversation flow reliably.

The diagram below shows an example workflow. Each block represents a state. The agent can move between states based on the conversation flow and may skip steps when needed. For example, after Greeting, the agent may move directly to Finish conversation if the customer has no request.

Workflow overview

The agent moves between these stages during the conversation, which creates a structured and predictable flow. Each state contains instructions that tell the agent:

  • What the agent should do
  • How it should respond
  • Which limitations apply
  • When to transition to the next step

In a workflow, the states are grouped under a process. For example, a sales process or a customer support process. Typically, a workflow has one process but there can be more, if needed.

To learn how to configure the state, refer to the State Configuration article.

Tools and Skills in Workflow

Tools and skills extend the agent's capabilities. The agent uses tools to perform actions like sending messages, searching knowledge bases, or finishing sessions.

For details on using them in a workflow, see Tools & Skills

State Transitions

The transitions between states are triggered by customer input, tool results, or workflow logic. At any moment, the agent operates within a single state. When a transition occurs, the agent moves to the next state and follows the instructions defined there.

From the customer's perspective, this looks like a natural conversation flow:

  1. The agent responds according to the current step
  2. The customer provides input or asks a question
  3. The agent determines the next step
  4. The conversation continues with new behavior

Although the conversation appears continuous, the agent is internally moving between states that guide its behavior.

To learn how to configure state transitions, refer to the Transition Between States article.

Workflow Complexity

An agent can have one or more states. Choose between simple or more complex agents based on your use case and reliability requirements.

Balance between control and intelligence:

  • Fewer states means more intelligent and flexible agent behavior
  • More states means more controlled and predictable behavior

Simple Workflows (1-2 states)

Best for:

  • Basic use cases requiring quick deployment
  • Modern LLMs that follow instructions well
  • Scenarios where flexibility is more important than strict control
  • Conversational or exploratory interactions
AdvantagesDisadvantages
More intelligent, flexible agent behaviorLess predictable behavior
Can handle unexpected responses naturallyRequires more sophisticated prompting
Easier to maintain, debug, and modifyHarder to enforce strict conversation order

Complex Workflows (3+ states)

Best for:

  • Highly regulated environments requiring exact compliance
  • Processes with strict step-by-step requirements
  • Legacy systems and enterprise workflows that require predictable behavior
  • Scenarios where auditability is important
AdvantagesDisadvantages
Strict control over conversation flowCan become rigid and script-like
Predictable, script-like behaviorDifficult to handle unexpected responses
Clear audit trail of conversation stagesMore complex to configure and maintain
Easier to enforce business rulesHarder to modify and extend
tip

Begin with 1-2 states and add complexity only when needed. Combine related functionality into single states. Modern LLMs work better with fewer, more comprehensive states rather than many small ones.

Workflow Example

Below is a minimal example of a workflow with two states:

- process_name: SupportProcess
name: Greeting
kind: StateConfig
init_state: true

description: |
- Greet the human
- Ask how you can help
- Determine human intent

available_tools:
SingleStatefulOutboundAgent:
- SendChatMessage

state_scenarios:
- next_state: Answer
transition_name: human_question_received
description: "human asks a question"

- process_name: SupportProcess
name: Answer
kind: StateConfig
final_state: true

description: |
- Answer the human's question
- Ask if additional help is needed
- End the conversation

available_tools:
SingleStatefulOutboundAgent:
- SendChatMessage
- FinishSession

In the diagram, the workflow appears as two states — Greeting and Answer — with a transition between them. Both states are part of the same process named SupportProcess.

Example workflow

This example shows the overall workflow structure. For configuration details, refer to the Workflow Configuration article.

Was this article helpful?