Workflows · 2 min read
Repeat Workflow Actions with the Loop Action
The Loop action runs a group of actions once for each item in a list, or once for each number in a range. Use it when one trigger brings in several records, such as a webhook with three service requests, and you want an opportunity, a task, or a note for each one.
Add a loop
- In the workflow, click + and choose Loop.
- Under Loop over, choose A list of items or A range of numbers.
- For a list, click the tag icon in Items, open Previous steps, and pick the list, such as
serviceson an inbound webhook. For a range, enter a Start number and an End number. The helper text shows how many times the inner actions will run. A range from 1 to 10 runs 10 times. - Leave execution on Sequential so each pass finishes before the next starts. Turn on Parallel when several passes should run at the same time, which helps when the inner actions call outside systems.
- Click Save action. A dashed box appears on the canvas.
- Click + inside the dashed box and add the actions that should repeat. In any field, open Custom values > Loop item and insert a field from the current item, such as name or estimated value.
- Put anything that should happen only once, after every pass, below the dashed box.
On a number range there is no list item. Loop item then holds the current number, and item fields are empty.
Read a test
Click Test workflow, listen for the event, and start the test. Open the Loop step. Output shows how many items succeeded, failed, and how long it took. Iterations lists each pass. Open an action inside a pass to see that pass's input and output.
Example
An inbound webhook creates the contact, then a loop walks the services list. Inside the loop, create an opportunity, a task, and a note, each mapped from Loop item. A payload with three services creates three of each. The steps below the loop run once.