workflow.call, workflow.approve, workflow.handoff and message.send on the durable engine #2044
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2044
Reference in new issue
Block a user
Child of #2037. Plan: workflow vocabulary on the durable engine, one requirement per child.
workflow.callstarts a child run (keyed by the step path) and, withwait: true, waits on it by signal and publishes its outputs;workflow.approveandworkflow.handoffhand a run to the next workflow;message.senddelivers an authored message.Done when: each type's corpus documents run on fakes, and a call survives a restart while it waits.
Built in
5d8c9303eand4b5c60330(migration 00045:parent_run_id,parent_signal,call_depthon runs).workflow.callstarts a child run with the start keycall:<run>:<step>, so a replay or restart never starts a second child. Withwait: truethe parent waits through the engine's existing wait, holding no worker. The child'sFinishorCancelsignals the parent in the same transaction, so a crash can't strand a waiting parent. Ported from the old workflow_call.go: the settings, theinputs.<name>references, the depth limit of 5, the rule that outputs needwait, and a parked child failing its caller. A child that ends waiting for approval does not signal, so its caller keeps waiting.workflow.handoffstarts the target on the same input (keyhandoff:<run>:<step>) and ends the run succeeded.workflow.approverecords and delivers the plan, then ends the runwaiting_approval.message.sendsends an authored message through the deliveries module. Each records instead of acting in a dry run.Verified:
TestDocumentStepsRungained cases for call (with and without wait, restart, crash then restart, parked child, dry run), handoff, approve and message. With a random child key, the crash-then-restart case fails with "started 2 runs, want 1".task checkpassed on the merged tree. The call SQL itself (child start, parent signal, detach) has not been run against a database.Follow-ups filed: #2085 (
message.sendneeds a connector that declareschat_message) and #2086 (cancelling a parent leaves its child running). Still for #2037: workflow outputs and checking call result references at save, refusing call cycles at save, and resuming awaiting_approvalrun into itsthenworkflow.