Skip to main content

Workflow Builder

The Workflow Builder lets you compose agents, tools, and custom logic into graph-based workflows. Each workflow is a directed graph of nodes connected by edges. Nodes perform actions -- querying data, calling agents, evaluating conditions, waiting for approvals -- while edges define the execution path, including conditional branching and parallel forks.

Navigate to AI > Workflow Builder to open the visual canvas.


Workflow Structure

A workflow consists of nodes (what to do) and edges (when to do it). Every workflow begins with a Start node and terminates at one or more End nodes.


Node Types

Node TypeDescriptionConfiguration
StartEntry point of the workflow. Receives input parameters.Input schema definition.
EndTerminal node. Returns final output.Output mapping.
ActionExecutes a tool or agent.Tool name, input mapping, timeout.
ConditionEvaluates an expression and branches the flow.Boolean expression using variables.
LoopIterates over a collection or repeats until a condition is met.Iterator variable, break condition, max iterations.
ParallelForks execution into multiple concurrent branches.Branch definitions, join strategy (all, any, n-of-m).
TransformApplies a data transformation to variables.Transformation expression or function.
CustomFunctionExecutes user-defined code (JavaScript or Python).Function code, runtime, timeout.
RetrieverFetches data from a data source or external system.Source config, query, pagination.
WaitPauses execution until a condition is met or a timeout expires.Wait condition, timeout, polling interval.
RetryWraps a node with retry logic.Max retries, backoff strategy, retry condition.
HumanInputPauses execution and requests input from a user.Prompt, input schema, assignee, deadline.

Action Node Example

- id: fetch_sales
type: Action
tool: query
input:
query: |
from sales
filter date >= @{start_date}
filter date <= @{end_date}
aggregate {total = sum amount}
group region
datasource: sales_warehouse
output:
variable: sales_data

Condition Node Example

- id: check_threshold
type: Condition
expression: "${sales_data.total} > 1000000"
edges:
true: generate_report
false: flag_for_review

Edges and Conditional Branching

Edges connect nodes and define the execution path. Each edge can optionally carry a condition that determines whether the edge is followed.

Edge PropertyDescription
sourceThe ID of the origin node.
targetThe ID of the destination node.
conditionOptional boolean expression. If omitted, the edge is always followed.
priorityWhen multiple edges leave a node, priority determines evaluation order.
labelHuman-readable label displayed on the canvas.
edges:
- source: check_threshold
target: generate_report
condition: "${sales_data.total} > 1000000"
label: "High revenue"
- source: check_threshold
target: flag_for_review
condition: "${sales_data.total} <= 1000000"
label: "Below threshold"
Default Edges

If a node has multiple outgoing edges and none of the conditions evaluate to true, the workflow engine follows the edge marked as default. If no default edge exists and no condition matches, the workflow fails.


Variable Interpolation

Workflows use variable interpolation with the ${variable} syntax to pass data between nodes. Variables are scoped to the workflow run and populated by node outputs.

SyntaxDescriptionExample
${var}Reference a workflow variable.${sales_data.total}
${input.param}Reference a workflow input parameter.${input.start_date}
${node_id.output}Reference a specific node's output.${fetch_sales.output.total}
${env.KEY}Reference an environment variable.${env.API_KEY}

Variables support dot notation for nested access and bracket notation for array indexing:

${sales_data.regions[0].name}
${fetch_sales.output.rows[*].amount}

Error Strategies

Each workflow and individual node can be configured with an error handling strategy.

StrategyDescriptionUse Case
FailFastStop the entire workflow immediately on the first error.Critical pipelines where partial results are unacceptable.
ContinueOnErrorLog the error and continue to the next node. Failed node output is null.Best-effort pipelines where some steps are optional.
RetryWithBackoffRetry the failed node with exponential backoff before failing.Transient failures (network timeouts, rate limits).
CustomExecute a user-defined error handler function.Complex recovery logic (fallback data sources, alerting).
error_strategy:
default: RetryWithBackoff
retry:
max_retries: 3
initial_delay_ms: 1000
max_delay_ms: 30000
backoff_multiplier: 2
overrides:
- node: send_email
strategy: ContinueOnError
- node: fetch_critical_data
strategy: FailFast
FailFast and Parallel Nodes

When FailFast is applied to a Parallel node, all concurrent branches are cancelled when any single branch fails. Make sure this is the behavior you want before using FailFast with parallel execution.


Building a Workflow

Visual Canvas

The Workflow Builder provides a drag-and-drop canvas:

  1. Add nodes -- Drag node types from the palette onto the canvas.
  2. Connect nodes -- Click and drag from one node's output port to another node's input port to create an edge.
  3. Configure nodes -- Click a node to open its configuration panel. Set tool, input mappings, conditions, and error strategy.
  4. Set variables -- Define workflow input parameters in the Start node. Map outputs from each node to named variables.
  5. Validate -- Click Validate to check the workflow graph for errors (disconnected nodes, circular references, missing configurations).
  6. Test -- Run the workflow with sample inputs in a sandboxed environment.
  7. Publish -- Save and publish the workflow for production use.

YAML Definition

You can also define workflows entirely in YAML:

workflow:
name: quarterly_revenue_report
version: 1.0.0
input:
- name: quarter
type: string
- name: year
type: integer
error_strategy:
default: RetryWithBackoff

nodes:
- id: start
type: Start

- id: fetch_data
type: Action
tool: query
input:
query: "from sales | filter quarter == '${input.quarter}' | filter year == ${input.year}"

- id: analyze
type: Action
tool: llm
input:
prompt: "Analyze the following sales data and identify trends: ${fetch_data.output}"

- id: generate_report
type: Action
tool: markdown
input:
content: "${analyze.output}"

- id: end
type: End
output: "${generate_report.output}"

edges:
- source: start
target: fetch_data
- source: fetch_data
target: analyze
- source: analyze
target: generate_report
- source: generate_report
target: end

Monitoring Workflows

Published workflows are monitored from AI > Workflow Runs:

MetricDescription
Run statusCurrent state: running, completed, failed, paused (waiting for human input).
Node-level timingExecution duration for each node in the graph.
Variable inspectorView the value of every variable at each step of execution.
Error logDetailed error messages and stack traces for failed nodes.

Next Steps