Skip to content
Search is loading.

Run the workflow

Available now Foreground run is the default workflow tool action.

Use the MCP host tool interface. Select the workflow tool.

Run this command in the project directory:

Project working directory · shell command

pwd

Append /first-inspection.workflow.js to the result. Use the full absolute path in the tool request.

Send this payload through the workflow tool:

workflow tool · foreground run request

{
"action": "run",
"scriptPath": "/absolute/path/to/first-inspection.workflow.js",
"args": {
"request": "Find the source that defines the CLI commands."
},
"maxAgents": 1,
"tokenBudget": 8000
}

If you use the verified example, replace only the absolute path. Make the args.request value the same as the validated value.

The server reads the path during admission, the step that accepts the request and creates the run record. It stores the admitted workflow script with that record.

The call waits for a terminal status, a final status that does not change without a new run request. A completed response includes these fields:

  • runId
  • status: "completed"
  • The authored structured result
  • Token usage, when the backend reports it
  • Logs and a scriptUri resource link

Keep the returned runId. Use it for inspect, await, stop, and resume requests.

A paused response is not a completed response. Before you resume, read its reason, authContext, or checkpointContext.

If the workflow script is not saved as a file, send its source in the script field. Send raw JavaScript without Markdown fences.

Use one source field: script or absolute scriptPath. Do not include the two fields in the same run request.

Inspect the run and its result.