07-01-2025 04:29 AM
Problem: Break the loop based on the if condition satisfied and continue to the next steps. is this can be achieved in workato.
Solved! Go to Solution.
07-01-2025 07:21 AM
Based on your question, it seems you need to iterate over a list of values, exit the loop when a condition is met, and then proceed with the remaining steps in the recipe. (Please correct me if I've misunderstood.)
Currently, Workato doesn’t support a direct “break” statement to exit a For each loop. However, you can simulate this behavior using conditional logic. Here's a workaround approach:
1. Initialize a flag variable (Boolean, default: false) outside the loop.
2. Loop through the list of items using the For each action.
3. Within the loop, apply your primary condition to determine whether to stop further execution of loop actions. Combine this with a check on the flag variable (e.g., flag == false) so that the logic only runs before the break condition is triggered.
4. When the condition is met, set the flag variable to true. This ensures subsequent iterations skip the logic.
Outcome: The loop still iterates through all elements, but after the condition is met, no further actions inside the loop are executed — effectively mimicking a break.
07-04-2025 07:30 AM
Thanks for the response, able to find the solution from above.
3 weeks ago - last edited 3 weeks ago
If you need to process only until a match is found and then skip further logic, you can filter the list to reduce size. Use a flag (variable) to skip logic after condition is met.