|
/ Documentation /Core Features/ Automate Repetition with Precision: OttoKit Loop Integration

Automate Repetition with Precision: OttoKit Loop Integration

Not every automation is one-and-done. Sometimes, you need to do the same thing many times, like sending individual emails to a list, updating a database row-by-row, or processing cart items one at a time. That’s where the Loop action in OttoKit shines. It allows you to repeat steps based on dynamic data. No manual duplication needed.
Whether you’re working with line items from a form or a comma-separated list from a CRM export, OttoKit’s Loop action brings flexibility and control to your workflow.

Getting Started with Loop

Follow these steps to set up your Loop action:

  • Select Loop as an Action
    Choose Loop from the list of actions when building your OttoKit workflow.
  • Choose the Loop Event
    Select the Loop event. In this field, you have two options.
    Start Loop – Use this for the start of the loop
    End Loop – Choose and add this event above an action you do not want included in the loop
  • Select Loop Type
    In the Configure tab under the Action field, choose from:
    Create a Loop from Line Items
    Create a Loop from Comma-Separated Values

    This determines the format of data the loop will iterate over.
  • Map the Line Items
    Click Map Line Items, name your variable (e.g., item, email, task), then select the field from a previous step that contains the line items or comma-separated values.
  • (Optional) Trim Whitespace
    Leave this blank unless your values contain leading/trailing spaces you want to remove.
  • Set Iteration Start
    The Loop Iteration Counter Start defaults to 0, but you can set it to begin from any index value.
  • Set Iteration Limit
    Define the maximum number of loop iterations — the cap is 500.

Line Items vs. Comma-Separated Values

You might wonder about the difference between these two.
Both formats are supported by OttoKit’s Loop action, but they’re slightly different in structure:

Line Items

Used when data comes in as a list of objects — like items in a cart, rows from a spreadsheet, or entries in a multi-field form.
Example:
[
{“name”: “Product A”, “qty”: 1},
{“name”: “Product B”, “qty”: 2}
]

Comma-Separated Values (CSV)

Ideal when you have a flat list of values in a single string.
Example:
[email protected], [email protected], [email protected]

Visual Overview

Use Cases for Loop

  • Send personalized emails to a list of recipients in a single workflow
  • Update multiple records in a CRM based on CSV data
  • Process each product in a WooCommerce order individually

The tutorial video below shows how you can use the Loop integration to update a Google Sheet row for each product purchased in a SureCart order.

Note: When testing any action within the Loop, it is executed for only the first iteration. This means that only one Product name, Quantity, and Price are added to the Google sheet. A live execution of the workflow will then act for the three products.

Expected Outcome when the workflow is executed:

Loop Limitations

Before looping away, here are a few things to keep in mind:

  • Nested Loops
    OttoKit currently does not support placing one loop inside another.
  • Iteration Limit
    Each loop can run a maximum of 500 iterations.
  • AI Agents Incompatible
    Looping isn’t supported inside OttoKit AI agents (yet!).

Pro Tips for Smooth Looping

  • Testing Loops: During tests, only the first iteration will run. Live workflows will loop through all iterations.
  • Set End Loop: Remember to set the End Loop action to prevent the Loop from running for all actions below the Loop. Otherwise, you can add all actions that should not repeat above the start Loop.
  • Rate Limits: Some API’s can have rate limits for how often within a specific period you get information from their API’s. The Loop integration runs very fast and thus could lead to a break in communication with your connection. To avoid this, you can add a delay to afford these platforms time to return a response.

OttoKit’s Loop action is your secret weapon for scalable, repetitive automations that stay clean, efficient, and powerful — even when the tasks pile up.
Let your workflows repeat themselves — so you don’t have to.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page
Scroll to Top