Skip to main content

Workflows

Workflows orchestrate complex, multi-step processes by connecting agents, conditions, and transformations into executable graphs.

For full documentation, see Workflows (Full Guide).

Quick Overview

Why Workflows?

Some processes are too complex for a single agent:

  • Multi-stage approval: Review → Manager approval → Finance sign-off → Execute
  • Data pipelines: Extract → Transform → Validate → Load
  • Customer journeys: Qualify → Enrich → Route → Assign → Notify
  • Conditional logic: If high-value → premium path, else → standard path

Node Types

Node TypePurpose
startEntry point
agentExecute an agent
conditionBranch based on conditions
parallelExecute branches concurrently
mergeJoin parallel branches
humanWait for human input
endExit point

Basic Example

const workflow = await client.workflows.create({
name: 'Lead Processing',
nodes: [
{ id: 'start', type: 'start' },
{
id: 'qualify',
type: 'agent',
agentId: 'qualification-agent'
},
{ id: 'end', type: 'end' }
],
edges: [
{ id: 'e1', source: 'start', target: 'qualify' },
{ id: 'e2', source: 'qualify', target: 'end' }
]
});

Full documentation: Workflows (Complete Guide)