{
  "name": "conditional-when",
  "title": "Conditional (when) gate",
  "category": "Approval",
  "tags": [
    "approval",
    "busybox"
  ],
  "version": "1.0.0",
  "date": "2026-07-16",
  "notes": "Initial release.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/conditional-when/1.0.0.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/conditional-when/1.0.0/template.yaml",
  "entrypoint": "guard",
  "parameters": [
    {
      "name": "condition",
      "title": "Condition",
      "description": "Truthy gate. The guarded step runs only when this equals \"true\".",
      "type": "string",
      "required": true,
      "example": "true"
    },
    {
      "name": "value",
      "title": "Value",
      "description": "Value echoed by the guarded step when it runs.",
      "type": "string",
      "required": false,
      "default": ""
    }
  ],
  "images": [
    {
      "ref": "busybox@sha256:a46257e06c82ad85242d0d38077d0a52d9896389ca60a1a59d3463db586e5fa4",
      "repository": "busybox",
      "tag": "1.38.0",
      "digest": "sha256:a46257e06c82ad85242d0d38077d0a52d9896389ca60a1a59d3463db586e5fa4"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/conditional-when/1.0.0/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/conditional-when/1.0.0/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: conditional-when\n  labels:\n    dagweave.io/catalog-item: conditional-when\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.0\"\n    dagweave.io/catalog-category: \"Approval\"\nspec:\n  entrypoint: guard\n  templates:\n    # A reusable guard: the inner step runs (and emits `value`) only when `condition`\n    # is truthy. When the condition is false the step is skipped, demonstrating a\n    # reusable `when`-guarded building block other workflows compose.\n    - name: guard\n      inputs:\n        parameters:\n          # Truthy gate. The step runs only when this equals the string \"true\".\n          - name: condition\n          # Value echoed by the guarded step when it runs.\n          - name: value\n            default: \"\"\n      steps:\n        - - name: run\n            template: emit\n            # Argo substitutes the parameter, then evaluates the expression. With\n            # condition=\"true\" this is `true == true` (runs); anything else skips.\n            when: \"{{inputs.parameters.condition}} == true\"\n            arguments:\n              parameters:\n                - name: value\n                  value: \"{{inputs.parameters.value}}\"\n\n    # The guarded action: echo the value. A minimal no-op stand-in for whatever real\n    # work a composing workflow guards behind the condition.\n    - name: emit\n      inputs:\n        parameters:\n          - name: value\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # busybox:1.38.0\n        image: busybox@sha256:a46257e06c82ad85242d0d38077d0a52d9896389ca60a1a59d3463db586e5fa4\n        command: [sh, -c]\n        # Value is passed as an env var (below), never interpolated into the shell,\n        # so a value containing quotes or shell metacharacters is safe.\n        args:\n          - |\n            set -eu\n            printf '%s\\n' \"$VALUE\"\n        env:\n          - name: VALUE\n            value: \"{{inputs.parameters.value}}\"\n",
  "templateSha256": "93aa70a4320f122479f44eafa2188ab3c5e3296210f16f7f2c06997eb1ef9fd8",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/conditional-when",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
