FAQ
Flows
Looping in workflows

Looping in workflows

Looping is a powerful feature that allows you to repeatedly run a specific action or set of actions for each item in a list. This ensures that each item is handled individually and consistently, which is especially useful when dealing with multiple data points or records.

Example:

Imagine you have a list of customer orders. Each order needs to go through the following steps:

  1. Send a confirmation email.

  2. Update the order status.

  3. Notify the customer.

Looping ensures that each order is processed individually and in the correct sequence.

How to add loop in workflow

To implement looping in a workflow, you can utilize Webhook Advanced Configuration. This allows you to iterate over a list of items and run actions for each item individually.

Screenshot 2025-06-17 at 4.33.01 PM.png

Steps to Implement Looping in a Workflow:

  1. Hit Flow Individually:

    • If your payload contains a list, and you want to run the flow for each item individually, enable the Run flow one by one option. This ensures that the flow processes each item separately.

    Note: This option is limited to a maximum of 1000 items in the list.

  2. Set Up Delay:

    • You can introduce a delay between each execution of the flow. This is useful if you need to space out the actions and avoid overloading your system.

    • Use the delay parameter in the query string to set the time between each flow execution in minutes.

    Example:
    https://flow.sokt.io/func/scriRofnax1Z?delay=2
    This setup will introduce a 2-minute delay between each flow execution. Adjust the delay time according to your needs.

    Important: After setting the delay, the flow will wait for the specified time before processing the next item.

  3. Flow Control Condition:

    • You can set a condition that determines whether the flow should run, based on certain criteria. This condition can be a logical expression, such as checking if a field or parameter in the payload meets a specific value (e.g., if a field is non-empty).

    Example:

    • Enable a condition like "only run the flow if a field contains a valid value." This ensures the flow only runs when the conditions are met.

Examples of Looping in Workflow Automation

1. Sending Notifications to Multiple Users

  • Data: A list of users who need to be notified (e.g., new leads, updates, etc.).

  • Loop: The workflow loops through each user.

  • Action: For each user, it sends a personalized notification via email, SMS, or push notification.

2. Updating Records in a Database

  • Data: A list of database records that need to be updated.

  • Loop: The workflow iterates over each record.

  • Action: It performs actions like updating a field, adding a note, or tagging the record based on certain conditions.

Prev