Workflows
A workflow is the executable definition of an AI Employee. It is a directed acyclic graph (DAG): a set of nodes connected by edges. Each node does one unit of work: reasoning with an agent, reshaping data, declaring an output. Each edge carries data and an optional condition that decides whether the downstream node runs. Because the graph is acyclic, the platform can sort it into an execution order where every node runs only after the nodes it depends on have finished.
You edit a workflow visually in the AI Employee builder, save drafts as you go, and publish when it is ready. Every run executes against the live published version and records a full step-by-step trace.
The DAG model
A workflow's definition is a single JSON object with two arrays:
{
"nodes": [ /* DAGNode objects */ ],
"edges": [ /* DAGEdge objects */ ]
}
- Nodes are the units of work. Each has a unique
id, atype, a human-readablelabel, and type-specific configuration. - Edges connect a
fromnode to atonode. An edge declares a data dependency and may carry acondition. An edge with"type": "ordering"enforces order only, with no data dependency.
The platform builds the DAG, computes each node's in-degree (how many edges point at it), and runs a topological sort. Nodes whose dependencies are all satisfied become eligible at the same time and run in parallel, up to the configured parallelism limit.
Step types
Each step has a type. The table shows each step's name in the builder, with its type in brackets. You add steps from the builder's Add an Agent library. The Agent step is where reasoning happens; the others are structural or deterministic.
| Step | Purpose |
|---|---|
Start (start) | The entry point. Maps the run's input into the workflow. Exactly one per workflow. Its input_schema declares the fields the workflow accepts. |
Agent (agent) | A reasoning step, such as a Custom Agent or an Intent Classifier Agent. Runs a configured agent type (set in agent_config.agent_type), with optional knowledge bases, Tools, and human-in-the-loop. This is where LLM work, RAG retrieval, and Tool calls happen. See Agents. |
Transform (transform) | A deterministic, non-LLM reshape. Extracts and coerces named fields from an upstream value using a list of rules. Never calls a model and never bills tokens. Use it to pull specific fields out of an agent's output, apply defaults, and coerce types (string, number, boolean, datetime). |
Call AI Employee (call_aie) | Hands work to one other AI Employee that you pick, and uses its result. |
| Send Email | Sends an email through a connected Outlook or Gmail mailbox. |
Nudge (notify_user) | Sends a card to a person on Microsoft Teams or Slack and, if you ask, waits for their answer. Supports Announce cards (one-way notifications) and Collect cards (cards that prompt a response). When the person answers a Collect card, the Nudge can also start another AI Employee. See Triggers. |
Publish Results (publish) | Declares one or more named outputs. The output_fields on the workflow's publish nodes are the AI Employee's public output contract; they become the run's named_outputs and the columns of a dashboard. A workflow with no publish nodes produces no named outputs. This step doesn't publish the AI Employee. |
Some workspaces also have a Schedule step, which checks back on one item every few hours until it settles, and a Wait step.
Agent type vs. step type. Every reasoning step is an Agent step. Which agent it runs, such as a Custom Agent or an Intent Classifier Agent, is a separate setting (agent_config.agent_type). The Feedback Router Agent routes a run based on feedback from users. It is an agent you add as an Agent step, not a step type of its own. See Agents.
Human in the loop, conditions, and Tools
There is no dedicated "ask a human" node type. Two distinct mechanisms pause or branch a run, and both live on the structures above:
- Human in the loop is a setting on an
agentnode. In the builder, turn on Human-in-the-Loop in the agent's Advanced Settings. In the workflow JSON, it is ahitl_configblock. The run pauses when the node reaches it and resumes when a person responds. See Human in the Loop. - Conditions live on edges, not nodes. The condition on an outgoing edge decides whether that branch runs. See Conditions and Expressions.
- Tools (integration functions and MCP servers) are selected on an
agentnode viaaction_idsandmcp_server_ids. The agent runtime exposes them to the model as callable tools.
Edges and conditions
An edge looks like this:
{
"from": "classify",
"to": "escalate",
"condition": {
"type": "field",
"field": "output.priority",
"operator": "eq",
"value": "HIGH"
}
}
When the from node completes, the platform evaluates each outgoing edge's condition. If the condition is true (or absent), the to node becomes eligible. If it is false, that branch is skipped. Edge conditions can only reference the source node's output.* namespace. workflow_input.* and other namespaces are rejected at save time so misplaced references surface in the builder instead of silently failing every run. The full operator catalog and the branching rules are in Conditions and Expressions.
Passing data between nodes
A node pulls its inputs from upstream nodes and from the run input through input_mapping, using {{...}} references:
{{workflow_input.field}}: a field from the run'sinput_params.{{node_id.output.field}}: a field from the output of an upstream node.
An input can be marked optional. If an optional input's source node was skipped, the input is omitted and the node still runs; if a required input's source was skipped, this node is skipped too (skip propagation). Optional also applies when a reference cannot be resolved because the field it names does not exist: the input is omitted and the run succeeds without it, where a required input would fail the run and name the reference. See Conditions and Expressions.
Parallelism and limits
Nodes with no dependency between them run concurrently. The platform caps how many run at once and bounds the size of the graph so execution stays predictable:
| Limit | Default | Environment variable |
|---|---|---|
| Maximum nodes per workflow | 500 | EMU_MAX_DAG_NODES |
| Maximum edges per workflow | 2,000 | EMU_MAX_DAG_EDGES |
| Maximum nodes running in parallel | 5 | EMU_MAX_PARALLELISM |
The node and edge limits are enforced on every draft save and again at publish. The parallelism limit shapes execution at run time.
Triggers
A trigger is the event that starts a workflow run. The trigger type is set when you configure a workflow's entry points.
| Trigger | What starts the run |
|---|---|
| Chat, Dashboard, or API | A person sends a chat message or adds a Dashboard row, or a system calls the API. |
| Schedule | A time you set. |
| Webhook | Another system sends an HTTP request to the AI Employee's URL. |
| Poll | Ema checks another app on a schedule and starts a run for each new item. |
| A new email arrives in a connected mailbox. | |
| Document | A document finishes ingesting in a knowledge base the AI Employee uses. |
| Ticketing | A connected ticketing platform sends an inbound ticket. |
| Someone answers a Nudge card | A person answers a Collect card that a Nudge sent. The card's response data is passed as the run's input. |
You add Schedule, Webhook, Poll, Email, Document and Ticketing triggers on the Start step, under External triggers. Schedule, Webhook, and Poll triggers work only on Dashboard AI Employees. See Starting an AI Employee Automatically with Triggers.
A Nudge step can send a Collect card to a person on Microsoft Teams or Slack. When that person answers, a new run starts on the AI Employee you chose in the Nudge's Start an AI Employee option.
Drafts, versions, and publishing
A workflow is edited as a draft and deployed by publishing. The two states are kept separate so you can iterate freely without affecting what end users see.
- Saving a changed DAG writes a new immutable version row, marked as a draft (not yet published, not active). You can save as many drafts as you like.
- Publishing validates the draft, captures the live configuration and the attached knowledge bases into a snapshot, stamps the version as published, and marks it the single active version (all in one transaction). New runs resolve to the active version.
- Revert, in Version history (the AI Employee's ⋮ menu), makes an earlier version live again and reconciles the attached knowledge bases back to the state captured when that version was published. You can also Rename a version to give it a friendly name.
Each version is a self-contained snapshot: agent configuration is stored inline on each node, so editing an agent template later never changes a published workflow. A version may carry an optional name and description as a human-friendly alias.
The builder distinguishes "the current DAG is live" (the active version is the latest) from "you have unpublished changes" (the active version is older than your latest draft), so you always know whether your edits are reaching end users.
Publishing can fail pre-flight. The most common blockers are NO_LLM_PROVIDER (an agent references an LLM provider not enabled for your Workspace), HITL_INVALID_ASSIGNEE (a human-in-the-loop node assigns to a user who doesn't exist), and structural errors (a DAG_INVALID_* code such as DAG_INVALID_NODE or DAG_CYCLE_DETECTED, or DAG_TOO_LARGE). Fix the reported issue and publish again.
DAG validation
Validation runs on every draft save and again at publish. It checks structure, not behavior:
- Size within the node and edge limits.
- A unique
idon every node, and edges that reference only existing nodes. - Required fields present on each node.
- No cycles: the graph must remain acyclic.
- Edge conditions that are well-formed and reference only the allowed
output.*namespace.
Structural failures return a specific DAG_INVALID_* code (for example DAG_INVALID_NODE, DAG_INVALID_EDGE, or DAG_CYCLE_DETECTED), or DAG_TOO_LARGE when a size limit is exceeded, so you get a tight feedback loop in the builder.
Runs and steps
A run is one execution of a workflow. Starting a run creates a new run record; the workflow's identity (workflow_id) never changes, but every run gets a fresh run_id.
Start a run by POSTing to the run endpoint:
POST /api/v1/workflow/workflows/{id}/run
Content-Type: application/json
{
"input_params": { "message": "Where is my order?" },
"session_id": "b2c1…"
}
input_params is validated against the start node's input_schema. session_id is optional and groups chat runs into a conversation. Use the parallel /dry-run endpoint to test a workflow without committing the result.
A run moves through these states:
| Run status | Meaning |
|---|---|
pending | Created, not yet executing. |
running | Executing nodes. |
paused | Waiting on a human-in-the-loop response or an async step. |
completed | All reachable nodes finished; named outputs collected. |
failed | A node failed, or the run timed out. |
cancelled | Cancelled by a user or by the run-cancel cascade. |
skipped | The run was never started. For example, a scheduled fire skipped because a prior run of the same schedule was still in progress. |
Each node execution is recorded as a step, with its own status:
| Step status | Meaning |
|---|---|
pending | Not yet started. |
running | Executing. |
completed | Finished successfully. |
failed | Errored. |
skipped | Its branch condition was false, or a required input came from a skipped node. |
paused | Waiting on a human-in-the-loop response. |
A step record stores the resolved input, the output, the status, token usage, the agent configuration it ran with, and (when the node completed normally) the per-edge condition results (edge_evaluations), so the run history can show exactly why each branch was taken or skipped.
Reading a run
GET /api/v1/workflow/runs/{run_id}: the run record, includingstatus,total_tokens,output, andnamed_outputs.GET /api/v1/workflow/runs/{run_id}/steps: the per-step trace.GET /api/v1/workflow/runs/{run_id}/stream: real-time run events over SSE while the run is in progress.
named_outputs is a flat map keyed by your publish nodes' output field keys: the AI Employee's public output contract. Workflows with no publish nodes return a null named_outputs by design.
A worked example
Consider a support workflow: a start node, a classification agent, two branches, and a publish node.
start ──▶ classify ──[priority == "HIGH"]──▶ escalate ──▶ publish
└──[priority == "LOW"]───▶ auto_resolve ─▶ publish
- A run starts with
input_params = {"message": "My account is locked!"}. - The
classifyagent (an Intent Classifier Agent) emitsoutput.priority. - The platform evaluates the two edges leaving
classify. Ifpriorityis"HIGH", theescalatebranch runs andauto_resolveis skipped; if"LOW", the reverse. - The
publishnode writes the AI Employee's named outputs from whichever branch ran.
The run's step trace shows classify as completed, one branch completed, the other skipped, and the edge_evaluations on classify recording which condition was true.
Where to go next
- Agents: what an
agentnode can do. - Conditions and Expressions: edge conditions and
{{variable}}data passing. - Human in the Loop: pausing and resuming a run.
- API reference: the full run and version API.