Flows: first-run guide
A flow is a small JSON file (.reyinflow.json, at most 32 KiB) that says what starts it,
and which labels to print or requests to make. This guide covers what a person needs to know
before turning one on. The format is in the flow format spec;
the engine is described in reyin-flow.
Read this first
Section titled “Read this first”QR-CONTENT-BUYER-CHOSEN. The content of QR codes and barcodes is chosen by whoever supplied the data. A flow that prints a value from an order prints what the buyer typed; Reyin prints it as given, does not check where a link leads and never follows one. Anyone who scans a printed code should treat it like any message from a stranger. This is a documented limit of version 1, not something a setting removes. The import summary of a flow that prints shows the same notice.
Before you turn a flow on
Section titled “Before you turn a flow on”- An imported flow is held: nothing is stored or runs until you approve it, and it is stored disabled. Read its summary: what starts it, which printers and templates it uses, which connections it sends to and which fields of an order leave the machine. Approval is tied to the whole document, not only the summary; if the file changes in any way, you are asked again.
- The two examples in
crates/reyin-flow/flows/examples/run on synthetic data only. Their fixtures are invented, and no conformance with any shop platform is claimed. Treat them as a starting point, not as a tested integration. - Automation runs inside
reyindas your user. Any process that runs as the same user can read the control token and drive the daemon; that High risk remains in the default mode (see the daemon guide). - The caps on labels per run, per flow and per day belong to your settings. A flow file can lower them, never raise them. A run that would pass a cap waits for you to confirm it.
From the command line
Section titled “From the command line”reyin flow imports, approves, enables and runs flows through a running reyind; the commands are
in the command line guide and the reyin-cli spec.
reyin flow approve shows the summary described above with your bindings applied, asks you to type the
flow id and approves only that summary. A run over a cap waits for reyin flow confirm-run, and an
interrupted run for reyin flow resolve (retrying a step can print its label twice); both ask you to type
the run id and refuse without a terminal.
What is kept, and for how long
Section titled “What is kept, and for how long”| What | Kept | Notes |
|---|---|---|
| Run records | 30 days, newest 500 per flow | Ids, times, states and a redacted excerpt |
| Dry runs | 24 hours | Marked dry |
| Audit rows | 180 days, never fewer than the flow’s newest 100 | Ids and codes only, no order data |
| Dedupe claims | 7 days | A repeated delivery of the same order does not print twice |
| Run context | Until the run ends | What a run needs to resume after a restart; never shown in history |
A run record shows the shape of an order, not its content: every value reads <redacted>
unless the flow lists it under history.keep. Names that look like credentials are always
replaced. Order data in a run’s resume context is deleted when the run ends. Object key names are part of the shape and are shown, so do not use buyer data as a key name in a payload you map. An interrupted run that nobody decides on within 24 hours is ended as failed and its saved context is deleted.
After a restart
Section titled “After a restart”Runs that were in progress are looked at one by one. A run goes on only from its first unfinished step, only when that step never started or can safely be done again (it carries a batch key or an idempotency key), and only when its saved context is complete. Otherwise it is marked Interrupted with the reason, and a person decides. Nothing is ever printed twice to make up for a restart. After a restart the daily label count may be slightly higher than what printed (a step that was resumed counts again); it falls back after 48 hours.
Schedules
Section titled “Schedules”every_secs (60 to 604,800) fires on the clock grid, in UTC. After downtime a schedule runs
once for the latest missed tick, not once per missed tick. Cron expressions are not part
of version 1.
Revisions
Section titled “Revisions”Reyin keeps the current and the previous revision of each flow. A run keeps the revision it started with; a new revision starts disabled until you enable it.
Source: docs/guides/flows.md at fe2ada6890.