Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Loops · Workflow Automation

Direct answer

Loops in workflows repeat steps over a list of items, such as each server or each user, with options to run them in sequence or parallel and handle per-item failures.

When to use this

Use this when workflows repeat steps over items.

First 30 seconds

1. Loops repeat steps over lists or until conditions.

2. Limit iterations.

3. Handle per-item errors.

4. Parallelise when safe.

5. Avoid infinite loops.

Operational verification

list → loop → per-item steps

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
workflow orchestration semantics
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformworkflow orchestration semantics · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when workflows repeat steps over items.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as branch condition drift, hidden dependency, duplicate parallel mutation, approval bypass, retry storm, partial rollback and successful orchestration with failed consumer state, choosing the cases most relevant to iteration input set, ordering, per-item status, break/continue/failure behavior and safe handling of partial progress.

Step 2 Common mistakes Narrow the fault
  • One API call per item when the module accepts a list.
  • Loops without a stop condition.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Loops repeat steps per item.
  • Choose sequential or parallel.
  • Handle per-item failures.
Key checks
  • Loop over items with limits — iteration
  • Max iterations — safety
  • Per-item error handling — resilience
ReferenceWhy it matters1 section · depth on demand

What it is

Loops repeat a step for each item in a list: hosts, VLANs, users.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Loops repeat a step for each item in a list — every device, user, VM or file. They turn a single-item workflow into a bulk operation, which is efficient and also multiplies the impact of any mistake.

Design points:

QuestionOptions
Sequential or parallel iterations?Parallel with a concurrency limit
What if one item fails?Continue and report, or stop
How large can the list be?Pagination, batching
Progress trackingRecord per-item status for resume
# Ansible
- name: Create VLANs
  cisco.ios.ios_vlans:
    config: [{ vlan_id: "{{ item.id }}", name: "{{ item.name }}" }]
  loop: "{{ vlans }}"
  loop_control: { label: "{{ item.id }}" }

Always test a loop with a list of one before running it on hundreds of items.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docworkflow orchestration semantics current

Authoritative/upstream documentation reviewed for bounded claims in Workflow Automation > Loops. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For iteration input set, ordering, per-item status, break/continue/failure behavior and safe handling of partial progress, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?