pub const CREATE_OUTBOX_TABLE: &str = "
CREATE TABLE IF NOT EXISTS outbox (
dispatch_key TEXT NOT NULL UNIQUE,
workflow_id TEXT NOT NULL,
ordinal INTEGER NOT NULL,
activity_type TEXT NOT NULL,
input BLOB NOT NULL,
status TEXT NOT NULL,
attempt INTEGER NOT NULL,
visible_after TEXT NOT NULL,
run_id TEXT,
claimed_at TEXT,
PRIMARY KEY (dispatch_key)
)";Expand description
Durable fan-out dispatch outbox.
dispatch_key ("{workflow_id}:{ordinal}") is UNIQUE: it is the database-level idempotency
guard, so a re-issued append of the same fan-out batch silently ignores the duplicate rows via
INSERT OR IGNORE. status is one of pending/claimed/done/failed; visible_after
fences retry backoff so a row is not re-claimed before its delay elapses; nullable
claimed_at records the durable claim instant for live stale-claim reconciliation; nullable
run_id records the concrete run that staged the row when known.