Skip to content

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

PropertyTypeRequiredDescription
stepsjsonrequiredThe ordered steps, each run by a Function.
retriesintegerHow many times a failed step retries.
bodystringThe Verb whose Action it is the durable body of, such as Order.refund; a Workflow with a body has no Trigger.

Object

JSON
{
  "$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, inverse executedBy.
  • A Workflow is started by many Triggers: when a Trigger fires, each Workflow it starts runs as a new Action. startedBy, inverse starts.
  • A Workflow is used in one Process: a Process does its work through Workflows, each the durable, executable part of the Process. usedIn, inverse uses.

Verbs

  1. createCreates a Workflow.
    POST /{namespace}/workflowsdoWorkflow.created
  2. getReturns one Workflow by id.
    GET /{namespace}/workflows/{id}readNo Event
  3. listReturns Workflows, newest first, one page at a time.
    GET /{namespace}/workflowsreadNo Event
  4. updateChanges the given properties of a Workflow.
    PATCH /{namespace}/workflows/{id}doWorkflow.updated
  5. deleteDeletes a Workflow; its history is kept.
    DELETE /{namespace}/workflows/{id}doWorkflow.deleted

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Workflow.createYesYesYesNo
Workflow.getYesYesYesYes
Workflow.listYesYesYesYes
Workflow.updateYesYesYesNo
Workflow.deleteYesYesYesNo

Call it

Text
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: 3, a failed upload runs three more times before the Workflow stops.