RPA workflows
Workflows are stored definitions. Running a workflow is a separate action with its own result and cancellation path.
Inspect and run an existing workflow#
GET /api/v1/automation/workflows
POST /api/v1/automation/workflows/{id}/run
GET /api/v1/automation/runs
POST /api/v1/automation/runs/{id}/cancelInspect steps and profile_ids before executing. Use runtime:control together with rpa:write for configuration or rpa:run for execution. Listing or copying stored workflows also needs secrets:read because definitions can contain decrypted values. MCP tokens cannot receive secrets:read; these tools are unavailable to them. Execution checks cookie and secret rights required by transitive subflows again before starting and between steps. Revocation cannot undo an already sent browser command. Capture the returned run information and inspect the run list for completion, failures and cancellation. Do not equate an accepted run request with a successful workflow.
Create a definition#
POST /api/v1/automation/workflows requires name, steps, profile_ids, concurrency, close_after, delay_ms and schedule. Read the complete schema for each step action: the shared step structure contains many optional fields whose meaning depends on action. Prefer a small workflow with explicit target profiles.
{
"name": "Example navigation",
"steps": [
{
"action": "navigate",
"value": "https://example.com"
}
],
"profile_ids": [
"PROFILE_ID"
],
"concurrency": 1,
"close_after": false,
"delay_ms": 0,
"schedule": null
}The schema allows at most 500 profile IDs and concurrency 1–20. These are validation limits, not a performance or subscription guarantee. A null schedule means no configured schedule. Before saving a schedule, use /api/v1/automation/schedule/preview and review time zone and next execution times.
Record and review browser actions#
Start the recorder with a local profile that supports API control, perform the actions, then stop and review the generated steps before saving. Dialog responses are linked to the triggering event turn, without a wall-clock expiry for delayed delivery. Selection-only steps preserve caret or text ranges without typing the value again. Date, time, color, range and number inputs use the native field format. Supported rich text includes sanitized tables, safe links and definition lists. Passwords and one-time codes are not captured as plain values.
{
"action": "type",
"selector": "#message",
"selection_only": true,
"text_selection": {
"start": 0,
"end": 5,
"direction": "forward"
}
}Recover an interrupted run#
Read the run first. recovery.available permits resuming at the saved position; unconfirmed actions remain blocked to avoid duplicate effects. Prepare and confirm the browser manually, or explicitly select restoration when recovery.browser_snapshot is true. Local encrypted checkpoints contain supported form values, text selections, scroll positions and session storage. Missing local browsers and unambiguous HTTP/HTTPS tabs are opened. URLs, fields and options are checked before applying the snapshot; changed forms keep the run interrupted and retryable. Completed workflow actions are not repeated.
POST /api/v1/automation/runs/{id}/resume?confirm_browser_state=true&restore_browser_state=trueRestoration does not replay input/change events or reconstruct JavaScript memory, server transactions, arbitrary editor internals or closed shadow roots. Re-enter passwords and file selections. Operating-system dialogs and address-bar typing are represented by their supported results, not every operating-system keystroke. Pages above 10,000 DOM elements, 500 fields or 512 KiB per snapshot do not receive a full snapshot; the per-profile total is 2 MiB.
Browser and input boundaries#
Use observed selectors, the intended tab and explicit frame context. Support varies by browser engine, page type and action; not every native control, extension page or Shadow DOM operation is interchangeable. Closed shadow roots are not a general supported target. Read the actual step error and verify the changed page. Workflow cancellation does not undo completed steps.