Run Lifecycle
Every run moves through these statuses:Cancellation is only supported for runs created via
/run-async or /run-sse. Runs created via the synchronous /run endpoint cannot be cancelled because the request blocks until completion.Strict Agent Mode
Beta: Strict Agent Mode is in beta — you must join the beta to use it (contact support to enable it
for your account). Set
agent_config.mode to strict when creating a run.Max Steps
Beta: Custom
max_steps is in beta — you must join the beta to use it (contact support to
enable it for your account). Set agent_config.max_steps when creating a run.max_steps caps how many tool-call steps the agent takes before it stops. Accepts an integer from
1 to 500; runs default to 150 when omitted. Lower it to fail fast and bound cost on simple goals,
raise it for multi-page workflows that legitimately need more steps to finish.
The Run Object
When you fetch a run, you get back the following object:The Error Object
When a run fails,error is a structured object (otherwise it is null):
Use
category to decide how to react: SYSTEM_FAILURE is a TinyFish issue (retry after retry_after), AGENT_FAILURE means the input needs fixing, BILLING_FAILURE means you’re out of credits, and UNKNOWN should be treated as retryable.
Runs can also use vault credentials for authenticated automation. Pass use_vault: true and optionally credential_item_ids when creating a run to let TinyFish log into sites using your connected password manager.
Searching and Filtering Runs
GET /v1/runs supports filtering, text search, sorting, and pagination to help you find specific runs.
Query Parameters
Examples
Search by goal text:Response Shape
GET /v1/runs returns a data array of run objects and a pagination object:
Cursor Pagination
When there are more results, the pagination object includesnext_cursor:
next_cursor as the cursor parameter to fetch the next page.
Watching Runs Live
Every run includes astreaming_url where you can watch the browser execute in real-time. This is useful for debugging, demos, or showing users what’s happening behind the scenes.
Embed the URL in an iframe to display the live browser view in your app:
video_url from the run object to access the recording.
Retrieving Steps and Screenshots
GET /v1/runs/{id} always returns a steps array. The screenshots query param controls how the per-step screenshot field is delivered:
html query param controls the per-step html field, a URL to the full-page HTML snapshot captured at that step. It is only non-null when the run was created with capture_config.html: true.
Each step has the following shape (this example reflects the default
screenshots=url):
Understanding COMPLETED Status
Always check theresult field:
Goal succeeded:
Handling Run Results
Use this pattern to handle both infrastructure failures and goal failures in your code.Cancelling Runs
You can cancel a run that isPENDING or RUNNING by sending a POST request to /v1/runs/{id}/cancel. This works for runs created via /run-async or /run-sse only.
Related
Endpoints
Choose sync, async, or streaming
Error Codes
Handle errors gracefully
Vault Credentials
Use password manager credentials in runs