Skip to content
Viewing as a member

WorkflowDB

Each page here is one workflow. Its frontmatter is the definition that KBVE Workflows ships in its image and runs; the body is what it is for. Run them, and watch what they did, from Workflows.

Writing one

workflow:
trigger: { manual: true, cron: '0 9 * * *', webhook: false }
input:
author: { type: string, default: Keats, description: Whose poem. }
steps:
- id: poem
windmill: { path: f/web/poem, args: { author: '${input.author}' } }
- id: shout
firecracker:
rootfs: alpine-python
env: { POEM: '${steps.poem.output}' }
code: |
import os; print(os.environ["POEM"].upper())
- id: ping
after: []
edge: { function: health }
  • A step is exactly one of windmill (path, args), edge (function, body) or firecracker (rootfs, code, and optionally entrypoint, env, packages, timeout_ms, vcpu_count, mem_size_mib).
  • Order: a step runs after the one above it unless it names its own after; after: [] starts it at once. Steps with nothing between them run side by side.
  • Data: ${input.<name>} and ${steps.<id>.output.<path>}. A value that is one whole ${...} keeps its type; inside other text it is spliced in as text. A step can only read steps it runs after. A firecracker step’s output is stdout, stderr, exit_code and, when stdout is JSON, json.
  • Per step: timeout_ms (default 60 s, a VM’s own timeout plus 15 s), retries (up to 5, backing off from 1 s) and when, which skips the step unless its value is truthy. A failed step blocks what runs after it and nothing else.
  • Input types: string, number, boolean, json. A cron workflow needs a default for every input.
  • Triggers: manual (default on), cron (five fields, UTC) and webhook, posted to /api/workflows/hooks/<slug> with the run’s input as the body, x-kbve-timestamp: <unix seconds> (within five minutes) and x-kbve-signature: sha256=<hex HMAC-SHA256 of "<timestamp>.<slug>.<body>">. A request is accepted once.
  • What runs is fixed: ${...} is refused in a firecracker step’s code, rootfs, entrypoint and packages, a Windmill path and an edge function. Input reaches a step through args, body or env only.

The definitions are checked by cargo test -p kbve-workflows, so a bad one fails CI rather than a run.