Piloterr

Errors and retries

See why rows failed, then call only the failed rows again in a retry run.

Read the errors

GET /v1/runs/{id}/errors groups the failed and invalid rows by status, HTTP status and message, most frequent first, with up to 5 row numbers each:

{
  "total": 116,
  "groups": [
    { "status": "error", "http_status": 404, "error": "Company not found", "count": 98, "rows": [3, 17, 52, 60, 71] },
    { "status": "invalid", "http_status": null, "error": "Missing required parameter: domain", "count": 18, "rows": [8, 9, 120, 121, 400] }
  ]
}

Read the rows themselves with GET /v1/runs/{id}/results?status=error or ?http_status=404. See Results and exports. Once the results are deleted, both answer 410 results_expired.

Retry the failed rows

When some rows failed for a passing reason (timeouts, a busy target), call only those again. First, see what a retry would do:

curl https://dataflow.piloterr.com/v1/runs/RUN_ID/retry-failed -H "x-api-key: YOUR_API_KEY"
{
  "run_id": "RUN_ID",
  "rows": 41,
  "recoverable": 41,
  "non_recoverable": 75,
  "credit_cost": 1,
  "credits": 41,
  "estimated": false,
  "available": 12000
}

run_id is the run first launched, rows the rows the retry would call, credits what the retry may spend (its rows at credit_cost, or the project's max_cost_per_run plus one row when that is lower), and available your balance (null when unknown or unlimited). estimated is true for an endpoint billed per result or per GB: credits then counts each row at its minimum.

Then start it with POST on the same path (202 with the new run). The retry is a new run with trigger: "retry" and parent_run_id set to the run first launched. It calls the rows as the first run froze them, with the project's current mapping, endpoint and API key, and keeps the rows' numbers, so its results line up with the first run's.

  • Recoverable rows are retried by default: no answer, 402, 408, 429, rate-limit 401 and 5xx.
  • Non-recoverable rows would most likely fail the same way: invalid rows (fix the mapping first) and the other 4xx, such as 404. Add ?include_non_recoverable=true to call them too, on both GET and POST.
  • Same rules as starting a run: one run at a time per project (409 run_in_progress, so the run must have ended), the project neither archived nor disabled, your workspace's limits, 402 when your balance does not cover credits unless ?force=true, and 503 queue_unavailable when it could not be queued.
  • 409 nothing_to_retry when no row qualifies (details.non_recoverable counts the rows left out); 410 results_expired once the first run's results are deleted.

A run and its retries form a family. A retry of a retry hangs off the same first run, and only calls the rows still failing at their latest attempt. A retry has its own counters, its own max_cost_per_run budget, and only the retried rows in its results. To download the family as one file, with one line per row and the latest attempt winning, use GET /v1/runs/{id}/export?merged=true from any run of the family: see Download an export.

On this page