Skip to main content
Update a workflow definition

Authorizations

token
string
query
required

Standard authorization for most API calls. This token identifies the logged-in user and their permissions. It is obtained either as a temporary token after a successful login or as a long-term API key.

Body

application/json
name
string
required

Name the workflow is known by. It identifies the definition, a metadata definition binds its documents to it by this name, and the rights that gate its transitions are named after it - so renaming a workflow leaves both the documents and the rights pointing at something that is no longer there.

Minimum string length: 1
Example:

"wf_archive"

startStateId
integer
required

State a document lands in when it is created, and the one it is put back into when its workflow is reset. It is also the state whose moves are listed when a client asks what is possible without naming one.

Required range: x >= 0
states
object[]
required

Every state a document running this workflow can sit in. A state is named by its own identifier, and two states may share neither that identifier nor their name.

actions
object[]

Moves a recipient carries out themselves, each one taking the document from the state it is offered in to the state it names. This is also the only kind of transition that can archive the document.

cancelStateId
integer

State a document is moved into when it is cancelled, which also archives it and hands it back to whoever cancelled it. Leave it out and the workflow simply cannot be cancelled.

Required range: x >= 0
requests
object[]

Moves a recipient raises for somebody else to answer, rather than completing a step themselves. They are recorded in the document's history as requests, and each counts as having been sent out unless its script says otherwise.

reworkStateId
integer

State a document returns to once a rework request has been answered, together with the recipient who raised that request. It is only of use alongside a request marked for rework.

Required range: x >= 0
scheduledTransition
object

Accepted but not stored - a scheduled transition belongs to an individual state, so set it on the entry in states that should advance on its own.

Response

The workflow definition was updated.

status
string

Outcome of the operation, reported as a status type constant.

Example:

"SUCCESS"