> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Parameters

> Explains how to declare, pass, and override workflow level parameters in Argo Workflows with examples for template inputs and CLI or web UI submission

In this lesson you'll learn how to define and use workflow-level (global) parameters in Argo Workflows. Parameters declared under `spec.arguments.parameters` are available to the entire workflow and can be consumed by one or more templates. This pattern enables reusing a single workflow manifest while supplying different inputs at submit time.

Example: a minimal workflow that declares a global `message` parameter and passes it into a template to be used as the container argument:

```yaml theme={null}
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: cowsay-
spec:
  entrypoint: cowsay
  arguments:
    parameters:
    - name: message
      value: "a message from the workflow arguments section"
  templates:
  - name: cowsay
    inputs:
      parameters:
      - name: message
    container:
      image: rancher/cowsay
      command: [cowsay]
      args: ["{{inputs.parameters.message}}"]
```

Key points

* Declare workflow-global parameters under `spec.arguments.parameters`.
* Inside a template, declare the same parameter name under `inputs.parameters` and reference it with `{{inputs.parameters.<name>}}`.
* Some fields also support direct workflow-level references using `{{workflow.parameters.<name>}}`.

<Callout icon="lightbulb" color="#1CB2FE">
  A common way to reference a workflow parameter inside a template is to declare the parameter under the template's `inputs.parameters` and then use the expression `{{inputs.parameters.<name>}}` in container args or other fields that accept template expressions. You can also reference workflow-level parameters directly using `{{workflow.parameters.<name>}}` in fields that accept template expressions.
</Callout>

Submit the workflow and watch the run (example using a public manifest URL):

```bash theme={null}
argo -n argo submit https://gist.githubusercontent.com/sidd-harth/d8e60353a95606b13f9c41f6fb59bf34/raw/66ae1738a05943a9ef7a220f3d49425d59993c90/workflow-2.yml --watch
```

Sample CLI output while the workflow is running:

```console theme={null}
Name:                 cowsay-tptgl
Namespace:            argo
ServiceAccount:       unset (will run with the default ServiceAccount)
Status:               Running
Created:              Fri Oct 24 06:35:15 +0000 (4 seconds ago)
Started:              Fri Oct 24 06:35:15 +0000 (4 seconds ago)
Duration:             4 seconds
Progress:             0/1
Parameters:
  message:            a message from the workflow arguments section

STEP           TEMPLATE   PODNAME         DURATION  MESSAGE
⟳ cowsay-tptgl  cowsay     cowsay-tptgl   4s
```

You can also inspect and interact with the run in the Argo Workflows web UI. The workflow graph shows the single `cowsay` node for this run:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/v7HW2PPNQOGxY8Ve/images/Prep-Course-Certified-Argo-Project-Associate-CAPA/Argo-Workflow/Demo-Parameters/argo-workflows-cowsay-tptgl-graph.jpg?fit=max&auto=format&n=v7HW2PPNQOGxY8Ve&q=85&s=39867250f863737f7d1c2acdc305c419" alt="A browser screenshot of the Argo Workflows web interface showing a workflow graph with a single node labeled &#x22;cowsay-tptgl.&#x22; Top action buttons (RESUBMIT, SUSPEND, STOP, TERMINATE, DELETE, LOGS, SHARE, WORKFLOW LINK) and a left-hand icon toolbar are visible." width="1920" height="1080" data-path="images/Prep-Course-Certified-Argo-Project-Associate-CAPA/Argo-Workflow/Demo-Parameters/argo-workflows-cowsay-tptgl-graph.jpg" />
</Frame>

When the run finishes successfully, the workflow parameters are shown in the completed status and the container logs include the parameter value:

```console theme={null}
Name:                   cowsay-tptgl
Namespace:              argo
ServiceAccount:         unset (will run with the default ServiceAccount)
Status:                 Succeeded
Conditions:
  PodRunning            False
  Completed             True
Created:                Fri Oct 24 06:35:15 +0000 (38 seconds ago)
Started:                Fri Oct 24 06:35:15 +0000 (38 seconds ago)
Finished:               Fri Oct 24 06:35:52 +0000 (1 second ago)
Duration:               37 seconds
Progress:               1/1
Parameters:
  message:              a message from the workflow arguments section

STEP             TEMPLATE   PODNAME         DURATION   MESSAGE
✔ cowsay-tptgl     cowsay     cowsay-tptgl    26s
```

Logs from the `cowsay` container:

```console theme={null}
/ a message from the workflow arguments \
\ section                                 /
------------------------------------------
       ^   ^
      (oo)\_______
      (__) \       )\/\
           ||----w |
           ||     ||
```

Overriding the global parameter at submit time

* UI: Click Resubmit in the web UI and edit parameter values before resubmitting.
* CLI: Pass parameters inline with `-p` (or `--parameter`).

Example — override `message` via CLI:

```bash theme={null}
argo -n argo submit arguments-parameters.yaml -p message="with great power comes great responsibility" --watch
```

Submitting with an overridden parameter produces a run using the new message. Example running status after overriding via CLI:

```console theme={null}
Name:                   cowsay-ljb54
Namespace:              argo
ServiceAccount:         unset (will run with the default ServiceAccount)
Status:                 Running
Created:                Fri Oct 24 06:37:10 +0000 (3 seconds ago)
Started:                Fri Oct 24 06:37:10 +0000 (3 seconds ago)
Duration:               3 seconds
Progress:               0/1
Parameters:
  message:              with great power comes great responsibility

STEP            TEMPLATE   PODNAME         DURATION  MESSAGE
◉ cowsay-ljb54  cowsay     cowsay-ljb54    3s
```

Logs showing the overridden text:

```console theme={null}
cowsay-ljb54: time="2025-10-24T06:37:33 UTC" level=info msg="capturing logs" argo=true
cowsay-ljb54:
cowsay-ljb54:  / with great power comes great \
cowsay-ljb54:  \ responsibility               /
cowsay-ljb54:   ------------------------------
cowsay-ljb54:
cowsay-ljb54:        \   ^__^
cowsay-ljb54:         \  (oo)\_______
cowsay-ljb54:            (__)\       )\/\
cowsay-ljb54:                ||----w |
cowsay-ljb54:                ||     ||
cowsay-ljb54:
cowsay-ljb54: time="2025-10-24T06:37:34 UTC" level=info msg="sub-process exited" argo=true error="<nil>"
```

Parameter passing options at a glance

| Method                      | CLI example                                          | Notes                                                                                         |
| --------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Inline single parameter     | `-p message="goodbye world"`                         | Quick override for one or few values                                                          |
| Parameters file (YAML/JSON) | `--parameter-file params.yaml`                       | `params.yaml` can be a YAML or JSON map of key/value pairs                                    |
| Change entrypoint at submit | `--entrypoint print-message-caps -p message="HELLO"` | Useful when a manifest contains multiple templates and you want to run a different entrypoint |
| Web UI resubmit             | N/A                                                  | Edit parameters interactively and resubmit the workflow                                       |

Example parameter file (params.yaml):

```yaml theme={null}
message: goodbye world
```

CLI using parameter file:

```bash theme={null}
argo submit arguments-parameters.yaml --parameter-file params.yaml
```

Tips and references

* Reuse the same manifest by changing inputs and entrypoints at submit time—no need to edit the YAML file.
* For nested workflows or complex templates, prefer declaring template `inputs.parameters` and passing values via `spec.arguments.parameters` to keep intent explicit.
* See the official Argo Workflows documentation for more parameter patterns and expression usage: [Argo Workflows — Parameters and Artifacts](https://argoproj.github.io/argo-workflows/workflow-parameters/).

Further reading

* [Argo Workflows Documentation](https://argoproj.github.io/argo-workflows/)
* [Kubernetes Basics](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/certified-argo-project-associate-capa/module/44223b5d-ccc3-4dcb-8292-66036e2ea023/lesson/afa0672d-7cf5-4470-9f12-18e1394157a6" />
</CardGroup>
