Run the workflow
Available now Foreground run is the default workflow tool
action.
Use the MCP host tool interface. Select the workflow tool.
Get the absolute path
Section titled “Get the absolute path”Run this command in the project directory:
Project working directory · shell command
pwdAppend /first-inspection.workflow.js to the result. Use the full absolute path in the tool request.
Send the run request
Section titled “Send the run 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.
Read the foreground response
Section titled “Read the foreground response”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:
runIdstatus: "completed"- The authored structured
result - Token usage, when the backend reports it
- Logs and a
scriptUriresource 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.
Use inline source for an unsaved script
Section titled “Use inline source for an unsaved script”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.