Run a scripted sequence of browser actions (navigate, click, type, scroll, evaluate, upload, authenticate, etc.) and optionally return a screenshot, PDF, or page content in the same response.
The task runner is the workhorse of the Browser Session API. A single request can:
Navigate to a url (optional)
Execute a sequential list of actions against the active page
Capture output artifacts — screenshot, pdf, and/or content — at the end
Actions run in order. If any action fails, the task aborts and the error is returned. Use this endpoint for multi-step flows (login → search → extract) that would otherwise require multiple round trips.
When present, renders a PDF after all actions complete. Accepts the same options as POST /browser/sessions/{id}/pdf (format, landscape, margin, etc.). Returned base64-encoded.
Actions run sequentially. Order matters — put wait between flaky interactions.
screenshot, pdf, and content are all independent and can be combined in a single task.
For long-running login flows, prefer authenticate over scripted type/click pairs — it handles common anti-bot consent banners and supports vault-stored credentials.
filename in uploadFile must be uploaded first via POST /browser/sessions/{id}/files.