Complete Task

POST /api/factory/complete

Stores the output of the station's handler on the work record and marks it completed.

Request Body

FieldTypeRequiredDescription
work_record_idstringYestask.work_record.id from the poll response
outputobjectNoWhat the station's handler returned; stored as the work record's output
curl -X POST "https://orchestrator.assemblyline.sh/api/factory/complete" \
  -H "api-key: al_xxxxxxxxxxxxxxxxxx" \
  -H "api-secret: xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "work_record_id": "wr8Hn2QpLx1c", "output": { "done_count": 2, "failed_count": 1 } }'

Response

{ "success": true, "work_record_id": "wr8Hn2QpLx1c", "message": "Run completed" }

Errors

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