TriggerFlow Concepts
Visualization boundary: Mermaid may illustrate anonymous links, but JSON/YAML export still requires named handlers and conditions.
1. Core object relationships
How to read this diagram
TriggerFlowis the definition,Executionis one run.TriggerFlowRuntimeDatais not just an event object. It is the runtime context slice visible to a handler.
2. Flow, BluePrint, and Execution
TriggerFlowthe flow definition and the entrypoint for creating executionsTriggerFlowBluePrinta reusable in-process flow templateExecutionone isolated runtime instance with state, result, interrupts, and runtime resources
Engineering-wise:
- think of
TriggerFlowas definition - think of
Executionas request-scoped runtime
3. Signals are the real kernel
At runtime, TriggerFlow revolves around Signal. A signal includes:
idtrigger_eventtrigger_typevaluesourcemetalayer_marks
Public trigger_type values currently include:
eventruntime_dataflow_data
4. Chunk = handler + continuation signal
Each chunk has:
- a handler
- a name
- a continuation signal emitted after completion
If a chunk emits business events on its own, declare them explicitly:
python
chunk.declare_emits("ApprovalRequest")5. TriggerFlowRuntimeData is runtime context
The handler parameter should now be understood as a runtime context object.
It exposes:
- current trigger:
trigger_event,trigger_type,value - current signal snapshot:
signal,signal_id,signal_source,signal_meta,signal_info - current execution:
execution,execution_id - data namespaces:
state,flow_state - resource view:
resources
Compatibility note:
TriggerFlowRuntimeDatais the primary nameTriggerFlowEventDatais only a compatibility alias
6. Data and resource boundaries
data.stateexecution-scoped recoverable statedata.flow_stateflow-scoped shared statedata.resourcesruntime resources visible to the current execution
Public resource APIs:
get_resource()require_resource()set_resource()del_resource()
7. Pause and resume
pause_for():
- creates an interrupt
- moves execution into
waiting - writes an interrupt event into
runtime_stream
continue_with():
- updates interrupt state and response
- moves execution back to
running - injects the resume event again