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

FieldTypeRequiredDescription
work_record_idstringYestask.work_record.id from the poll response
errorstringNoWhat went wrong
retryablebooleanNoDefault 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

StatusCodeMeaning
400VALIDATION_ERRORwork_record_id is required
403FORBIDDENThe run belongs to another org
404NOT_FOUNDNo such run