In this lesson we’ll cover looping in Argo Workflows with a focus on the withItems field and how to control concurrency using parallelism. When authoring workflows you often need to iterate over a set of inputs so a template can run multiple times. Argo provides three basic loop primitives: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.
| Loop Type | Use Case | Example |
|---|---|---|
| withSequence | Repeat a template a fixed number of times (numeric range) | “Run this 5 times” |
| withItems | Repeat a template over a predefined static list of values | ”Send invitations to Alice, Bob, Charlie” |
| withParam | Repeat over a dynamic list produced by a previous step | ”Step 1 outputs approved attendees; step 2 iterates over them” |
- withSequence → “run this N times”
- withItems → “iterate over this fixed list”
- withParam → “iterate over a list produced by an earlier step”

{{inputs.parameters.\<name>}} inside the called template.
Corrected example:
- The
cosmic-cowstep creates one invocation per item in the withItems list. - Each invocation sets
arguments.parameters.messageto"{{item}}". - The
moo-wisdomtemplate declaresinputs.parameters.messageand references it as{{inputs.parameters.message}}.
inputs: misspelled as input: or parameter name mismatched).
Parallel execution behavior
By default, Argo schedules all items from withItems as parallel pod executions. In the corrected example above, Argo would create one pod per list item and run them concurrently. You can watch these concurrent child nodes in the Argo UI as the workflow runs.

parallelism field to limit the number of concurrently running templates. You can set parallelism globally on the controller (ConfigMap) or on a per-workflow basis.
Example: set workflow-level parallelism to 2 so only two item invocations run at once:
parallelism: 2, Argo will schedule only two cosmic-cow pods at a time; as those complete, it schedules the next ones from the list.

Be careful when looping over large lists: launching hundreds or thousands of
parallel pods can exhaust cluster resources. Use workflow-level
parallelism,
namespace-level quota controls, or controller-level limits (ConfigMap) to
avoid runaway concurrency.Tip: To pass item values reliably into a called template, always declare
inputs.parameters on the called template and pass the current item via
arguments.parameters: value: "{{ item }}".- Argo Workflows loops documentation: https://argoproj.github.io/argo-workflows/workflow-syntax/loops/
- Argo Workflows documentation: https://argoproj.github.io/argo-workflows/
- Argo Workflows GitHub: https://github.com/argoproj/argo-workflows