Title: Run a saved routine Upstream: POST /webhook/run-routine

Executes an existing routine and returns a dispatch_id. The routine already holds its config, selectors and URL list, so nothing is created and nothing is duplicated. The run is asynchronous: the tool returns immediately.

Parameters

  • apiKey (string, required).
  • routineId (integer ≥ 1, required) — from create_template_routine, or the routine_id field of a scrape_unblocker response.
  • max_items (integer ≥ 0) — cap on how many input rows this run processes. Not saved on the routine. Omit or 0 for no cap.

Example

{
  "name": "run_routine",
  "arguments": { "apiKey": "js_YOUR_API_KEY", "routineId": 5120, "max_items": 50 }
}
{ "dispatch_id": "disp_abc123", "message": "Routine started", "success": true }

Then poll with get_job_status and collect with check_job. If the response already carries result rows, the server appends diagnostics to it.

Why this instead of scraping again

Re-running scrape_unblocker with the same selectors creates a new company, config and routine on every call. Measured on one task attempt: six of each left behind. run_routine reuses the one you already have. The instructions the server hands the agent say so explicitly: keep config_id and routine_id, and re-run the routine.

Where routine ids come from

scrape_unblocker(...)                  →  response.routine_id   (created as a side effect)
create_template_routine(configId)      →  routineId             (a new routine on an existing config)

The routine replays its stored request exactly, including any options.headers the config was created with, even though this tool takes no header parameter. A routine created from a scrape that sent X-Page-Number: 2 sends that header on every run. There is no per-run override; to change a stored header, save a new config.

Use max_items to test a slice of a large routine before committing to the whole list, and read get_routine_concurrency first: every routine starts at concurrency 1, and nothing in a scrape's output mentions it.

Last updated: September 22, 2026