Relationships
#3251 autoGc does not enforce version caps for scheduled workflow steps
Opened by phy2vir · 10/11/2026· Shipped 10/11/2026
Summary
With autoGc: true in .swamp.yaml, model resources written by a scheduled workflow step continue accumulating beyond their declared garbageCollection version caps. Explicit swamp data gc correctly restores the caps.
This affects long-running swamp serve deployments with frequent schedules. The fix likely needs the repository autoGc setting to be propagated into model-method execution initiated by the workflow scheduler, using the same automatic GC path as direct model-method execution.
Reproduction
- Use the filesystem datastore and set
autoGc: truein.swamp.yaml. - Define a model with resources using integer
garbageCollectioncaps. In the observed case, three resources had caps of 100, 30, and 100. - Create a scheduled workflow that invokes the model method once per minute and writes new versions of those resources.
- Run
swamp data gc --force --jsonto establish a clean capped baseline. - Allow 16 scheduled executions to complete successfully.
- Inspect each artifact with
swamp data versions <model> <artifact> --json.
Observed result
The three resources contained 116, 46, and 116 versions respectively: each was 16 versions above its configured cap. A subsequent swamp data gc --dry-run --json reported excess versions eligible for deletion.
Expected result
When autoGc: true, write-time or post-method automatic GC should keep scheduled workflow outputs within their declared version caps without requiring a separate manual GC command.
Environment
- Swamp tested:
20261011.153055.0-sha.8453c3cc - Latest source checked:
20261011.154850.0-sha.d650cb70 - Execution mode:
swamp serve, local filesystem datastore, cron-scheduled workflow - Platform: Linux with systemd
Additional evidence
Inspection of the latest source found autoGc read from the repository marker and passed into direct model-method execution. The workflow/serve execution path did not show corresponding propagation of that setting.
Workaround
A systemd timer periodically runs both swamp data gc --force --json and swamp run gc --force --json.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 10/11/2026, 5:27:15 PM
Thanks @phy2vir for reporting this! We shipped: Workflow steps ignore autoGc because WorkflowExecutionService and DefaultStepExecutor build their own data repositories without the write-time GC flag, and deferred (rollbackOnFailure) writes never prune at write time even when it is on. Carry the marker's autoGc from RepositoryContext through WorkflowExecutionService (including nested workflows) and StepExecutionContext into those repositories, wire it at the serve, workflow run and workflow resume composition roots, and enforce the cap when deferred versions are promoted, so workflow-written data respects integer garbageCollection caps as direct model method runs do.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
phy2vir commented 10/11/2026, 5:33:08 PM
Thank you!
Sign in to post a ripple.