Workspace Docs
Workflows

Registering a workflow

Step-by-step — create a workflow and its steps.

You register a workflow in the dashboard. A workflow is a name + trigger, and under it an ordered list of steps.

Steps

  1. New workflow — give it a name, pick a trigger (schedule / data change / heartbeat).
  2. Add a list step — pick the feature (e.g. reservations.list) and write the query that selects your rows.
  3. Add an acting step — pick the feature (e.g. reservations.update), set For each to the previous step's rows, and fill the values (e.g. status → no_show). Use ${item.id} to refer to each selected row.
  4. Activate — set the workflow to active. A heartbeat/cron workflow then fires on its own; a db one fires on the next matching change.

A worked example

workflow: { name: "No-show sweep", trigger: heartbeat }
steps:
  - name: find
    feature: reservations.list
    query: { where: { status: {in: [confirmed]}, starts_at: {lt: "now-30m"} }, limit: 50 }
  - name: mark
    feature: reservations.update
    each: "${steps.find.rows}"
    input: { id: "${item.id}", values: { status: "no_show" } }

Nullifying

Make sure an acting step moves rows out of the query's condition (here: confirmed → no_show). Otherwise the workflow keeps re-acting on the same rows.

See more in the Cookbook.

On this page