workflow run does not evaluate expressions or pass task.inputs without --last-evaluated
Opened by swampadmin · 1/8/2025
Description
swamp workflow run does not resolve ${{ inputs.* }} expressions at runtime. Expressions in modelIdOrName and task.inputs are passed as literal strings (e.g. the model runner receives the string ${{ inputs.deviceModel }} instead of the resolved model name).
Additionally, when using the evaluate → run --last-evaluated workaround, task.inputs that were resolved and baked into the evaluated YAML are silently dropped — model methods receive undefined for all input fields.
Steps to Reproduce
Bug A: workflow run doesn't evaluate expressions
- Create a workflow with parameterized model name:
inputs: properties: deviceModel: type: string required: [deviceModel] jobs: - name: main steps: - name: list task: type: model_method modelIdOrName: ${{ inputs.deviceModel }} methodName: list
- Run:
swamp workflow run <name> --input '{"deviceModel":"my-devices"}' --json - Step fails with:
Model not found: ${{ inputs.deviceModel }}
Bug B: --last-evaluated drops task.inputs
- Create a workflow with parameterized task inputs:
inputs: properties: deviceModel: type: string deviceId: type: string required: [deviceModel, deviceId] jobs: - name: main steps: - name: authorize task: type: model_method modelIdOrName: ${{ inputs.deviceModel }} methodName: authorize inputs: deviceId: ${{ inputs.deviceId }} authorized: false
- Evaluate:
swamp workflow evaluate <name> --input '{"deviceModel":"my-devices","deviceId":"test-123"}' --json- Evaluated YAML correctly shows
modelIdOrName: my-devicesanddeviceId: test-123
- Evaluated YAML correctly shows
- Run:
swamp workflow run <name> --last-evaluated --json - Model IS found (Bug A workaround works), but method fails with:
Method arguments validation failed: Invalid input: expected string, received undefined at "deviceId" - Even passing
--inputalongside--last-evaluateddoesn't help
Proof that it's not an auth/config issue
swamp workflow runsucceeds for workflows where methods take NO inputs (e.g.settings.get,dns.getNameservers)swamp model method run my-devices list --jsonworks perfectly via direct method callsswamp workflow evaluateresolves all expressions correctly
Expected Behavior
workflow runshould evaluate${{ inputs.* }}expressions at runtime (likeworkflow evaluatedoes), ORworkflow run --last-evaluatedshould pass the resolvedtask.inputsfrom the evaluated YAML to model methods
Actual Behavior
- Without
--last-evaluated: expressions are passed as literal strings - With
--last-evaluated: model is found but task.inputs are silently dropped
Environment
- swamp version: 20260227.225234.0-sha.2b2b28be
- OS: macOS Darwin 22.6.0
Summary
This affects the workflow execution service's expression resolution and input forwarding. The workflow evaluate command correctly resolves all expressions, but workflow run does not perform this resolution at runtime. When using the --last-evaluated path, the runner reads the evaluated workflow YAML for modelIdOrName but ignores the task.inputs section, so model methods receive undefined arguments. The fix would involve either: (a) adding expression evaluation to the workflow run path, or (b) ensuring --last-evaluated reads and forwards task.inputs from the evaluated YAML to model method calls.
Closed
No activity in this phase yet.
Sign in to post a ripple.