Skip to content

Trigger component chain

Triggers separate “when work starts” from a human clicking send. Three entry types share one dispatch path: render the prompt template, assert the breaker, create a session or team run, and record a trigger_run.

TypeEntry
userManual POST to run a specific trigger
eventBus events matched by filters
scheduleScheduler fires on cron
flowchart TD
U[user] --> D[TriggerDispatch]
E[event match] --> D
S[schedule] --> D
D --> B[Breaker.assert]
B --> T[Render prompt template]
T --> R{Target}
R -->|role| Sess[Create session and background prompt]
R -->|team| Team[TeamRunner.launch]
Sess --> TR[Write trigger_run]
Team --> TR
  • Run under the trigger’s tenant context
  • If the breaker has tripped, refuse to fire
  • Substitute template variables per convention; target is a role or a team (exactly one)
  • Single role: create the session, then deliver the prompt in the background (source: trigger); the API does not wait for the full turn, so gateways do not time out and stall the scheduler
  • Team: same path as a manual team run; audit session anchors on the lead’s root session
  • Event matching may use a short cooldown to reduce jittered duplicate fires

Connects to three abstractions, breaker, and teams.


Related reading: