Skip to content

flow.rk ​

Durable flow: steps run in order on an event or a schedule, through the queue.

Lives in modules/<module>/flows/<name>.rk (apps may add glue flows) · Schema flow.json (source) · first line: # yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json

Properties ​

PropertyTypeMeaning
name requirednamesnake_case, never renamed once released
pattern ^[a-z][a-z0-9_]{0,62}$
labellabelA label in Bahasa Indonesia (required) and optionally English.
label.id requiredstring
label.enstring
descriptionobjectOwner sentence of what this flow does, conditions included (contract 0060 §1). Changes no behaviour.
description.id requiredstring
description.enstring
onstringEvent: <connector>.<trigger>, <model>.created|updated|submitted|cancelled, or omitted with schedule
schedulestringCron (5 fields) in system.scheduler.timezone
pattern ^(@(hourly|daily|weekly|monthly)|([0-9*,/-]+\s+){4}[0-9*,/-]+)$
steps requiredlist of object or object or object or object or object or object or object or object or object or object
at least 1
idempotencystring
queueobject
ifCELA CEL expression (plus Rangka helpers)

Example ​

From rangka-apps/modules/pipeline/flows/whatsapp_to_lead.rk (first 60 lines):

yaml
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/flow.json
name: whatsapp_to_lead
label: {id: Chat WhatsApp baru jadi lead}
on: whatsapp_business.message_received
steps:
  - {find: lead, where: phone == event.from, as: lead}
  - {find: customer, where: phone == event.from, as: customer}
  - if: lead == null && customer == null
    create: lead
    set:
      lead_name: event.profile_name
      phone: event.from
      source: "'whatsapp'"
      status: "'new'"
    as: lead
  - create: activity
    set:
      activity_type: "'whatsapp'"
      subject: truncate(event.text, 80)
      lead: lead.name
      due_date: today()
      done: 'true'
      notes: event.text
idempotency: event.message_id

Generated from the schema by website/scripts/gen-reference.mjs. Edit the schema, not this page.

Rangka OS is source-available under the Elastic License 2.0 (ELv2). Free to self-host.