> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/flow-logic/looping.md).

# Use loops in Duaer

Use looping in Duaer when you want to process multiple items or repeat an action. Most nodes iterate automatically; some cases need an explicit loop.
## Executing nodes once <a href="#executing-nodes-once" id="executing-nodes-once"></a>

Duaer nodes usually run once for each incoming item. Twenty items out of the previous node means this node runs twenty times, and $json is one item each time.

When you only want the first item (for example one Slack message), turn on Execute Once in the node Settings. When the canvas says this node ran multiple times, that notice links to this setting.

## Creating loops

Most nodes iterate for you. In some cases you create a loop by connecting a node’s output back to an earlier node and using IF to decide when to stop.

Use [Loop Over Items](/flow-logic/looping.md) (also named Split in Batches) until all items are processed. Set Batch Size to 1 to process each item individually. Batching helps with memory and API rate limits; add Wait between batches if you need to slow down.

Loop Over Items stops after every item has been batched, so you usually do not need an IF to end the loop. When the failure is memory, batching is usually the closer fix than Execute Once. Refer to [fix memory issues](/flow-logic/error-handling/memory-errors.md).
## Questions

### Does a node run once, or once per item in Duaer?

By default once per incoming item. Turn on Execute Once in Settings to run a single time no matter how many items arrived.

### How is Loop Over Items different from Execute Once in Duaer?

Execute Once collapses many items into one execution. Loop Over Items processes batches, finishing one batch before the next, to control memory and rate limits. They solve different problems.

