Skip to main content
A run is a single execution of an automation. When you call any TinyFish Web Agent endpoint, you create a run that moves through a lifecycle from start to finish.

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.
Strict mode is designed for precise tests and repeatable automation. When the agent encounters an unexpected state, it stops faster instead of exploring workarounds. Use the default mode for open-ended browsing, search, or recovery-oriented tasks.

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:
Filter by status and date range:
Oldest first with pagination:

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 includes next_cursor:
Pass next_cursor as the cursor parameter to fetch the next page.

Watching Runs Live

Every run includes a streaming_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:
The streaming URL is available while the run is active. After the run completes, use video_url from the run object to access the recording.

Retrieving Steps and Screenshots

?screenshots=base64 is available to unblock current integrations but is temporary — it will be deprecated soon in favor of URL-based access. Avoid building long-term workflows that depend on this format.
GET /v1/runs/{id} always returns a steps array. The screenshots query param controls how the per-step screenshot field is delivered:
The 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

COMPLETED means the infrastructure worked, not that your goal succeeded.
Always check the result field: Goal succeeded:
Infrastructure worked, goal failed: The browser worked fine, but TinyFish Web Agent couldn’t achieve your goal.

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 is PENDING or RUNNING by sending a POST request to /v1/runs/{id}/cancel. This works for runs created via /run-async or /run-sse only.
The cancel endpoint is idempotent — calling it on an already-cancelled or completed run returns the current state without error.
Only runs created via the API (/run-async or /run-sse) can be cancelled using this endpoint. Runs created through the dashboard UI or via the synchronous /run endpoint cannot be cancelled.

Endpoints

Choose sync, async, or streaming

Error Codes

Handle errors gracefully

Vault Credentials

Use password manager credentials in runs