Event sources

An event source is a named channel. Something publishes to it; every deployment subscribed to it runs.

Use one whenever more than one thing should react to something, or whenever the publisher should not have to know who is listening.

Creating one

A source needs a key — the name flows emit to:

await this.emit("order.paid", { orderId: 42 });

Beyond the key and a description, two settings matter:

Subscribing

A subscription is a binding between the source and a deployment, created from either side. When the source receives an event, every active subscription starts a run with that payload.

The receiving flow reads the payload as this.payload, and this.event describes the delivery — which source, which event id, and the cascade depth.

Filtering to one connection

A subscription to a service's source can be restricted to a single connection — events from this Shopify store, not from all of them. Leave it unset to receive from every connection.

Three ways an event arrives

From a flow. this.emit(key, payload) — see Emitting events.

From an inbound webhook. A webhook can be pointed at a source instead of at deployments. Each delivery becomes an event and fans out. This is how a provider's webhook reaches several unrelated flows, and how platform services ingest their providers.

From a platform service. A service declares its own topic sources (shopify.orders.create and so on). They are provided to every workspace, and the service's connections feed them.

Switching one off

An inactive source stops ingress, and each publisher learns about it differently:

PublisherWhat happens
this.emit() from a flowReturns { eventId: null, inactive: true }. No error — the flow carries on
An ingress webhook delivery404
The REST test-emitRefused

The asymmetry is deliberate. A flow asking "please deliver this" did nothing wrong, and pausing one source must not fail unrelated production runs. A human asking "did this work?" should be told plainly that it did not.

Cascades

An event can trigger a flow that emits another event. Each hop increases the event's depth (0 at a webhook or manual origin), and the platform refuses an emit that goes too deep.

That guard is what stops a flow that emits to the source that triggered it from running forever. this.event.depth lets a flow see where it is in the chain.

Every publish is recorded

As with the other triggers, one publish records exactly one event even if nothing is subscribed — so a source with no subscribers shows events and no runs, rather than nothing at all.

Next