Workflow
A Workflow is the durable, executable body of one Action: its steps, the Functions that run them, retries, and waits.
Triggers start it, and a Process groups it with others.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
steps | json | required | The ordered steps, each run by a Function. |
retries | integer | How many times a failed step retries. | |
body | string | The Verb whose Action it is the durable body of, such as Order.refund; a Workflow with a body has no Trigger. |
Object
{
"$id": "https: //api.sb/ patentpad.com/ workflows/ workflow_1",
"$type": "Workflow",
"steps": {},
"retries": 1,
"body": "Example body"
}Relationships
- A Workflow executes one Action: a Workflow is the durable body of one Action: its steps, retries and waits.
executes, inverseexecutedBy. - A Workflow is started by many Triggers: when a Trigger fires, each Workflow it starts runs as a new Action.
startedBy, inversestarts. - A Workflow is used in one Process: a Process does its work through Workflows, each the durable, executable part of the Process.
usedIn, inverseuses.
Verbs
createCreates a Workflow.POST /{namespace}/workflowsgetReturns one Workflow by id.GET /{namespace}/workflows/{id}listReturns Workflows, newest first, one page at a time.GET /{namespace}/workflowsupdateChanges the given properties of a Workflow.PATCH /{namespace}/workflows/{id}deleteDeletes a Workflow; its history is kept.DELETE /{namespace}/workflows/{id}
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Workflow.create | Yes | Yes | Yes | No |
Workflow.get | Yes | Yes | Yes | Yes |
Workflow.list | Yes | Yes | Yes | Yes |
Workflow.update | Yes | Yes | Yes | No |
Workflow.delete | Yes | Yes | Yes | No |
Call it
Add a workflow to ShiftNote.Example
At a translation marketplace, the Workflow behind Order.fulfill drafts the translation, then waits up to 48 hours for the translator’s certification. With retries:, a failed upload runs three more times before the Workflow stops.