Skip to Content

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.

At a glanceVerified in app · Oct 30, 2026
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
TaskToolRecoveryWait Limit
Test one eligible action, without downstream Stepstest_stepPoll its executionId; if lost, repeat the original start call and key.Default 30s, max 240s. Timeout does not cancel the Step.
Test the reachable automationrun_workflow_testRepeat 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.

Default (writeMode: execute)Real Service Execution
  • 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.
Dry Run (writeMode: preview)Write-Free Preview Mode
  • 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), and cancel_workflow_execution are included in Build drafts (Recommended) (25 tools) and Full access (25 or 26 tools). They are omitted in Read only (16 tools) and legacy no-test Build drafts tokens (22 tools). 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 with MCP_TEST_SECRETS_REFUSED.
  • Data Store test permissions (dataStoreData): Connections set a Data Store test level: None, Read (default on Build drafts), or Write (default on Full access). Writes are refused below write and reads are refused at none. The first permitted test write logs data_stores.mcp_test_changed in 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>"], saved testingData, or the latest event (executionId: null, 0 credits). On polling triggers, fetchSample: true reads up to 5 newest events read-only (output + sampleEvents). Adding saveAsTestingData: true saves the newest event on a draft trigger with no testing data yet (savedAsTestingData). On an Error Trigger (errorTrigger), pass sourceExecutionId from a failed run of another non-private automation.
  • Routing Steps (Conditions, Switch, Filter, Repeater): Returns routing: { matchedBranchIds, matchedBranchNames, nextStepNumbers }.
  • Per-item Steps (Run for each item): Runs at most the first 3 items (STEP_TEST_MAX_ITEMS = 3).

Start a Step Test

ParameterTypeRequirement
teamIdstringOptional workspace ID (required only for multi-workspace connections).
workflowIdstringRequired automation ID from list_workflows.
stepintegerRequired positive step_number from get_workflow.
idempotencyKeystringRequired fresh key (up to 128 chars) per intended execution.
mockInputsobjectOptional raw predecessor outputs keyed by Step number (up to 64 KiB; pass {"1":{"email":"[email protected]"}} directly).
fetchSamplebooleanOptional (polling triggers only). Reads up to 5 newest events read-only (output, sampleEvents).
saveAsTestingDatabooleanOptional (with fetchSample: true). Saves the newest event as testingData on a draft trigger that has none yet.
sourceExecutionIdstringOptional (errorTrigger only). Failed executionId from another non-private automation in the workspace.
allowSyntheticInputsbooleanOptional (false default). When true, invents synthetic values for missing predecessors.
writeModestringOptional "execute" (default) or "preview".
waitSecondsintegerOptional wait from 0 to 240 seconds (default 30).
test_step start arguments
{ "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.

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

ParameterTypeRequirement
teamIdstringOptional workspace ID.
workflowIdstringRequired automation ID.
idempotencyKeystringRequired fresh key per intended run. Reuse with the original input only to recover a lost response.
mockTriggerDataobjectOptional trigger payload. On a Webhook (http/new-requests) with Body only off, a flat object wraps under body ({{ 1.body.<field> }}).
pollNowbooleanOptional (polling triggers only). Fetches the newest live event read-only and starts the run (if none is found, nothing runs).
replayFromExecutionIdstringOptional executionId from list_workflow_executions to replay that run’s exact trigger event.
startFromStepintegerOptional action step_number for a partial run. Earlier Steps use sourceExecutionId, pinned testingData, or latest output (pinned: true).
sourceExecutionIdstringOptional earlier executionId to seed Steps before startFromStep, or a failed executionId from another automation for an errorTrigger workflow.
writeModestringOptional "execute" (default) or "preview".
waitSecondsintegerOptional 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.

Verify it works
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?

Last updated on

Search documentation

Start with a guide, or search by Step, task or error.