Testing AI Employees

Testing an AI Employee means running its workflow with real or representative inputs and checking what it produced. You do this throughout the build, not just at the end: run a partial workflow to confirm one branch works, run the whole thing to confirm an end-to-end response, and run it in test mode when you don't want to touch live integrations or production metrics.

An AI Employee is a workflow: a directed graph of typed agents. Running it triggers a workflow run, which executes the agents in order and records a full trace you can inspect afterward in debug logs. This page covers single, interactive runs.

Ways to run an AI Employee

How you run an AI Employee depends on its interaction type:

  • Chat AI Employees run as a conversation. You open a chat session and send messages; each message triggers a workflow run scoped to that session.
  • Non-chat AI Employees (for example document- or form-triggered) run from an input form. You fill in the workflow's input parameters and submit; that triggers a single run.

Both are available from the AI Employee builder. Open the AI Employee, then choose to run it. You stay inside the builder, so you can edit an agent and re-run without leaving the page.

Run a chat AI Employee

  1. Open the AI Employee and start a run. The chat opens directly — the conversation is never gated behind inputs. If the workflow declares input parameters, an inputs control in the chat header lets you provide them; the values are applied when your first message creates the session.
  2. Type a message and send it. The response streams back in real time.
  3. Use the session list to switch between conversations, start a new chat, or rename and delete sessions. Each session keeps its own history, so you can test follow-up handling (does the AI Employee retain context across turns?) and context isolation (does an unrelated follow-up leak the previous topic?).

Run a non-chat AI Employee

  1. Open the AI Employee and start a run.
  2. The run form shows the workflow's input parameters, derived from the workflow's input schema. Fill them in.
  3. Submit to trigger one run. When it completes, the result and full step trace are available.

Running the draft

Once an AI Employee has a published version, the Test page in the AI Employee builder shows a Live / Draft toggle when all of the following are true:

  • Safe promotion is turned on for your Workspace.
  • You have edit access to this AI Employee.
  • The AI Employee is a chat or form type (dashboard AI Employees never run a draft).
  • The saved draft is ahead of both the live and testing versions. If nothing is unpublished past what is already live or in testing, the draft is identical to what Live or Testing runs.

Live runs the published live version. For a builder on the test list, selecting Live explicitly bypasses the testing version. The test list does not route a Live run to testing.

Draft runs the AI Employee's current working draft. The page shows a warning banner while Draft is selected: "You are running the draft. It uses production connections."

Switching the toggle leaves the current conversation and opens a fresh session for the new target. Draft and Live conversations are kept separate: switching back resumes the matching session.

Who can run the draft

Only a person who can edit the AI Employee may run its draft. The following are always refused with WORKFLOW_DRAFT_NOT_RUNNABLE (HTTP 422), regardless of the user's edit rights:

  • API keys and tokens minted from them
  • AI Employee visitors and channel sessions
  • Runs delegated by an orchestrator
  • call_aie child runs
  • Webhook-triggered runs
  • Dashboard AI Employees (a draft run would add a row to the customer's table)
  • Any draft request while safe promotion is off for the Workspace

A user who can use but not edit the AI Employee is refused with FORBIDDEN (HTTP 403).

Running the draft never changes which version is live. Draft runs are labeled with the draft stage, so you can tell them apart from live and testing runs in the debug logs.

Test mode (dry run)

Test mode runs the workflow as a dry run: the same graph, agents, and LLM calls execute, but when an agent would invoke an integration Tool (action_*, mcp_*) or a document write (create_document, update_document), the call is short-circuited before it reaches the external system. The agent receives a static acknowledgment echoing the tool name and the arguments it would have been called with. Knowledge-base search is deliberately let through because it is read-only — retrieval behavior stays real in a dry run.

Use test mode to:

  • Validate workflow logic, branching, and agent wiring — including that agents pick the right Tools and fill the right arguments — before you want to touch live integrations or spend real API quota.
  • Avoid creating real records in downstream systems from agent Tool calls (no tickets or writes).

Two limits to know. The mocked Tool response is an echo of the call's arguments, not realistic output data — a downstream agent that depends on real Tool output sees the acknowledgment instead, so test mode proves wiring and argument-filling, not output handling. And the first-class send-email node is not short-circuited: a dry run that reaches a send-email node sends a real email. Keep test runs away from that node, or point it at a test recipient.

Test mode is an API-level capability today — there is no test-mode toggle in the chat composer. Start a dry run with POST /workflows/{id}/dry-run, or send a chat message with the per-message is_dry_run flag, which you can flip between turns in the same session. In the builder, Autopilot's test-run action starts dry runs the same way. The run is recorded with is_dry_run: true, and its debug logs are as detailed as any other run's.

A note on metrics: dry runs are excluded from the workflow-run product metrics (a dry run emits no run-started event), but chat messages sent in test mode are stored like any other message and are not filtered out of the chat metrics exports.

When mocks aren't enough. A dry run's mocked Tool responses only acknowledge the call — they don't return realistic data. To validate against real systems safely, point your Tools at sandbox or non-production instances of the connected app and run with test mode off. Switch to production instances only at launch — see Launching and monitoring.

Under the hood: runs and the API

Interactive runs go through the workflow service. The same endpoints are available in the API reference if you want to drive runs programmatically.

ActionEndpointNotes
Start a runPOST /workflows/{id}/runBody is StartRunRequest (input_params, optional session_id, optional version). Pass {"version":{"kind":"draft"}} to run the working draft; {"version":{"kind":"default"}} to run live explicitly. Omit version and the resolver picks — a tester then reaches the testing version. Returns the run asynchronously; the response includes a stage field (live, testing, or draft).
Start a dry runPOST /workflows/{id}/dry-runSame request shape; the run is marked as a dry run (is_dry_run: true). Unlike /run, it does not link the run to a session_id, even when one is supplied. A dry run refuses a draft selector with WORKFLOW_DRAFT_NOT_RUNNABLE.
List runs for a workflowGET /workflows/{id}/runsFilter by trigger_type (ui, api, schedule, webhook, feedback, document, app_public, email), status, and since.
Get a runGET /runs/{run_id}Full detail including token usage and is_dry_run.
Get a run's step traceGET /runs/{run_id}/stepsThe ordered list of steps — what debug logs renders.
Cancel a runPOST /runs/{id}/cancelAborts a pending, running, or paused run and cancels its pending HITL requests. Admin only. Returns 409 if the run is already terminal.

A run moves through these statuses: pending, running, paused (waiting on a human-in-the-loop request), completed, failed, or cancelled. A seventh status, skipped, marks a scheduled fire the scheduler skipped (recorded with a skip_reason — for example, the previous scheduled run was still active).

POST /workflows/8f3c.../run
{
  "input_params": {
    "query": "What's our PTO carryover policy in California?"
  }
}

Canceling a stuck run

If a run is taking too long or is paused on a human-in-the-loop step you no longer want to answer, an admin can cancel it. Cancellation transitions every pending HITL request on the run to cancelled in one step and marks the run cancelled. Runs that have already finished (completed, failed, cancelled) cannot be canceled and return a conflict.

What to test

A practical checklist before you consider an AI Employee ready to evaluate or launch:

  • Happy path. The most common inputs produce correct, complete responses.
  • Branching. Each branch of the workflow is reachable and selects correctly. Use the step trace to confirm which branch ran.
  • Follow-ups (chat). The AI Employee retains relevant context and does not leak unrelated context across turns.
  • Out-of-scope inputs. The AI Employee handles inputs it should decline or redirect, rather than hallucinating an answer.
  • Human-in-the-loop. Steps that pause for approval, a form, or a question behave correctly and resume after a response.
  • Tools. With test mode off and sandbox integrations connected, Tools call the right systems with the right arguments.

What's next

Last updated: Nov 29, 2026