Hanzo AI
OpenapiGit

Create state

Records a task's progress and that of its steps, and answers with the result this side now holds — which is how a runner learns its task was stopped from…

POST /v1/runner/state

Addresshttps://api.hanzo.ai/v1/runner/state
MethodPOST
Operationpost_runner_state
AuthAuthorization: Bearer $HANZO_API_KEY

Records a task's progress and that of its steps, and answers with the result this side now holds — which is how a runner learns its task was stopped from somewhere else.

Request

17 fields, body application/json (required).

FieldInTypeRequiredDescription
x-runner-uuidheaderstring
x-runner-tokenheaderstring
outputsbodyrunner.Pair[]Outputs are values the job has published since the last report.
outputs[].namebodystringName is what the value is filed under.
outputs[].valuebodystringValue is the value itself, always a string on this wire.
statebodyrunner.State
state.idbodyinteger (int64)ID is the task this is about.
state.resultbodystringResult is how it finished; empty means it has not.
state.startedbodyinteger (int64)Started is when it began, in unix nanoseconds; 0 is unset.
state.stepsbodyrunner.Step[]Steps is each step's own progress, in the order the workflow declares.
state.steps[].idbodyinteger (int64)ID is the step's position in the job, counting from 0.
state.steps[].log_indexbodyinteger (int64)LogIndex is the first line of the task log this step wrote.
state.steps[].log_lengthbodyinteger (int64)LogLength is how many lines it wrote from there.
state.steps[].resultbodystringResult is how the step finished; empty means it has not.
state.steps[].startedbodyinteger (int64)Started is when it began, in unix nanoseconds; 0 is unset.
state.steps[].stoppedbodyinteger (int64)Stopped is when it finished, in unix nanoseconds; 0 is unset.
state.stoppedbodyinteger (int64)Stopped is when it finished, in unix nanoseconds; 0 is unset.

Response

StatusBodyMeaning
200runner.StateOutok
defaultproblem-detailsrefused

200 body — 13 fields.

FieldInTypeAlwaysDescription
statebodyrunner.State
state.idbodyinteger (int64)ID is the task this is about.
state.resultbodystringResult is how it finished; empty means it has not.
state.startedbodyinteger (int64)Started is when it began, in unix nanoseconds; 0 is unset.
state.stepsbodyrunner.Step[]Steps is each step's own progress, in the order the workflow declares.
state.steps[].idbodyinteger (int64)ID is the step's position in the job, counting from 0.
state.steps[].log_indexbodyinteger (int64)LogIndex is the first line of the task log this step wrote.
state.steps[].log_lengthbodyinteger (int64)LogLength is how many lines it wrote from there.
state.steps[].resultbodystringResult is how the step finished; empty means it has not.
state.steps[].startedbodyinteger (int64)Started is when it began, in unix nanoseconds; 0 is unset.
state.steps[].stoppedbodyinteger (int64)Stopped is when it finished, in unix nanoseconds; 0 is unset.
state.stoppedbodyinteger (int64)Stopped is when it finished, in unix nanoseconds; 0 is unset.
storedbodystring[]Stored names the outputs the forge has written down, so the runner stops resending them.

Failure carries the platform error shape — see Errors.

Examples

hanzo runner state

Git API · All Hanzo APIs · Interactive reference

How is this guide?

On this page