Workflow run endings: the first step that sets an outcome ends the run #2042
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#2042
Reference in new issue
Block a user
Child of #2037. Plan: workflow vocabulary on the durable engine, one requirement per child.
A step that sets an outcome ends the run;
workflow.finish(completed, declined, waiting for approval) is the first such type. Resume-at-step and the needs-a-person state stay with #2036.Done when: a workflow.finish under a when ends the run with its status and detail.
Built in
a88f5630f,fb5f3ad47and7b6154e7e(migration 00044).workflow.finishtakesstatus(completed, parked, waiting_approval or declined) anddetail, ported frominternal/domain/workflow/finish_step.go. An unknown status is rejected when the workflow is saved.detail, unless it hason_failure: continue. A run that completes every step ends completed, with the last step's summary as its detail. This follows "How a run ends" in WORKFLOWS.md.parked,waiting_approvalanddeclined, and adetailcolumn.POST /api/runs/{id}/retry(optionalfrom). Earlier steps replay from the journal without repeating their effects. Everything recorded from the retry step onwards is discarded, including the started markers. The run page shows Detail and a Retry button for parked runs.Verified: the
TestDocumentStepsRuntable gained cases for parking, continue, finish (including under a falsewhen), the last summary as detail, and retry keeping earlier results. With the finish step disabled, the finish cases failed.task checkpassed on the merged tree.Left for #2036 and #2037: resuming a
waiting_approvalrun, a step picker for retry (it retries from the step that parked the run), and parking rather than failing a run whose agent step stops part-way.