24. Emit and receive the custom event
The name OnCustomEvent does not fire by itself when a variable changes. An emitter must send it. Add an Emit Event node after the lever's successful state change, or use the helper in a text script.
await EmitEvent("OnCustomEvent", {
"reason": "signal_powered",
"sourceId": "lever"
})For a visual listener, add On Event and select OnCustomEvent. Connect it to Read Context, with Context Key reason and Store in Variable last_reason. Then connect to End. This graph listens automatically; do not also call it from the lever unless you want an additional direct execution.
Figure 20. An On Event entry reads information from the custom event payload.
The checked dispatcher awaits the text-language subscription routes before its On Event visual graphs. Do not rely on the order of several unrelated listener records as a puzzle scheduler. Put dependent work in one list or graph.
Do not emit the same event unconditionally from its own listener. It can call itself again. Filter the reason, use a guard variable, or emit a different notification that cannot loop back into the same work.
