Workflows
Workflows let you define structured, multi-step processes for your assistants using a visual state machine editor. Instead of responding freely to any input, a workflow assistant moves through defined phases – gathering information, taking actions, delegating to other assistants, or fanning out tasks to multiple participants.
When to Use Workflows
Use Open / General mode when the assistant should respond freely to any conversation without a fixed structure – customer support, Q&A, research, content writing.
Use Workflow mode when the process has defined phases and completion criteria – sales funnels, approval flows, document processing, onboarding intake, report collection, multi-step pipelines.
Multiple Workflows
Assistants can have multiple workflows attached. When a conversation starts, the agent automatically routes to the best-matching workflow based on the user’s opening message. If the conversation shifts direction mid-way, the agent can switch to a different workflow using the switch_workflow tool – previously collected data is preserved so nothing is lost.
This is useful when a single assistant handles more than one type of work. For example, a customer-facing assistant might have both a “New Customer Onboarding” workflow and a “Support Ticket” workflow. The agent picks the right one automatically.
Multi-Intent Detection
If a user’s first message matches multiple workflows (e.g., “I need to request vacation and also my mouse is broken”), the agent creates a separate workflow run for each detected intent. The runs are queued and executed sequentially – the first completes before the next begins, with a handoff message in between.
Primary Workflow
An assistant can designate one workflow as its primary workflow. When set, the assistant runs that workflow for every inbound message – there is no ad-hoc chat mode and no intent detection. When the primary workflow completes, a fresh run is created automatically for the next message. This is useful for assistants that serve a single, repeatable process (e.g., an intake form or triage bot).
Set the primary workflow from the Workflow tab on the assistant detail page.
Architecture
Workflows operate in three layers:
| Layer | Role | Example |
|---|---|---|
| Workflow (what) | Defines the states, transitions, and guards that structure the process | “Gather requirements, then search options, then checkout” |
| Task templates (who) | Fan out work to multiple participants within a workflow state | “Collect a status report from each team member” |
| Channels (how) | Deliver messages to participants via email, Slack, Telegram, or web chat | “Send the request via Slack DM” |
The workflow defines what happens. Task templates define who is involved. Channels define how they are reached. This separation means you can change the delivery mechanism without redesigning the process.
Getting Started
- Open the Workflow tab on the assistant detail page
- Click Create Workflow to add a new workflow, or Link Existing to attach a shared one
- Use the visual editor to add states, connect them with transitions, and configure guards
- Repeat to add more workflows if the assistant handles multiple types of work
- Save and start a conversation – the assistant will follow the appropriate workflow