Workflow step task.inputs not forwarded as method arguments at runtime
Opened by swampadmin · 12/13/2024
Description
When a workflow step defines task.inputs to pass arguments to a model_method, the inputs are correctly resolved during swamp workflow evaluate but are not forwarded as method arguments during swamp workflow run. The method receives undefined for all input fields, causing argument validation to fail.
Steps to Reproduce
- Create a workflow with a step that passes inputs to a method:
steps:
- name: get-service
task:
type: model_method
modelIdOrName: ${{ inputs.serviceModel }}
methodName: get
inputs:
serviceName: ${{ inputs.serviceName }}- Evaluate the workflow — expressions resolve correctly:
swamp workflow evaluate service-diagnose --json --input '{"serviceModel":"my-svc","serviceName":"backend-svc"}'Output shows task.inputs.serviceName: "backend-svc" as expected.
- Run the workflow:
swamp workflow run service-diagnose --last-evaluated --jsonStep fails with:
Method arguments validation failed: Invalid input: expected string, received undefined at "serviceName"Expected Behavior
task.inputs values should be forwarded as method arguments when executing the step, matching what evaluate produces.
Actual Behavior
The method is invoked with no arguments — task.inputs is ignored at runtime. Steps that call argument-free methods (e.g., list, getWarnings) work fine in the same workflow.
Environment
- swamp version: 20260226.174314.0-sha.0a12c9ff
- OS: macOS (Darwin 22.6.0)
Summary
This bug affects the workflow execution service when dispatching model_method steps that define task.inputs. The fix would involve ensuring the step runner reads task.inputs from the evaluated step definition and passes them as method arguments when invoking the model method. The schema already declares inputs as a valid field on model_method tasks, and evaluation resolves expressions within it correctly — only the runtime dispatch is missing the forwarding.
Closed
No activity in this phase yet.
Sign in to post a ripple.