Events
Everything that happens in Flux is an event: runs changing state, datasets committing, triggers firing, connectors being published. The app uses them for live status; trigger rules use them to start pipelines; you can follow them too.
Events use the CloudEvents 1.0 layout:
{"specversion": "1.0", "id": "5b0e…", "type": "flux.run.status", "source": "flux-api/orchestrator", "subject": "flux.run.r-20261001020000-8f2c1a3b.status", "time": "2026-10-01T02:00:00.123Z", "data": {"run_id": "r-20261001020000-8f2c1a3b", "status": "running", "pipeline": "revenue", "version": 3, "trigger": "schedule"}}| Type | When | Data |
|---|---|---|
flux.run.status |
A run is queued, running, committing, succeeded, failed or cancelled | run_id, status, pipeline, version, trigger, error, committed |
flux.run.node |
A node starts or finishes in a shard | node, state, rows, error |
flux.run.progress |
Rows flowing, every few seconds | shard, rows per node:port, elapsed_ms |
flux.run.log |
Runner log lines | shard, level, message, node |
flux.dataset.committed |
A run or a write flush commits a new snapshot | dataset, snapshot_id, rows, files, run_id or flush_seq |
flux.trigger.fired |
A schedule or trigger rule starts a run | rule, pipeline, run_id |
flux.forge.published, flux.forge.revoked |
A connector is published or revoked | name, version, platform, sha256, actor, reason |
flux.external.<name> |
Another system posts to /api/events/external/<name> |
whatever it sent (a JSON object, up to 16 KB) |
flux.system.… |
Service lifecycle and admin activity (admins only) | varies |
Run events are kept for 14 days (logs 3), dataset, trigger and external events for 30,
Forge events for a year. GET /api/events searches the stored ones.
Follow events live
Section titled “Follow events live”Open a WebSocket to wss://flux.nasterra.com/ws. Browsers use the session cookie; other
clients send {"op": "auth", "token": "<API key>"} first. Then subscribe to topics:
{"op": "subscribe", "id": "s1", "topic": "run:r-20261001020000-8f2c1a3b"}| Topic | Events |
|---|---|
runs |
Status changes of every run, from now on |
run:<id> |
Everything about one run, including what already happened |
run:<id>:log |
One run’s log lines |
datasets / dataset:<name> |
Dataset commits |
triggers |
Firings |
forge |
Connector publishes and revocations |
system |
Service events (admins) |
Messages arrive as {"op": "event", "sub": "s1", "event": {…}}. Send {"op": "ping"} to
keep a quiet connection open. A client that falls behind is disconnected with code 4008;
reconnect and resubscribe (run topics replay their history). The socket closes when the
token expires.
Webhooks
Section titled “Webhooks”Pipeline notifications with "channel": "webhook"
POST this to your URL:
{"type": "flux.run.notification", "delivery": 812, "run": {"run_id": "r-…", "pipeline": "revenue", "version": 3, "status": "succeeded", "outcome": "warning", "trigger": "schedule", "started_at": "…", "finished_at": "…", "duration": "1m 15s", "rows_written": 1234, "targets": [{"node": "out", "dataset": "revenue", "rows": 1234, "files": 1}], "warnings": ["2 rows had invalid dates"], "error": "", "error_node": "", "run_url": "https://flux.nasterra.com/app/runs/r-…"}}Headers: X-Flux-Event: run.<outcome>, X-Flux-Delivery: <id> and
X-Flux-Signature: sha256=<hex>, the HMAC-SHA256 of the raw body with the shared webhook
secret. Verify it before acting on the request:
import hashlib, hmac
def valid(body: bytes, header: str, secret: str) -> bool: expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, header)Answer with any 2xx within 10 seconds. Other answers are retried after 30 s, 2 min,
10 min, 30 min and 2 h. Deliveries carry the same delivery id on every retry, so you can
ignore repeats.