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.
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.
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.
{ "url": "https://example.com", "goal": "Check that checkout succeeds with a saved test account", "agent_config": { "mode": "strict" }}
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.
When a run fails, error is a structured object (otherwise it is null):
{ "code": "service_busy", "message": "Browser crashed during execution", "category": "SYSTEM_FAILURE", "retry_after": 60, "help_url": "https://docs.tinyfish.ai/prompting-guide", "help_message": "Need help? Check out our goal prompting guide for tips and examples."}
Field
Description
code
Machine-readable error code for programmatic handling (optional)
message
Human-readable error message describing why the run failed
category
One of SYSTEM_FAILURE, AGENT_FAILURE, BILLING_FAILURE, or UNKNOWN
retry_after
Suggested retry delay in seconds, or null if not retryable
help_url
URL to troubleshooting documentation (optional)
help_message
Human-readable guidance (optional)
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.
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:
?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:
screenshots
Behavior
url (default)
Each step’s screenshot is an absolute URL to the screenshot image
base64
Each step’s screenshot is an inline data:image/jpeg;base64,... data URI (~50–100 KB each — use only for audit trails or visual debugging)
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.
html
Behavior
url (default)
Each step’s html is an absolute URL to the HTML snapshot
none
HTML URLs are omitted (html is null)
Each step has the following shape (this example reflects the default screenshots=url):
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.
Scenario
Response status
cancelled_at
message
Run cancelled
CANCELLED
Timestamp
null
Already cancelled
CANCELLED
Timestamp
"Run already cancelled"
Already completed
COMPLETED
null
"Run already finished"
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.