Relationships
#3255 rollbackOnFailure methods fail when run as a workflow step
Opened by stack72 · 10/11/2026· Shipped 10/13/2026
Summary
A model method that declares rollbackOnFailure: true fails whenever it runs as a workflow step, with:
rollbackVersions is not supported in composite repository(or saveDeferred / advanceLatestMarkers is not supported in composite repository).
Cause
Workflow steps write through a CompositeUnifiedDataRepository (persistent repo plus the run's ephemeral store), built in DefaultStepExecutor.buildDeps and the WorkflowExecutionService constructor in src/domain/workflows/execution_service.ts. Every workflow entry point (swamp workflow run, workflow resume, swamp serve) passes an ephemeral store, so the composite is always used. Its saveDeferred, finalizeVersionDeferred, advanceLatestMarkers and rollbackVersions all throw (src/domain/data/composite_data_repository.ts). InProcessExecutor uses those for rollbackOnFailure methods (deferred writes promoted on success, rolled back on failure). This has been the case since rollbackOnFailure was added in 760b15b7.
Direct swamp model method run works because it uses the plain filesystem repository.
Reproduction
Register or install a model whose method declares rollbackOnFailure: true and writes a resource, then run it from a workflow step. The step fails with the error above. Found while writing integration/workflow_auto_gc_test.ts for swamp-club#3251.
Expected
Deferred writes in a workflow step route to the repository that owns the data (persistent or ephemeral by lifetime), as save does, so rollbackOnFailure methods work in workflows.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.