Workspace Docs
Workflows

Cookbook

Ready-to-use workflow examples, each verified end-to-end.

Copy-ready workflows. Each is one workflow row + its steps. All were verified running against the real dispatch pipeline.

No-show sweep

Confirmed reservations whose slot passed 30 minutes ago → no_show.

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" } } }

Abandoned holds

Pending reservations created over an hour ago → cancel.

workflow: { name: "Abandoned holds", trigger: heartbeat }
steps:
  - { name: find, feature: reservations.list, query: { where: { status: {in: [pending]}, created_at: {lt: "now-1h"} } } }
  - { name: drop, feature: reservations.cancel, each: "${steps.find.rows}", input: { id: "${item.id}" } }

Stale conversation auto-close

Open conversations idle for 2 days → closed.

workflow: { name: "Stale close", trigger: heartbeat }
steps:
  - { name: idle, feature: conversations.list, query: { where: { status: {in: [open]}, last_message_at: {lt: "now-2d"} } } }
  - { name: close, feature: conversations.update, each: "${steps.idle.rows}", input: { id: "${item.id}", values: { status: "closed" } } }

Convert repeat visitors (server-side join)

A completed reservation whose customer isn't active yet → activate the customer. The join nullifies itself: once the customer is active, the row drops out.

workflow: { name: "Post-visit convert", trigger: heartbeat }
steps:
  - name: visited
    feature: reservations.list
    query:
      where: { status: {in: [completed]} }
      embed: { customer_id: { inner: true, where: { status: {in: [lead, qualified]} } } }
  - { name: activate, feature: customers.update, each: "${steps.visited.rows}", input: { id: "${item.customer_id}", values: { status: "active" } } }

Promotion expiry (nightly)

Active promotions past their end date → archived.

workflow: { name: "Promo expiry", trigger: cron, schedule: "0 3 * * *" }
steps:
  - { name: expired, feature: promotions.list, query: { where: { status: {in: [active]}, ends_at: {lt: "now"} } } }
  - { name: archive, feature: promotions.update, each: "${steps.expired.rows}", input: { id: "${item.id}", values: { status: "archived" } } }

First booking promotes the customer (db trigger)

A new reservation → promote its customer to qualified.

workflow: { name: "First booking", trigger: db, source_table: reservations, source_event: insert }
steps:
  - { name: promote, feature: customers.update, input: { id: "${trigger.customer_id}", values: { status: "qualified" } } }

On this page