Flows

Workflows definition

Define a Flows workflow in YAML as an ordered sequence of stages.

Within the Flows service, a Workflow refers to a template that defines an ordered sequence of actions, called stages, to be executed as a Workflow Instance.

Workflow Definition Syntax#

A workflow definition is a YAML file, with the following structure:

yaml
---
name: "my-workflow"
stages:
  - send:
    # ...
  - wait_event:
      event: deposit.confirmed
  - delay:
      seconds: 7d
  - send:
    # ...

Available stages#

Currently, the following stages are supported:

StageDescription
sendTransfers value from a source to a destination. This stage is compatible with ledgers, payments, and wallets.
wait_eventMakes the workflow instance wait for an event to be emitted by an external system.
delayMakes the workflow instance wait for a given amount of time.

To learn more about each stage, please refer to the dedicated documentation page in the following section.

Using variables#

Variables can be used in the workflow definition, by using the ${} syntax. Variables will then be expanded according to the values passed at workflow execution time.

yaml
---
stages:
  - wait_event:
      event: "${event}"

Lifecycle#

Workflows have a lifecycle of their own, and need to be created before they can be executed as instances - follow on to the next section to learn more and create your first workflow.