Workflows
Test-run a workflow draft
Start a test run of a workflow’s draft, as the Console’s Test button does.
POST
Test-run a workflow draft
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.
v2 compatibility notes
POST /api/v2/workflows/testRunDraft starts a test run of the workflow’s draft (kind: "test", no version), as the Console’s Test button does, and returns {runId, workflowId, kind}.
Authentication
External App credential or platform API key, or a Personal key. Requires permissionworkflows:manage (an elevated permission) held at the platform scope, as the Console decides it; a key or app granted only at some org units receives 403, recorded, and nothing is written. Forge agents can never hold workflows:manage. Because the success answers a read, the credential’s scopes must include workflows:read as well, and because a test run is a launch, workflows:use must be granted and reached by the credential’s scopes, as for a dispatch; a missing one answers 403 naming it. The workflow must be readable at its home (otherwise 404). A Personal key acts as its owner, narrowed by its scopes; an External App or platform key acts as itself. The change is stored and audited with that actor (for an app or platform key, with who granted it), under the Console’s own audit events.
The run
A test run is a run: read it and cancel it with the runs routes. Its inputs (runtimeArgs) are validated against the draft’s input contract as on dispatch, and a file input needs files:read. runtimeContract (outcomesV1) asserts the draft’s run contract; a mismatch is refused. The run is still decided at the workflow’s home, as a dispatch is. A retired or paused workflow answers 409 invalid_state. Test runs are excluded from production analytics.
Idempotency
With anIdempotency-Key, a same-key retry returns the original run’s identity only while the caller may read that run (runs:read, the workflow dispatch rule); otherwise 409 idempotency_result_unavailable, and no second run starts.Authorizations
Headers
Body
application/json

