Report Failure
POST /api/factory/failed
A retryable failure puts the run back in the queue, at its place, up to 3 retries; a retry
runs the station's handler again from the start. A non-retryable failure, or a failure after
the last retry, marks the work record failed.
A failed run is not the same as a failed workpiece: a run that processes ten workpieces and
sends two to the failed bin still completes, and reports the outcomes with
attach-workpieces.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
work_record_id | string | Yes | task.work_record.id from the poll response |
error | string | No | What went wrong |
retryable | boolean | No | Default true |
Responses
{ "success": true, "work_record_id": "wr8Hn2QpLx1c", "action": "retrying", "retry_count": 1, "max_retries": 3 }
{ "success": true, "work_record_id": "wr8Hn2QpLx1c", "action": "failed", "message": "Run marked as failed" }
Errors
| Status | Code | Meaning |
|---|---|---|
400 | VALIDATION_ERROR | work_record_id is required |
403 | FORBIDDEN | The run belongs to another org |
404 | NOT_FOUND | No such run |