workflow_run
Run one JavaScript script that performs multiple web and desktop steps in a single call, returning the values you need. Save successful scripts as reusable routines for repeatable tasks.
Instructions
Run one JavaScript script that does many web and desktop steps in one call (web., desktop., visible.*). Write the whole task as one script; return the value you need. Use args for values that change. save keeps a script that succeeded as a named routine.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "workflow_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Values the script reads as args.NAME. | |
| mode | No | How the user sees the work: background (default, mouse and keyboard untouched), watch (on screen at a human pace, amber pointer), record (on screen at a human pace, the user's own pointer), direct (real input whenever a step needs it). Leave it out unless the user asked for one; saved preferences apply otherwise. | |
| save | No | Save the script as a routine under this name after it succeeds. | |
| about | No | One sentence on what the saved routine does. | |
| detach | No | Hand the work to the resident host and get a job id at once; follow it with workflow_job (action wait). Use it for work longer than about 20 seconds. | |
| params | No | For save: argument name to a short description of what it is. | |
| script | Yes | The script body (JavaScript, top-level await allowed). | |
| browser | No | Which browser web steps use, separate from mode: clean (a private window with no sign-ins), chrome (the user's own Chrome with their sign-ins, in its own tab; it stays behind unless mode puts work on screen; workflow_connect once), space (the agent's own profile signed in once). Leave it out to use the saved preference. | |
| replace | No | For save: replace a routine with the same name. | |
| session | No | A named agent-browser session instead of browser; never one that was connected to the user's Chrome. | |
| timeout_ms | No | How long the script may run, default 120000. | |
| allow_final | No | Let send, submit, pay, delete and post steps go through. Only when the user asked for that step in this request or agreed in this chat. | |
| allow_input | No | Let steps use the real mouse and keyboard. Only after the user agreed in this chat, or said so in this request. |