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

Relationships

#1740 serve: triggerSource not persisted to workflow run summary

Opened by stack72 · 8/19/2026· Shipped 8/20/2026

Problem

triggerSource is passed through the workflow run execution path ("schedule", "webhook", "api", "manual") but is never persisted to the workflow run summary YAML on disk. As a result, workflow.run.search and workflow.history.search always return triggerSource: undefined, and every run appears as "manual" in the dashboard.

Observed Behavior

The triggerSource value is correctly threaded through:

  • src/cli/commands/serve.ts:2599 — passes triggerSource: "schedule" for cron runs
  • src/serve/webhook.ts:711 — passes triggerSource: "webhook" for webhook runs
  • src/serve/handlers/workflow_handlers.ts:203 — passes triggerSource: "api" for WS-initiated runs
  • src/cli/commands/workflow_run.ts:506 — passes triggerSource: "manual" for CLI runs
  • src/serve/deps.ts:400 — forwards triggerSource to the run input
  • src/libswamp/workflows/run.ts:671 — includes it in resolvedInput

But the run summary persisted at workflow-runs/{workflowId}/workflow-run-{runId}.yaml does not include the triggerSource field. The search index builder in run_search.ts:157 reads run.triggerSource which is always undefined on deserialized runs.

Expected Behavior

triggerSource should be written to the run summary YAML when the run starts or completes, so that workflow.run.search returns the correct trigger type. The field was added to WorkflowRunSearchItem in #1710 but the persistence was missed.

Files to Change

  • src/domain/workflows/workflow_run.ts or src/domain/workflows/workflow_run_summary.ts — add triggerSource to the persisted schema
  • src/libswamp/workflows/run.ts — write triggerSource to the run record when it's created/updated
  • The run summary serialization/deserialization paths

Impact

The dashboard's Executions table shows every run as "manual" regardless of how it was triggered. This affects both the trigger badge display and any future filtering by trigger source.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/20/2026, 7:24:17 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/19/2026, 11:30:55 PM
Editable. Press Enter to edit.

stack72 commented 8/19/2026, 11:49:25 PM

Root cause identified: triggerSource IS persisted to the run YAML correctly (at the top level, confirmed in the file). The issue is that findAllSummariesFromIndex in yaml_workflow_run_repository.ts uses a cached index that was built before triggerSource existed. New runs added to the index include the field, but old index entries don't. The fix is either to invalidate/rebuild the index when the schema changes, or to fall back to re-reading the YAML for entries that lack the new fields.

Sign in to post a ripple.