Relationships
#5005 Nested workflow inputs do not reach the child's step expressions (passed values and defaults evaluate to empty)
Opened by svendowideit · 11/23/2026
Summary
Inputs passed to a nested workflow (task: { type: workflow, inputs: {...} }) do
not reach the child's step expressions. Inside the child, ${{ inputs.x }}
evaluates to the empty string for both passed values and the declared
defaults of the child's own input schema, so every step that depends on an
input receives "".
The same workflow body run directly (swamp workflow run <child> --input x=...)
works, which isolates the fault to the nested call.
Reproduction
Fleet: one orchestrator (swamp serve) and one enrolled worker (worker-a),
release 20261121.085447.0-sha.e52c839b.
A child workflow whose input is a zod enum, and a step that forwards it:
# child
name: child
inputs:
properties:
serviceScope:
type: string
enum: [auto, system, user]
default: auto
jobs:
- name: main
steps:
- name: plan
task:
type: model_method
modelType: '<type with an enum arg named serviceScope>'
modelName: x
methodName: plan
inputs:
serviceScope: ${{ inputs.serviceScope }} # evaluates to ""# parent
name: parent
jobs:
- name: main
target: worker-a
affinity: true
steps:
- name: run
task:
type: workflow
workflowIdOrName: child
inputs:
serviceScope: user # a literal, not a CEL expressionObserved:
- Parent run → child's step fails with
Method arguments validation failed: Invalid option: expected one of "auto"|"system"|"user" at "serviceScope". - The same literal in a top-level run of the identical body
(
swamp workflow run child --input serviceScope=user) succeeds —plan,sync,resolve,downloadandstageall complete. - The child also behaves as if unset: with
default: autoand no value, it takes theauto/system path (and then fails on elevation) rather than theuserpath the parent passed.
So both the passed literal and the schema default resolve to "" inside the
child, while the parent's call validates fine.
Why it matters
Every extension that factors privileged work out through
@svendowideit/sudo-run (or any other nested helper) currently gets helpers with
empty inputs: operation, args:json, allowedOperations and so on arrive as
"" and the helper fails, or worse, does something other than what the parent
asked for. A body that is correct when run directly is broken exactly when it is
composed — which is the main reason to have nested workflows at all.
Concretely, an install workflow that reaches stage successfully (release
downloaded and checksum-verified) dies on the next step, the nested sudo-run
placement, because that child received no operation:
done stage in 21.3s · Staged Ollama 0.40.17 at /tmp/ollama-stage-… (32 files)
elevate │ failed run in 473ms · 'sudo' exists but needs a password …
main │ failed place-binary in 598msExpected
- A literal (or CEL) value in the parent's
task.inputsis what the child sees in${{ inputs.x }}. - A child input with a
defaultfalls back to that default when the parent does not pass it. - Ideally, the nested call validates the values against the child's input schema before dispatch, so a bad handoff fails at the parent step (with the argument name) instead of deep inside the child.
Notes
- Placement is irrelevant here: it reproduces with
affinity: trueand with a single worker, and the child does run in the right place — only its inputs are lost. - Related: #5004 (an empty placement value queues rather than clearing). Same failure family — an empty string produced by an unset value is silently accepted instead of being treated as "not set".
Open
No activity in this phase yet.
Sign in to post a ripple.