Testing Automations with MCP
Run single-Step tests or full automation runs from your connected AI client or editor. Start by connecting your client and validating the saved automation.
- Use it to
- Run isolated single-Step tests (test_step) or end-to-end automation test runs (run_workflow_test) with execute or write-free preview mode
- Find it
- MCP tools test_step, run_workflow_test, and cancel_workflow_execution (included in Build drafts and Full access)
- Cost
- 0 Step credits for trigger sample fetches, pinned Steps, and writeMode preview · Real action and AI executions use shared workspace balances
- Limits
- test_step waits up to 240s (default 30s, max 3 items on per-item Steps) · run_workflow_test waits up to 240s (default 90s, cancels on timeout, up to 400 Step attempts)
- Output
- Step output payload or bounded run trace (16 KiB per attempt, 192 KiB total) with status, durationMs, failure, and warnings
| Task | Tool | Recovery | Wait Limit |
|---|---|---|---|
| Test one eligible action, without downstream Steps | test_step | Poll its executionId; if lost, repeat the original start call and key. | Default 30s, max 240s. Timeout does not cancel the Step. |
| Test the reachable automation | run_workflow_test | Repeat the original idempotencyKey and input. No executionId polling argument. | Default 90s, max 240s. Timeout requests cancellation. |
Before You Test
Tests in execute mode run real actions, even on a Draft. They can send
messages, modify records, and spend Step credits and Glow AI tokens. Use
writeMode: "preview" to verify routing and parameters without external
writes.
- Calls connected third-party APIs and runs AI Steps for real.
- Uses shared workspace Step credits and Glow AI tokens at catalog rates.
- Records verified output evidence for downstream Step validation.
- Read, AI, Code, and routing Steps run; write Steps and HTTP Request return { preview: true, effect: "write", resolvedParameters }.
- Costs 0 Step credits on previewed write Steps and stops before Human Review branches.
- Safe when billable MCP runs are paused or before sending live messages.
Both tools require an OAuth connection or personal token with testing permissions:
- Permission levels:
test_step(mcp:execute),run_workflow_test(mcp:run), andcancel_workflow_executionare included in Build drafts (Recommended) (25tools) and Full access (25or26tools). They are omitted in Read only (16tools) and legacy no-test Build drafts tokens (22tools). Build drafts tests drafts only and refuses runs reaching a Live or unlisted Subflow or AI Agent workflow tool. Full access can also test Live automations. - Allow tests to use workspace secrets: Enable Allow tests to use workspace secrets in Your account → MCP → Change permissions so tests resolve
{{ $secret.* }}and{{ $key.* }}. Without it (or per-test secret approval in Glow), Steps using secrets fail withMCP_TEST_SECRETS_REFUSED. - Data Store test permissions (
dataStoreData): Connections set a Data Store test level:None,Read(default on Build drafts), orWrite(default on Full access). Writes are refused belowwriteand reads are refused atnone. The first permitted test write logsdata_stores.mcp_test_changedin the Activity Log.
Test One Step
test_step runs one Step and returns the exact output shape downstream {{ N.path }} references read:
- Action Steps: Runs for real in
"execute"mode or returns{ preview: true, ... }in"preview"mode. - Triggers: Returns
mockInputs["<step>"], savedtestingData, or the latest event (executionId: null,0credits). On polling triggers,fetchSample: truereads up to 5 newest events read-only (output+sampleEvents). AddingsaveAsTestingData: truesaves the newest event on a draft trigger with no testing data yet (savedAsTestingData). On an Error Trigger (errorTrigger), passsourceExecutionIdfrom a failed run of another non-private automation. - Routing Steps (
Conditions,Switch,Filter,Repeater): Returnsrouting: { matchedBranchIds, matchedBranchNames, nextStepNumbers }. - Per-item Steps (
Run for each item): Runs at most the first 3 items (STEP_TEST_MAX_ITEMS = 3).
Parameters & Start
Start a Step Test
| Parameter | Type | Requirement |
|---|---|---|
teamId | string | Optional workspace ID (required only for multi-workspace connections). |
workflowId | string | Required automation ID from list_workflows. |
step | integer | Required positive step_number from get_workflow. |
idempotencyKey | string | Required fresh key (up to 128 chars) per intended execution. |
mockInputs | object | Optional raw predecessor outputs keyed by Step number (up to 64 KiB; pass {"1":{"email":"[email protected]"}} directly). |
fetchSample | boolean | Optional (polling triggers only). Reads up to 5 newest events read-only (output, sampleEvents). |
saveAsTestingData | boolean | Optional (with fetchSample: true). Saves the newest event as testingData on a draft trigger that has none yet. |
sourceExecutionId | string | Optional (errorTrigger only). Failed executionId from another non-private automation in the workspace. |
allowSyntheticInputs | boolean | Optional (false default). When true, invents synthetic values for missing predecessors. |
writeMode | string | Optional "execute" (default) or "preview". |
waitSeconds | integer | Optional wait from 0 to 240 seconds (default 30). |
{
"teamId": "YOUR_WORKSPACE_ID",
"workflowId": "YOUR_WORKFLOW_ID",
"step": 2,
"idempotencyKey": "YOUR_NEW_TEST_KEY"
}Test a Whole Automation
run_workflow_test runs the reachable automation from its starting point (or startFromStep) without publishing it or arming its trigger.
Safeguards & Parameters
Workspace Safeguards and Run Admission
New test runs respect workspace MCP safeguards and concurrency limits. When a call returns MCP_PAUSED or MCP_ENFORCEMENT_UNAVAILABLE, no run started and no credits were charged. Enable billable MCP runs in Team settings → MCP or use writeMode: "preview".
Whole-Automation Parameters
| Parameter | Type | Requirement |
|---|---|---|
teamId | string | Optional workspace ID. |
workflowId | string | Required automation ID. |
idempotencyKey | string | Required fresh key per intended run. Reuse with the original input only to recover a lost response. |
mockTriggerData | object | Optional trigger payload. On a Webhook (http/new-requests) with Body only off, a flat object wraps under body ({{ 1.body.<field> }}). |
pollNow | boolean | Optional (polling triggers only). Fetches the newest live event read-only and starts the run (if none is found, nothing runs). |
replayFromExecutionId | string | Optional executionId from list_workflow_executions to replay that run’s exact trigger event. |
startFromStep | integer | Optional action step_number for a partial run. Earlier Steps use sourceExecutionId, pinned testingData, or latest output (pinned: true). |
sourceExecutionId | string | Optional earlier executionId to seed Steps before startFromStep, or a failed executionId from another automation for an errorTrigger workflow. |
writeMode | string | Optional "execute" (default) or "preview". |
waitSeconds | integer | Optional wait from 0 to 240 seconds (default 90). Reaching waitSeconds cancels the run. |
Call cancel_workflow_execution with workflowId and executionId to stop an in-flight test run early.
- Run
- Ask your AI client to run run_workflow_test with writeMode set to preview on a draft automation
- You should see
- Read, routing, and Code Steps run for real while write Steps return { preview: true, effect: "write", resolvedParameters } at 0 Step credits.
What’s Next?
- 👉 Debug a Run: investigate failed Step attempts and error codes.
- MCP Tool Reference: apply batch edits and validate before testing again.