Skip to content

Workflows trigger each other in a bounded chain

  • Context: a workflow reacts to a verb through its verb_<verb> event. A path that runs a verb and records nothing hides it from the timeline and from the profile; a workflow reacting to another’s move (clarify, then set the kind, then start a turn) needs that move recorded, and an unbounded chain of workflows could loop.
  • Decision: a verb that changes a stored task records its event on the task’s unit in the transaction that changes it, or, when another service runs it (a message’s, the bridge to a unit’s action, reply), once that succeeded; a verb that changes nothing records nothing, and neither does one whose handler is seen. The event’s actor is <actor>:<source> (person:cockpit, workflow:triage), and its data carries the chain of workflows that led to it. A workflow’s event trigger fires only for the actors in trigger.actors, only on an event whose chain is shorter than trigger.depth (3 by default, at most 5), and never on an event whose chain it is in already.
  • Consequence: a new path that runs a verb goes through Service.Do or RecordVerb with its actor, and a workflow’s task.verb carries the chain of the event that planned it; a reaction to a verb served elsewhere is lost if the daemon stops between the verb and its record.
  • Enforced by: TestAVerbRecordsItsEvent, TestAHandledVerbRecordsItsEvent, TestRecordVerbRecordsAVerbAnotherServiceRan, TestAVerbThatChangesNothingRecordsNothing, TestARefusedOrSeenVerbRecordsNothing, TestWorkflowVerbsRecordEventsWithTheirActor, TestTaskVerbRecordsItsEventAndAnotherWorkflowReactsInChain, TestAWorkflowChainStopsAtItsDepth, TestAWorkflowNeverReentersItsChain, TestTriggerActorsLimitsATriggerToPeople, TestTaskAnswerRouteMatchesTheUnitAnswer, TestTheBridgeDelegatesActHeadlessWithTheTasksItems, TestReplySavesAUserDraftToTheOutbox.