Skip to content
Search is loading.

Control and resume a run

Available now All run controls use the same workflow tool.

Keep the runId from each run response. Use that value in each control request.

Use inspect for a bounded read:

workflow tool · inspect request

{
"action": "inspect",
"runId": "mabc1234-k9x2pq",
"lastN": 10,
"labelGlob": "review-*",
"logLines": 20
}

lastN accepts values from 1 through 50. logLines accepts values from 0 through 50.

labelGlob filters returned calls. It does not select a call to stop.

Use await to wait for terminal status:

workflow tool · bounded await request

{
"action": "await",
"runId": "mabc1234-k9x2pq",
"waitMs": 20000
}

waitMs accepts values from 0 through 25000. The default is 20000.

Use waitMs: 0 for a nonblocking status read. Cancelling an await request does not cancel the run.

Send this request to abort a live run:

workflow tool · stop run request

{
"action": "stop",
"runId": "mabc1234-k9x2pq"
}

If the stop request succeeds, the run has terminal status before the response returns. You do not need a new await request.

A stop request for a terminal run returns without changes. Stopping does not delete the journal or the admitted workflow script resource.

First, inspect the run. Find the call index in the response. Then send this request:

workflow tool · stop one call request

{
"action": "stop",
"runId": "mabc1234-k9x2pq",
"callIndex": 3
}

This request cancels only the selected in-flight agent call. The workflow run remains live.

The selected call settles with AGENT_CANCELLED. An index for a settled call, or an index that does not identify one call, produces an error.

Resume starts a new run. Re-send the workflow script and the args for the new run.

workflow tool · resume request

{
"action": "run",
"scriptPath": "/absolute/path/to/first-inspection.workflow.js",
"args": {
"request": "Find the source that defines the CLI commands."
},
"resumeFromRunId": "mabc1234-k9x2pq",
"resumePolicy": "auto"
}

The response has a new runId. Keep the source run ID and the new run ID for the resume lineage.

The workflow engine checks each completed call before replay. It runs a call live when reuse is uncertain.

Read replayEligibility at admission. Read resumeReport in the terminal outcome.

If a run pauses with reason: "auth_required", read authContext. Authenticate the named backend.

Do not put credentials in the MCP request.

Start a new run with resumeFromRunId.

Read checkpointContext.callIndex from the paused outcome. Send the decision with the resume request.

workflow tool · checkpoint resume request

{
"action": "run",
"scriptPath": "/absolute/path/to/workflow.js",
"args": {
"request": "Implement the approved change."
},
"resumeFromRunId": "mabc1234-k9x2pq",
"checkpointReplies": {
"2": true
}
}

The checkpoint key must be the reported call index. The workflow engine checks checkpoint identity before it applies the decision.

Read the durability boundaries.