> ## 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.

# Parameters

> Explains using parameters in Argo Workflows to pass values into templates, perform parameter substitution in container args, and override values at submission via CLI or parameter files.

Let's talk about input parameters in [Argo Workflows](https://argoproj.github.io/argo-workflows/).

This lesson shows a workflow spec that accepts a parameter named `message` and passes it into a container command by referencing the template input parameter.

Example workflow:

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

What this workflow defines:

* A top-level default parameter under `spec.arguments` named `message` with the value `"workflow arguments value"`.
* A template called `cowsay` that declares an input parameter `message`.
* The container runs the `cowsay` command and passes the parameter into `args` using Argo parameter substitution: `{{inputs.parameters.message}}`.

<Callout icon="lightbulb" color="#1CB2FE">
  When referencing parameters inside YAML template fields, use the substitution syntax exactly as shown: <code>{`{{inputs.parameters.<name>}}`}</code>. Put the substitution inside quotes (for example, args: <code>{`["{{inputs.parameters.message}}"]`}</code>) so the YAML parser treats it as a string and the braces are handled correctly.
</Callout>

How parameter wiring works (quick reference):

| Field                             | Purpose                                                                   | Example                                             |
| --------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------- |
| spec.arguments                    | Workflow-level default parameter values; can be overridden at submit time | `- name: message value: "workflow arguments value"` |
| templates\[].inputs.parameters    | Declare parameters a template expects                                     | `- name: message`                                   |
| template container args / command | Use parameter substitution to pass values into the container              | `args: ["{{inputs.parameters.message}}"]`           |

Overriding the default parameter values at runtime can be done with the [Argo CLI](https://argoproj.github.io/argo-workflows/).

* Submit the workflow and override a single parameter from the CLI:

```bash theme={null}
# Submit workflow with a single parameter from the CLI
argo submit wf.yaml -p message="message from the CLI"
```

* Submit the workflow using a parameter file (YAML or JSON). Example `params.yaml` content:

```yaml theme={null}
message: "This is from a parameter file"
```

Submit with:

```bash theme={null}
# Submit workflow with multiple parameters from a file
argo submit wf.yaml --parameter-file params.yaml
```

* Invoke a different template (entrypoint) in the same workflow without editing the workflow YAML by using `--entrypoint`:

```bash theme={null}
# Submit workflow using a different entrypoint/template
argo submit wf.yaml --entrypoint cowsay-loudly
```

* Combine entrypoint override and custom parameters:

```bash theme={null}
# Combine entrypoint override and custom parameter
argo submit wf.yaml \
  --entrypoint cowsay-loudly \
  -p message="Custom message"
```

By combining `--entrypoint` with `-p` (or `--parameter-file`), you can call any template in your workflow and supply or override any parameter values at submission time.

<Callout icon="warning" color="#FF6B6B">
  Always quote substitutions and parameter values when they include spaces or
  characters that YAML/CLI might interpret (for example, `-p message="Hello,
      world!"`). Unquoted braces or special characters may cause parsing errors.
</Callout>

Links and references

* [Argo Workflows — Parameters](https://argoproj.github.io/argo-workflows/workflow-parameters/)
* [Argo CLI documentation](https://argoproj.github.io/argo-workflows/cli-overview/)
* [Kubernetes Documentation](https://kubernetes.io/docs/)

<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/4540622d-951e-489f-a69f-503d1e226dbb" />
</CardGroup>
