POST /v1/workflow runs a multi-step browser job in one call. It has two modes:
- Prompt mode: you pass a natural-language
prompt; the model plans it, then drives the browser and the content tools in a loop until the plan’s success criteria hold, the model says it is done, or a cap is hit. This mode spends model tokens and is billed per plan call and per step. - Recording mode: you pass a Waystone
recording(theautomation.jsonawaystone recordsession wrote) and the values for its placeholders; the recorded steps are replayed in your session’s browser with no model, zero tokens, and a step-by-step report. This is the deterministic way to automate a flow you can perform once by hand.
prompt or recording must be present.
POST /v1/workflow
Auth: Bearer API key. Request:Prompt mode
Response:
Request and answer (the
plan object is trimmed to its top-level keys; it is the same shape as the /v1/plan example below):
GET /v1/credits has the current numbers). The run above was 2 + 2 x 2 = 6 credits. A run that ends in terminal: "error" bills the plan call only.
Recording mode
How to record: run a Waystone recording session (waystone record <url> -n <name>), perform the task once in the browser it opens, and stop. Waystone writes a folder named after the recording with an automation.json; post that file’s contents as recording. Values you typed can be turned into {{placeholders}} in the recording and supplied per run through params.
What the replay does: every step’s target carries ranked selector candidates and a fingerprint of the element. For each step the page is left to settle for at least twice the time the recorder measured, the candidates are tried in order, the first that matches one visible element wins (several matches are ranked by fingerprint), and the action is delivered with real pointer and keyboard input. A step whose candidates all miss within 10 s fails the run and reports the candidate kinds it tried. Dialogs the page raises are accepted. Recorded secrets are scrubbed from the report.
Supported step types: navigate, click, dblclick, type, press, select, check, set, hover, scroll, new-tab, switch-tab, dialog, wait. Not supported, and reported rather than crashed: drag, upload, print, and any target located on a canvas (terminal: "unsupported"). A recording may have at most 500 steps.
Response:
A
wikipedia_search recording (searches Wikipedia for a topic, waits for the article, opens its Talk page), abbreviated to its first step; markdown trimmed:
drag step):
A failed or unsupported step is not an HTTP error: the answer is 200 with
terminal and failed_step set, and the steps that ran are reported.
Notes:
- Timing: the Wikipedia recording replays in 13 to 15 s; most of it is the page’s own load and settle time.
- Billing: one workflow step per step that ran (2 credits each), no plan call, no tokens. The six-step run above was 12 credits; the
dragrun was free (nothing ran). untillets you replay part of a recording, for example to reach a logged-in page and then take over with/v1/agenttasks on the same session.