Relationships
#2502 workflow resume --input key=value does not coerce the value to the declared input type (workflow run does)
Opened by hammz · 9/24/2026· Shipped 9/25/2026
Problem
swamp workflow resume <wf> --run <id> --input key=value does not coerce the value to the workflow's declared input type, while swamp workflow run --input key=value does. With an array input, the resume passes the raw string '["a"]'. A forEach over that input then fails with forEach.in must evaluate to an array or object, got: string. The failure happens after the run was reset, so the job is left running with its reset iterations pending. A plain retry then refuses the run because steps are pending.
Reproduction
Installed swamp 20260924.181834.0-sha.55571cdb.
- Create a workflow
shrinkthat declares an inputenvs(type: array, itemsstring). It has one jobmainwith the forEach stepdeploy-${{ self.env }}over${{ inputs.envs }}, which runstest ${{ self.env }} != bthrough acommand/shellmodel. swamp workflow run shrink --input 'envs=["a","b"]'. deploy-b fails, and the run is failed. Here the array input is coerced correctly.swamp workflow resume shrink --run <id> --input 'envs=["a"]'fails withError: forEach.in must evaluate to an array or object, got: string.swamp workflow history get shrink --jsonshows jobmainrunning, withdeploy-aanddeploy-bpending.
Passing the override as JSON (--input '{"envs":["a"]}') works.
Cause
src/cli/commands/workflow_resume.ts parses --input, --input-file and --stdin with parseInputs and passes them through as they are. src/libswamp/workflows/run.ts applies coerceInputTypes(input.inputs, workflow.inputs) on the run path, but the resume path never does.
Fix approach
Coerce resume override inputs against the workflow's input schema, the same way the run path does, before resume() merges them. That applies to the local and --server paths. Found while verifying swamp-club#2433.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.