foliot docs

API reference / Tasks / Complete a task out of band

Complete a task out of band

POST/apps/{appId}/tasks/complete

For a step you answered with 202, or claimed from a queue. The token resolves exactly once; a replay, or a token from before a redrive, is a conflict rather than a second completion. A completion that arrives before Foliot has recorded your 202 is also a 409, but it leaves the token unspent: send it again, and once the 202 is recorded it completes the step; a 409 that persists means the run no longer wants this task. The body is closed: a key the server does not know is a 400, not ignored. An output over the per-step size cap, or a next that names no step, is a 400 carrying the same message the run records, and unlike other 400s it is not a no-op: the step has already failed (its onFailure runs), and the token is spent.

Path parameters

appId
string
REQUIRED

The app's id, not its name, returned as app.id when the app is created. The id never changes.

Request body

next
string
OPTIONAL

Override the definition's next step. Must name a real step or a sentinel.

max length 100

output
any
OPTIONAL
token
string (uuid)
REQUIRED

The task token from the task request or the poll.

Responses

200 object OK
400 Error Invalid request.
401 Error Missing, malformed or unknown bearer token.
403 Error The token is valid but not permitted on this route.
404 Error No such resource.
408 Error The request body did not arrive in time.
409 Error Conflicts with existing state.
413 Error The request body is too large.
503 Error A dependency this route needs is unreachable.