The server hands every session a set of instructions written for an agent working on its own. This page is the workflow part of those instructions, so you can predict what an agent will do and check its work against it.
The six steps
- Check what already exists.
list_available_configswithurl_containsfor the site, andget_public_flowfor a published pipeline. Reuse beats rebuilding. - Look at the page with
get_html. - If the data is not in the HTML, do not guess selectors and do not jump to browser mode. Call
discover_api_endpoints; it reveals the JSON endpoint the page loads its data from, and calling that directly is far cheaper than rendering. Read one full body withread_captured_responseso paths are written against the real shape. - Extract with
scrape_unblocker,mode: "http"first. Against a JSON endpoint setattribute_typetoJSONand make eachselectora dotted path. - Check the diagnostics. Empty fields, or
[]fields whose lengths disagree, mean the job is not finished, whatever the status says. Fix and re-run before moving on. - Finish the job.
create_templategives the config a name,add_template_urloradd_template_bulk_urlsextend its URL list,run_routineruns it,check_jobcollects the results.
As a diagram
list_available_configs(url_contains) ──found──► run_routine(routineId)
│ nothing
▼
get_html(url, mode: http)
│
├── data present ────► scrape_unblocker(mode: http, CSS/SCHEMA/NEXT_DATA selectors)
│
└── data absent ─────► discover_api_endpoints(url)
│
▼
read_captured_response(dispatch_id, i)
│
▼
scrape_unblocker(endpoint URL, mode: http, JSON paths)
│
▼
diagnostics clean? ──no──► fix selectors, re-run
│ yes
▼
create_template → add URLs → set_routine_concurrency → run_routineCost discipline
- Start with
http. Browser mode is slower and more expensive, and afterdiscover_api_endpointsit is usually unnecessary. - Switch to
browseronly with evidence: a clean http attempt whose diagnostics came back empty is such evidence, and the agent can decide that itself. - Never pass
options.capture_networkjust to look around. Usediscover_api_endpointsfor the index andread_captured_responsefor one body at a time. - Pass
options.company_nameso repeated work on one site stays in one folder. - Do not re-run
scrape_unblockerwith the same selectors; run the routine it created.
What the agent asks the user
Only things that are genuinely the user's to decide: what data they want and what they are willing to spend. Never something a tool can tell it. When unsure how a tool works, the agent is told to call search_docs before guessing.
Reporting
The agent is asked to say what it did, what it verified, and what it could not verify. "The prices are correct, and the undiscounted-price field is populated, but on this sample it never differed from the current price, so I have not proven it works" is a better answer than a confident table. If something no tool can do comes up, it should say so plainly.
Freshness. Prefer live pages over sitemap.xml. A sitemap is a fallback for when direct discovery is impossible or the user explicitly wants a full URL inventory.