Skip to main content

Loop Action

Use the Loop Action in Yeeflow workflow automation to iterate through list items, repeat actions multiple times, and apply Loop Break for efficient process control.

Updated yesterday

What is the Loop Action?

The Loop Action in Workflow Designer allows you to execute a set of actions repeatedly within a single workflow run. Instead of handling one item at a time, you can loop through lists, variables, or repeat actions for a defined number of times. This makes it possible to automate batch processing, iterative approvals, or repeated notifications.

When to use the Loop Action?

Loop Actions are useful whenever you need to handle multiple items or repeat the same task systematically. Common use cases include:

  • Batch processing records: Iterate through query results and apply actions to each record (e.g., update multiple records at once).

  • Bulk notifications: Send emails or alerts to multiple recipients in one workflow run.

  • Approval handling: Trigger approval actions for each record in a pending list.

  • Reminders or retries: Repeat a notification or check action a fixed number of times until conditions are met.

By using a Loop, you can avoid building repetitive steps manually and ensure your workflow remains concise and maintainable.

Configure the Loop Action

When configuring a Loop Action, you can define:

  • Action name: A custom label for the loop step.

  • Description: Optional notes to describe its purpose.

  • Loop type: Choose how the loop should iterate:

    1. Loop through list items – iterate through each item in a list variable.

      • Example: Process each record returned by a Query Data action.

    2. Loop through multiple values – iterate through a set of variables or values.

      • Example: Send a message to several specified users.

    3. Loop for fixed times – repeat actions a defined number of times.

      • Example: Send up to 3 reminder emails until a task is completed.

  • Conditions:

    • Run only when: Skip an iteration unless the condition is met.

    • Break when: Exit the loop early when a condition is satisfied.

Inside a Loop, you can access Current Loop context variables, which provide useful information to control workflow behavior:

  • Current iteration – the index of the current run (starts from 1).

  • Planned total – the total number of iterations expected.

  • Actual executed – the number of iterations already completed.

  • Current object – the data object of the current loop item (only valid when using Loop through list items or Loop through multiple values).

These values can be referenced in expressions or conditions inside the Loop body, or passed to subsequent actions such as Set Variable or Send Email.

See also: Workflow Variables for details on how to reference loop context.

Using Loop Break inside a Loop

Besides defining a Break when condition, you can insert a Loop Break action directly within the loop body.

  • The Loop Break action will immediately stop the loop, even if there are remaining iterations.

  • This is useful when you only need to process until a certain condition is met, and further iterations are unnecessary.

Example use case:
You query a list of tasks and loop through them. Once the first task marked “High Priority” is found, you can insert a Loop Break action to stop the loop, avoiding unnecessary iterations over the remaining tasks.

Best Practices

  • Use conditions wisely: Apply filters to avoid unnecessary iterations and reduce execution time.

  • Plan for exit: Always configure a Break when condition or use the Loop Break Action to prevent infinite loops.

  • Handle errors gracefully: Reference loop context (such as has Error or error Message) to catch issues during execution.

  • Keep performance in mind: For large datasets, consider whether processing in batches or applying pre-filters is more efficient.

Did this answer your question?