> ## 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.

# Table Iterator

export const m_runner_0 = undefined

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 Table Iterator orchestration component lets you loop over rows of data within a table or view and run another component for each row.

This component implements a simple loop over rows of data in an existing table. It enables you to run an attached component multiple times, each time with different values set on any number of variables taken from columns of that table. Those variables can then be referenced from the attached component.

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.

The iterations are set up in advance, so the connection to the input table can be closed before any iterations are performed. If the attached component modifies the iteration table, those changes will not be reflected during the current run. Furthermore, to control runaway processes and manage resources, only a limited number of rows of a table are considered for iteration. If you are iterating many rows, it is instead recommended that you use the table in a transformation pipeline, and join the table being iterated instead.

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:[mode] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Mode" type="drop-down" required>
  * **Basic:** Construct the query using the clickable properties. This is the default setting.
  * **Advanced:** Manually write the SQL query.
</ResponseField>

<Tabs>
  <Tab title="Snowflake">
    {/* <!-- param-start:[database] | warehouses: [snowflake] --> */}

    <ResponseField name="Database" type="drop-down" required>
      Only if **Mode** is Basic.

      The Snowflake database. The special value `[Environment Default]` uses the database defined in the environment. Read [Databases, Tables and Views - Overview](https://docs.snowflake.com/en/guides-overview-db) to learn more.
    </ResponseField>

    {/* <!-- param-end:[database] --> */}

    {/* <!-- param-start:[schema] | warehouses: [snowflake] --> */}

    <ResponseField name="Schema" type="drop-down" required>
      Only if **Mode** is Basic.

      The Snowflake schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Database, Schema, and Share DDL](https://docs.snowflake.com/en/sql-reference/ddl-database.html) to learn more.
    </ResponseField>

    {/* <!-- param-end:[schema] --> */}

    {/* <!-- param-start:[targetTable] | warehouses: [snowflake] --> */}

    <ResponseField name="Target table" type="drop-down" required>
      The name of the target table. Only if **Mode** is Basic.
    </ResponseField>

    {/* <!-- param-end:[targetTable] --> */}
  </Tab>

  <Tab title="Databricks">
    {/* <!-- param-start:[catalog] | warehouses: [databricks] --> */}

    <ResponseField name="Catalog" type="drop-down" required>
      Select a [Databricks Unity Catalog](https://docs.databricks.com/en/data-governance/unity-catalog/index.html). The special value `[Environment Default]` uses the catalog defined in the environment. Selecting a catalog will determine which databases are available in the next parameter.
    </ResponseField>

    {/* <!-- param-end:[catalog] --> */}

    {/* <!-- param-start:[schema] | warehouses: [databricks] --> */}

    <ResponseField name="Schema (database)" type="drop-down" required>
      The Databricks schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Create and manage schemas](https://docs.databricks.com/en/data-governance/unity-catalog/create-schemas.html) to learn more.
    </ResponseField>

    {/* <!-- param-end:[schema] --> */}

    {/* <!-- param-start:[targetTable] | warehouses: [databricks] --> */}

    <ResponseField name="Target table" type="drop-down" required>
      The name of the target table. Only if **Mode** is Basic.
    </ResponseField>

    {/* <!-- param-end:[targetTable] --> */}
  </Tab>

  <Tab title="Amazon Redshift">
    {/* <!-- param-start:[schema] | warehouses: [redshift] --> */}

    <ResponseField name="Schema" type="drop-down" required>
      Select the table schema. The special value `[Environment Default]` uses the schema defined in the environment. For more information on using multiple schemas, read [Schemas](https://docs.aws.amazon.com/redshift/latest/dg/r_Schemas_and_tables.html).
    </ResponseField>

    {/* <!-- param-end:[schema] --> */}

    {/* <!-- param-start:[targetTable] | warehouses: [redshift] --> */}

    <ResponseField name="Target table" type="drop-down" required>
      The name of the target table. Only if **Mode** is Basic.
    </ResponseField>

    {/* <!-- param-end:[targetTable] --> */}
  </Tab>

  <Tab title="Google BigQuery">
    {/* <!-- param-start:[gcpProjectId] | warehouses: [bigquery] --> */}

    <ResponseField name="GCP project ID" type="drop-down" required>
      <BigQueryGcpProjectId />
    </ResponseField>

    {/* <!-- param-end:[gcpProjectId] --> */}

    {/* <!-- param-start:[dataset] | warehouses: [bigquery] --> */}

    <ResponseField name="Dataset" type="drop-down" required>
      The Google BigQuery dataset that contains the target table. The special value `[Environment Default]` uses the dataset defined in the environment.
    </ResponseField>

    {/* <!-- param-end:[dataset] --> */}

    {/* <!-- param-start:[targetTable] | warehouses: [bigquery] --> */}

    <ResponseField name="Target table" type="drop-down" required>
      The name of the target table. Only if **Mode** is Basic.
    </ResponseField>

    {/* <!-- param-end:[targetTable] --> */}
  </Tab>
</Tabs>

<ResponseField name="Query" type="code editor" required>
  Manually write the SQL query if **Mode** is set to `Advanced`.
</ResponseField>

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

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

  [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_0} instance, with a maximum of 100 instances if configured accordingly.
</ResponseField>

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

<ResponseField name="Column mapping" type="column editor" required>
  Map the columns in the target table to project or pipeline variables. Click **+** to add a mapping and enter the following:

  * **Column name:** Select a table column name.
  * **Variable name:** Select an existing variable name.

  Toggle **Text mode** to write the mapping manually as a text expression instead.

  <UseGridVariable />
</ResponseField>

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

<ResponseField name="Order by" type="dual listbox">
  Move columns to the right-hand box to define the "order by" sequence.

  <UseGridVariableTop />

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

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

<ResponseField name="Sort" type="drop-down">
  Choose to order by ascending or descending. The default is ascending.

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

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

<ResponseField name="Break on failure" type="drop-down">
  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:[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, 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>

## Counting the number of iterations

The Table Iterator determines the number of rows to iterate at runtime, based on the contents of the target table. You can count the number of iterations using [System variables](/docs/guides/iterator-components#system-variables).
