> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grid Iterator

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

export const m_runner = "Maia runner";

<ComponentMetadata warehouses={["Snowflake", "Databricks", "Amazon Redshift", "Google BigQuery"]} componentType="Orchestration & Test" connectionInputs="One" connectionOutputs="Unlimited" />

The Grid Iterator orchestration component implements a loop over the rows of a [grid variable](/docs/guides/grid-variables). This runs an attached component multiple times, each time using a different row of values from the grid.

To attach the iterator to another component, use the connection ring *beneath* the iterator to connect to the input of the other component. The two components will automatically "snap" together, with the iterator component sitting on top of the other component, and can be dragged around the canvas as a single component. For more information about attaching, stacking, and detaching iterators, read [Attaching, stacking, and detaching iterators](/docs/guides/iterator-components#attaching-stacking-and-detaching-iterators).

If you need to iterate more than one component, put them into a separate orchestration pipeline or transformation pipeline and use a [Run Transformation](/docs/components/run-transformation) or [Run Orchestration](/docs/components/run-orchestration) component attached to the iterator. In this way, you can run an entire pipeline flow multiple times, once for each row of variable values.

This iterator component is limited to a maximum of 5000 iterations.

***

## Properties

<ResponseField name="Name" type="string" required>
  A human-readable name for the component.
</ResponseField>

{/* <!-- param-start:[gridVariable] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Grid variable" type="drop-down" required>
  Select an existing [grid variable](/docs/guides/grid-variables) to iterate.
</ResponseField>

{/* <!-- param-start:[gridIteratorVariableMapping] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Grid iterator variable mapping" type="columns editor" required>
  * **Grid column name:** Select the grid column.
  * **Variable name:** Select an existing variable.

  Click the **Text mode** toggle at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read [Text mode](/docs/guides/components-overview#text-mode).

  To use grid variables, toggle **Use Grid Variable** on at the bottom of the dialog. For more information, read [Grid variables](/docs/guides/grid-variables).
</ResponseField>

{/* <!-- param-start:[breakOnFailure] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Break on failure" type="boolean" required>
  If a failure occurs during any iteration, the failure link is followed. This parameter controls whether it's followed immediately or after all iterations have been attempted.

  * **No:** Attempt to run the attached component for each iteration, regardless of success or failure. This is the default setting.
  * **Yes:** If the attached component doesn't run successfully, fail immediately.

  This property is only available when **Concurrency** is set to Sequential. When set to Concurrent, all iterations will be attempted.
</ResponseField>

{/* <!-- param-start:[concurrency] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Concurrency" type="drop-down" required>
  * **Concurrent:** Iterations run concurrently.
  * **Sequential:** Iterations run in sequence, waiting for each to complete before starting the next. This is the default setting.

  In Sequential mode, the iterations will always proceed in the same order that the data is held in the grid variable. So the first iteration will use values from the first row of the grid, the second will use the second row of the grid, and so on.

  [Full SaaS](/docs/guides/runner-overview#matillion-full-saas) deployments are limited to 20 concurrent tasks, with additional tasks being queued. [Hybrid SaaS](/docs/guides/runner-overview#hybrid-saas) deployments have 20 concurrent tasks per {m_runner} instance, with a maximum of 100 instances if configured accordingly.
</ResponseField>

{/* <!-- param-start:[stopOnCondition] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Stop on condition" type="drop-down" required>
  Select **Yes** to stop the iteration based on a condition specified in the **Condition** property. The default setting is **No**.

  For this property to be available, set **Concurrency** to **Sequential**.
</ResponseField>

{/* <!-- param-start:[stopOnConditionMode] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Stop on condition mode" type="drop-down">
  Select the method for creating the stop condition.

  * **Simple:** A no-code condition editor opens, where you specify an **Input Variable**, **Qualifier**, **Comparator**, and **Value**. This is the default setting.
  * **Advanced:** A code editor opens, where you write the condition manually using SQL.

  This property is only available when **Stop on condition** is set to **Yes**.
</ResponseField>

{/* <!-- param-start:[condition] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Condition (simple mode)" type="columns editor">
  Click the gear icon to open the **Condition** dialog. Use **+** and **-** to add or remove conditions. Each condition has the following columns:

  **Input variable:** An input variable to form a condition around.

  **Qualifier:** Select whether the condition should be applied (**Is**, the default) or reversed (**Not**). Selecting **Not** reverses the comparator, so **Equal to** becomes "not equal to", **Less than** becomes "greater than or equal to", and so on.

  **Comparator:** Select from:

  * **Less than:** Value of the input variable must be less than the specified value.
  * **Less than or equal to:** Value of the input variable must be less than or equal to the specified value.
  * **Equal to:** Value of the input variable must be equal to the specified value.
  * **Greater than or equal to:** Value of the input variable must be greater than or equal to the specified value.
  * **Greater than:** Value of the input variable must be greater than the specified value.
  * **Blank:** Checks whether the input variable is empty.

  **Value:** The value to compare against.

  Toggle **Text mode** to write the condition manually as a JavaScript expression instead.

  Toggle **Use Grid Variable** to use a grid variable to define the condition.

  This property is only available when **Stop on condition mode** is set to **Simple**.
</ResponseField>

{/* <!-- param-start:[advancedCondition] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Condition (advanced mode)" type="code editor">
  Enter the condition manually in the code editor using SQL.

  This property is only available when **Stop on condition mode** is set to **Advanced**.
</ResponseField>

{/* <!-- param-start:[combineConditions] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Combine conditions" type="drop-down">
  When multiple conditions are present, they can be separated by **And** or **Or**.

  * **And:** All the conditions must be true.
  * **Or:** Any of the conditions must be true.

  This property is only available when **Stop on condition** is set to **Yes** and **Stop on condition mode** is set to **Simple**.
</ResponseField>

{/* <!-- param-start:[maximumConcurrentIterations] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Maximum concurrent iterations" type="integer" optional>
  Use this to set a maximum limit on the number of concurrent iterations that will be attempted. This is important to ensure that the workload is orchestrated to accommodate any source and target constraints.

  If you leave this property blank, no upper limit will be placed on the number of concurrent tasks that can be attempted.

  If you [stack](/docs/guides/iterator-components#stacking-iterators) iterators, concurrency limits will multiply exponentially. For example, if you stack an iterator with Maximum concurrent iterations set to 10 on top of another iterator with Maximum concurrent iterations set to 10, the component could attempt 100 concurrent iterations.

  This property is only available when **Concurrency** is set to **Concurrent**.
</ResponseField>

{/* <!-- param-start:[recordValuesInTaskHistory] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Record values in task history" type="boolean" optional>
  If this is set to **Yes**, the [Task history](/docs/guides/designer-ui-basics#task-history) tab and [Observability dashboard](/docs/guides/pipeline-run-history) will show each iterator variable as a name/value pair in the component result message for each iteration. The default is **Yes**.
</ResponseField>

{/* <!-- param-start:[recordValuesInTaskHistory] | warehouses: [snowflake, databricks, redshift] --> */}

<ResponseField name="Record values in task history" type="boolean" optional>
  If this is set to **Yes**, the [Task history](/docs/guides/designer-ui-basics#task-history) tab and [Observability dashboard](/docs/guides/pipeline-run-history) will show each iterator variable as a name/value pair in the component result message for each iteration. The default is **Yes**.
</ResponseField>

## Counting the number of iterations

You can count the number of iterations using [System variables](/docs/guides/iterator-components#system-variables).
