Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

Relationships

Blocked

#693 Cron scheduler should re-evaluate workflow definition when source file changes

Opened by bixu · 6/19/2026· Shipped 6/24/2026

The cron scheduler reads from .swamp/workflows-evaluated/ but does not detect when the source workflow YAML changes. If a workflow is updated on disk (e.g. modelIdOrName replaced with modelType/modelName, inputs added), the cron keeps running the stale cached copy until swamp workflow evaluate is run manually.

Expected: the scheduler re-evaluates the workflow definition when it detects the source file has changed (mtime or content hash), or at least on each cron tick since the cost is low.

Observed: source workflow changed from modelIdOrName to modelType/modelName pattern. Cron ran the old cached definition for 60+ minutes, failing every run with Unknown model type, until swamp workflow evaluate was run manually.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 7 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

6/24/2026, 6:35:20 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/19/2026, 5:46:51 PM
stack72 marked as blocked6/19/2026, 11:04:11 PM
Editable. Press Enter to edit.

stack72 commented 6/19/2026, 7:19:15 PM

Triaging this issue — attempted to reproduce the staleness behavior but couldn't trigger it across several scenarios (built-in types, local extension types, switching from modelIdOrName to modelType/modelName). In every case, the cron re-read the workflow from disk on the next tick and used the updated definition.

Could you share a few more details about the setup where you observed the 60-minute staleness?

  • Which model type was the workflow referencing? (e.g., @namespace/type, a local extension, a pulled extension?)
  • Was swamp workflow evaluate run before starting serve? The issue mentions .swamp/workflows-evaluated/ — wondering if the evaluated cache played a role.
  • Were there CEL expressions in the workflow that needed evaluation, or were all fields literal values?
  • Was the workflow in workflows/ (primary repo directory) or in extensions/workflows/?

One thing I did find during reproduction: the serve log reports schedule_completed even when the underlying workflow run actually failed (status: failed in the run YAML). If the runs were silently failing with "Unknown model type" but the log said "completed", that could look like the old definition was still running. Could that match what you observed?

bixu commented 6/22/2026, 2:41:26 PM

If the runs were silently failing with "Unknown model type" but the log said "completed", that could look like the old definition was still running. Could that match what you observed? << could be, but unfortunately the tick-based (cron style) invocation was just too weird for my use case and I switched to TailScale Funnel and webhooks, so I don't have any good way to fill in more detail. TBH I don't have any strong use-cases right now for cron-style workflows (would be more likely to orchestrate that with GH Actions as a wrapper.

stack72 commented 6/24/2026, 6:33:07 PM

We weren't able to reproduce the original staleness behavior across several scenarios (built-in types, local extension types, switching from modelIdOrName to modelType/modelName). In every case, the cron re-read the workflow from disk on the next tick and used the updated definition.

However, during investigation we found a real bug: swamp serve logs schedule_completed even when the underlying workflow run actually fails. The root cause is that when workflowRun() yields an error event (e.g. "Unknown model type") without a completed event, the scheduled execution service incorrectly falls through to the success path.

We've repurposed this issue to fix that bug — PR https://github.com/swamp-club/swamp/pull/1673 inverts the completion check to require explicit succeeded status, so all other outcomes (explicit failure, error events, missing terminal events) now correctly emit schedule_failed with the actual error message.

stack72 commented 6/24/2026, 6:35:30 PM

Thanks @bixu for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.