Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLITeam
Assigneesstack72

Relationships

#932 Allow dynamic object expressions for workflow task inputs/globalArgs

Opened by evrardjp · 7/2/2026· Shipped 7/4/2026

Summary

Allow workflow model_method tasks to set globalArgs and inputs from object-valued CEL expressions, not only literal YAML records.

Motivation

In local-infra's capability planner, each planned item already contains the target model type/name/method plus the evaluated argument objects needed to invoke it. The dynamic dispatcher can select modelType, modelName, and methodName with expressions, but cannot pass the whole argument maps:

task:
  type: model_method
  modelType: ${{ self.item.implementation.modelType }}
  modelName: ${{ self.item.implementation.modelName }}
  methodName: ${{ self.item.implementation.methodName }}
  globalArgs: ${{ self.item.implementation.globalArgs }}
  inputs: ${{ self.item.implementation.inputs }}

This currently fails schema/loading with errors like:

task.inputs: Invalid input: expected record, received string
task.globalArgs: Invalid input: expected record, received string

Because of that, a capability catalog cannot dispatch model_method implementations directly. It has to create many tiny adapter workflows whose only purpose is to turn implementationInputs into model method calls.

Desired behavior

Support object-valued expressions for task.inputs and task.globalArgs, evaluated to records at workflow evaluation/runtime. For example:

task:
  type: model_method
  modelType: ${{ self.item.implementation.modelType }}
  modelName: ${{ self.item.implementation.modelName }}
  methodName: ${{ self.item.implementation.methodName }}
  globalArgs: ${{ self.item.implementation.globalArgs }}
  inputs: ${{ self.item.implementation.inputs }}

The evaluator should reject the result if it is not an object/record after expression evaluation.

Use case

Capability planning can emit generic plan items such as:

{
  "host": "vaultwarden",
  "capability": "vaultwarden-container",
  "implementation": {
    "type": "model_method",
    "modelType": "@adam/cfgmgmt/docker_container",
    "modelName": "lab-vaultwarden-vaultwarden-container",
    "methodName": "apply",
    "globalArgs": { "name": "vaultwarden", "image": "vaultwarden/server:latest" },
    "inputs": {}
  }
}

Then one generic dispatcher workflow can apply the plan without N service-specific adapter workflows.

Benefits

  • Removes boilerplate adapter workflows.
  • Makes capability planners and other dynamic orchestrators simpler.
  • Keeps workflow DAGs declarative while allowing typed validation after expression evaluation.
  • Complements the existing support for dynamic model type/name/method strings.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

7/4/2026, 10:24:46 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/4/2026, 8:43:31 PM
Editable. Press Enter to edit.

stack72 commented 7/4/2026, 10:24:55 PM

Thanks @evrardjp for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.