Streaming Events
Fabric provides real-time event streaming for all domain events — workflow execution, tenancy changes, and provider operations.
Subscribing to Events
Section titled “Subscribing to Events”Stream All Events
Section titled “Stream All Events”import { FabricClient } from "@fabric-platform/sdk";
const fabric = new FabricClient({ apiKey: "fab_xxx" });
await fabric.streamEvents((event) => { console.log(event.kind, event.node_key, event.payload);});from fabric_platform import FabricClient
fabric = FabricClient(api_key="fab_xxx")
for event in fabric.stream_events(): print(event["kind"], event.get("node_key"), event.get("payload"))use fabric_sdk::FabricClient;
let client = FabricClient::new("http://localhost:3001", api_key)?;
let mut stream = client.stream_events().await?;while let Some(event) = stream.next().await { println!("{} {:?}", event.kind, event.payload);}curl -N http://localhost:3001/v1/events/streamEvents arrive as SSE with this format:
event: workflow.run.starteddata: {"id":"...","kind":"workflow_run_started","run_id":"...","payload":{}}
event: workflow.node.completeddata: {"id":"...","kind":"workflow_node_completed","node_key":"generate","payload":{"output":{}}}Stream Events for a Specific Workflow Run
Section titled “Stream Events for a Specific Workflow Run”const result = await fabric.waitForRun("<run-id>", { onEvent: (event) => { console.log(`Node ${event.node_key}: ${event.kind}`); },});for event in fabric.stream_run_events("<run-id>"): print(f"Node {event.get('node_key')}: {event['kind']}")let mut stream = client.stream_run_events("<run-id>").await?;while let Some(event) = stream.next().await { println!("Node {}: {}", event.node_key.unwrap_or_default(), event.kind);}curl -N http://localhost:3001/v1/workflow-runs/{run_id}/eventsThis endpoint:
- Replays all existing events for the run (catch-up)
- Streams live events as they occur (filtered to this run)
A client connecting mid-execution receives the full event history before seeing live updates.
Stream Events for a Specific Job
Section titled “Stream Events for a Specific Job”await fabric.streamEvents("<job-id>", (event) => { console.log(event.kind, event.payload);});for event in fabric.stream_job_events("<job-id>"): print(event["kind"], event.get("payload"))let mut stream = client.stream_job_events("<job-id>").await?;while let Some(event) = stream.next().await { println!("{} {:?}", event.kind, event.payload);}curl -N http://localhost:3001/v1/jobs/{job_id}/eventsSame replay + live streaming behavior, filtered to the specific job.
WebSocket
Section titled “WebSocket”wscat -c ws://localhost:3001/v1/events/wsWebSocket delivers the same event structure as SSE, using JSON messages.
Event Types
Section titled “Event Types”Workflow Events
Section titled “Workflow Events”| Event | Description |
|---|---|
workflow.run.created | Run was created |
workflow.run.started | Executor began processing |
workflow.run.completed | All nodes completed successfully |
workflow.run.failed | One or more nodes failed |
workflow.run.cancelled | Run was cancelled |
workflow.node.ready | Node dependencies satisfied |
workflow.node.started | Node execution began |
workflow.node.completed | Node finished with output |
workflow.node.failed | Node execution failed |
workflow.node.skipped | Node skipped (dependency failed or cancelled) |
Job Events
Section titled “Job Events”| Event | Description |
|---|---|
job.created | Job was created |
job.started | Executor began processing |
job.completed | Job finished with output |
job.failed | Job execution failed |
Tenancy Events
Section titled “Tenancy Events”| Event | Description |
|---|---|
organization.created | Organization was created |
team.created | Team was created |
membership.created | Membership was created |
invitation.created | Invitation was sent |
invitation.accepted | Invitation was accepted |
invitation.revoked | Invitation was revoked |
Event Payload Structure
Section titled “Event Payload Structure”Every event follows this structure:
{ "id": "event-uuid", "kind": "workflow.node.completed", "organization_id": "org-uuid or null", "workflow_id": "wf-uuid or null", "run_id": "run-uuid or null", "node_key": "generate or null", "payload": { "output": {}, "context_version": 3 }, "timestamp": "2026-03-19T12:00:00Z"}Webhooks
Section titled “Webhooks”Fabric supports webhook delivery for events with:
- HMAC signing — Verify event authenticity with a shared secret
- Exponential backoff — Automatic retries on delivery failure
- Event filtering — Subscribe to specific event types
All transports (SSE, WebSocket, webhooks) deliver the same semantic event structure.