The advanced, utilities workflow component, Repeat creates a loop in which the components following it are executed a number of times. At the start of each repetition, the workflow payload and variables are reset to the state they have at the point where the repeat component is placed, so you cannot keep track of the current number of repetitions with a variable.
The maximum number of allowed repetitions is 1000.
The repeat workflow component has these parameters:
- Number of repetitions
This is the number of repetitions, that will be executed. The number can be not only fixed, but can also be set via an XPath expression, where e.g. contents of an input file is used. You can also consider to count the number of nodes in the input XML file and use that with this XPath expression: count(/Root/Document). - Keep variable values and payload between repeats
If this option is disabled, then the initial set of variables and payload is reset to the initial values for all repeat iterations, but if you enable this option, then the workflow variables and the payload is kept for each iteration.
So if you want e.g. to do a repeat loop and keep track of the current number of repeats, then you will need to enable this option. If you want to keep the initial payload for each iteration, then you can consider first to save the initial payload before the repeat e.g. with the component, Payload to named property and then start each iteration in the repeat loop with the component, Named property to payload to reload the original payload.
Important: Please note, that a workflow variable is always defined as a string, so if you use such a variable as index in XPath, then you need to cast this as a number e.g. like so:/Root/Document[number($Index)]/@Company
Also, if you want to create a counter to keep track of the current number of repeats, then you need also to use the number function, when you increment the value e.g. like so:

Example
This will create 3 identical print outs:
Related Articles
Retry-repeat workflow component
The advanced utilities workflow component, Retry-repeat, can help if you have a workflow component that sometimes fails (for example, due to network connection issues). You can use this to retry a subtree of workflow components until no error occurs, ...
Choice and join workflow component
The basic, special Choice and join workflow component is very similar to the Choice component. For the majority of the documentation of the Choice and join you should refer to the choice component as choice and join does the same as the choice ...
Excel to XML component
The advanced, converter workflow component, Excel to XML converts an input excel file in the .xlsx format into the special XML format. The converter handles rows, columns and the most important styles. A related workflow component can create an ...
Advanced Utilities workflow components
The Advanced Utilities workflow components are as follows: Append to zip archive. Appends the payload to a zip file. The zip file will be created, if the referenced zip file does not exist. Attachment to payload. Takes a named attachment, removes it ...
Disable and enable of Workflow components
It is possible to disable/suspend individual workflow components of a workflow. When you disable a workflow element, then the processing of the disabled component is (as a general rule) skipped and the following components are processed. This image ...