Workflow Builder
The visual workflow builder enables teams to design multi-agent pipelines using a drag-and-drop canvas. Built on React Flow (@xyflow/react), it provides a no-code interface for creating, editing, and deploying agent workflows while maintaining full programmatic control through JSON workflow definitions.
Canvas Interface
The workflow builder presents a zoomable, pannable canvas where agents are represented as nodes and data flow is represented as edges between them. The canvas supports:
- Drag-and-drop agent nodes from the sidebar palette
- Edge drawing by dragging from output handles to input handles
- Multi-select for batch operations on nodes
- Minimap for navigating large workflows
- Auto-layout to organize complex pipelines
Node Types
Agent Nodes
Agent nodes represent individual AI agents in the pipeline. Each node displays:
- Agent name and version
- Model provider and model name
- Average latency and cost per execution
- Current status indicator (healthy, degraded, offline)
Double-clicking a node opens its configuration panel where you can adjust the model, prompt version, timeout, and retry settings.
Conditional Edges
Conditional edges route data between agents based on runtime conditions. A conditional edge evaluates an expression against the output of the source agent and routes to different downstream agents based on the result.
{
"condition": "confidence_score > 0.8",
"true_target": "detailed_analysis_agent",
"false_target": "fallback_agent"
}Parallel Branches
Agents without dependencies on each other execute in parallel automatically. The canvas visually represents parallel branches as side-by-side columns. You can explicitly create parallel branches by connecting a single source node to multiple downstream nodes.
JSON Workflow Definitions
Every workflow created in the visual builder has a corresponding JSON definition that can be exported, version-controlled, and imported programmatically.
{
"workflow_id": "data-analysis-v3",
"name": "Data Analysis Pipeline",
"nodes": [
{
"id": "vision",
"agent": "vision_analysis",
"version": "v3",
"model": "gemini-2.5-pro",
"config": {
"timeout_ms": 30000,
"retry_count": 2
}
},
{
"id": "style",
"agent": "style_analysis",
"version": "v3",
"model": "gpt-5.1",
"depends_on": ["vision"]
},
{
"id": "critic",
"agent": "style_critic",
"version": "v2",
"model": "deepseek-v3",
"depends_on": ["style"]
}
],
"edges": [
{ "from": "vision", "to": "style" },
{ "from": "style", "to": "critic" }
]
}JSON definitions can be used to:
- Deploy workflows programmatically via the API
- Store workflow versions in source control
- Share workflow templates across organizations
- Migrate workflows between environments
Workflow Execution
When a workflow is triggered, the builder shows real-time execution progress via Server-Sent Events (SSE). Each node updates its visual state as it transitions through execution phases:
- Queued — waiting for upstream dependencies
- Running — agent is actively processing
- Streaming — tokens are being generated (for LLM agents)
- Complete — agent has finished successfully
- Failed — agent encountered an error (with retry indicator)
The SSE stream delivers AgentEvent payloads that the frontend processes to update the canvas in real time.
const eventSource = new EventSource(
`/api/v1/workflows/${workflowId}/execute?input=${encodedInput}`
);
eventSource.onmessage = (event) => {
const agentEvent = JSON.parse(event.data);
updateNodeStatus(agentEvent.agent, agentEvent.type);
};Template Library
The workflow builder includes a template library with pre-built patterns for common use cases:
| Template | Description |
|---|---|
| Sequential Pipeline | Linear chain of agents (A then B then C) |
| Fan-Out / Fan-In | Parallel execution with result aggregation |
| Conditional Routing | Branch based on intermediate results |
| Human-in-the-Loop | Pipeline with approval gates at critical stages |
| Retry with Fallback | Primary agent with automatic fallback to cheaper model |
Templates can be customized after instantiation and saved as new templates for your organization.
API Endpoints
List Workflows
GET /api/v1/workflowsReturns all workflows for the authenticated organization.
Create Workflow
POST /api/v1/workflows
Content-Type: application/json
{
"name": "My Pipeline",
"nodes": [...],
"edges": [...]
}Creates a new workflow from a JSON definition.
Execute Workflow
POST /api/v1/workflows/{workflow_id}/execute
Content-Type: application/json
{
"input": { ... }
}Triggers workflow execution and returns an SSE stream of AgentEvent payloads.
All endpoints require a valid JWT and X-Org-ID header.