The events below start flows through an event trigger. They are not a
subscription surface for extensions: there is no stable set of domain events an
extension can listen to, and a Solution cannot register events of its own yet.
Flow events
A flow emits an event through theemit_event node. Emission is queued rather
than synchronous — QueuedFlowTriggerEventPublisher hands it to the
scheduled.triggers queue, after the change that raised it is committed, so a flow that
emits does not wait for whatever consumes the event. A flow started by such an
event runs for the contact whose conversation emitted it; an event emitted by a
flow without a contact starts nothing.
Such a start never cuts into a conversation, and it happens once per event and
trigger, however often its job is retried. It starts nothing when an operator
handles the contact’s thread or the thread waits for one, when the contact has no
channel on an active channel of the trigger’s assistant, when the contact’s
conversation with that assistant moved in the last 30 minutes or sleeps in a
delay, or when that conversation is the one that emitted the event and is still
going — to hand the contact over to the started flow, end the emitting flow after
emit_event. A conversation with that assistant that has not moved for longer is
ended first, as /reset ends one, so the contact never has two live conversations
with one assistant. A skipped start is written to the log
(flow.event.start_skipped_busy, flow.event.start_skipped_no_channel), and it
is not counted against the plan’s runs.
An event trigger on a flow event can be limited to events from chosen assistants
(Only from assistants in the builder, assistant_filter in the trigger’s
settings): the flow then starts only on events emitted by flows that ran for one of
those assistants. With no assistants chosen, it starts on the event from any
assistant of the tenant.
Core events
Core raises these events itself. An event trigger on one of them starts its flow without a contact — even when the event is about a contact, whose id is then in the event data — so the flow cannot be published with a step that needs one. Every active event trigger on the event starts once per event, whichever assistant it belongs to. A Core event comes from no assistant, so its trigger takes no assistant filter: publishing refuses one.
Every event also carries
event_id and occurred_at (ISO 8601). The data holds
identifiers, never a contact’s name or phone. Names starting with core. belong to
Core: an emit_event step cannot use them.
Chains of events
An event raised while a flow runs — byemit_event, or by something the flow does,
such as setting a tag — is one level deeper than the run that raised it; an event
raised outside any flow is level 1. An event deeper than level 5 starts nothing,
and the log records flow.event.chain_depth_exceeded. This stops flows that keep
setting each other off. A conversation started by an event keeps its level for as
long as it lives, so a conversation started at level 5 raises no events later on,
whatever message continues it.
Triggers
What an event causes is resolved through the trigger contracts infapost/foundation:
Trigger fan-out runs on
scheduled.triggers, separate from message handling, so a
broad fan-out cannot delay a conversation — see Queues.
Analytics
Analytics is a distinct stream, not the event bus. It is written throughAnalytics\Contracts\AnalyticsWriterInterface with AnalyticsEvent and
AnalyticsEventType, and it exists to record what happened rather than to
trigger behaviour.
History
Flow\History\HistoryEventType enumerates the event kinds recorded against a
flow session’s history. It is a record of session progression, readable after the
fact — not a subscription surface.
If you need to react to something
Today that means a node handler on the flow, or a registered schedule — see Building a Plugin. If the reaction you need cannot be expressed either way, that is a missing contract infapost/foundation, and the
right move is to propose it rather than to hook into a Core internal that carries
no stability promise.