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

# Script Pushdown

export const maia = "Maia";

export const m_runner = "Maia runner";

export const script_runner = "shared script runner";

export const designer = "Designer";

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>;
};

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

Script Pushdown is an orchestration component that lets you run Bash scripts and Python scripts in your pipelines. The component requires a {script_runner} to be installed in your cloud infrastructure to run the scripts.

<Note>
  Other script components are available. Choose the component that best suits your use case.

  * Use the [Python Script](/docs/components/python-script) component for small Python tasks that don't consume a high level of resources. The {m_runner} executes these scripts, so large scripts can cause the {m_runner} to run out of memory, affecting all other pipelines that the {m_runner} is executing. Script Pushdown uses a dedicated {script_runner} and is a better option for resource-intensive scripts.
  * The [Python Pushdown](/docs/components/python-pushdown) component lets you execute a Python script using the Snowpark service in your Snowflake account. This is a good option for resource-intensive scripts, provided your Snowflake account is scaled accordingly. If you don't use Snowflake, this component isn't available.
  * The Bash Pushdown component is now deprecated. Use Script Pushdown for all Bash scripts.
</Note>

***

## Shared script runner

Python and Bash scripts are executed by the {script_runner}, which is a lightweight script interpreter supplied by Matillion and installed in your cloud infrastructure. You can choose to install the {script_runner} as part of a {m_runner} deployment. Read [Shared script runner](/docs/guides/shared-script-runner) for details.

Your scripts are stored within your {maia} pipeline, and at runtime the script is pushed to the {script_runner} via SSH so the script executes in your cloud infrastructure.

The {script_runner} includes both Python3 and Bash interpreters. Therefore, a single {script_runner} can execute either type of script. You direct the {script_runner} to use the correct interpreter by setting the **Interpreter** property on the component.

<Warning>
  You must ensure that your cloud infrastructure is correctly sized to run the expected load imposed by your scripts. {maia} performs no checks on script performance or resource requirements.
</Warning>

***

## Script behavior

* Each instance of the component contains a single script, which may be either a Python script or a Bash script. Setting the **Interpreter** property ensures that the correct interpreter is used for the script.
* You can pass pipeline and project [variables](/docs/guides/variables) to the script.
* If you cancel a pipeline task while a script is running, then the script terminates.
* Script Pushdown can only be used in a [Hybrid SaaS](/docs/guides/runner-overview#matillion-full-saas-vs-hybrid-saas) deployment.

### Bash scripts

* Any output from a Bash script appears in the task completion message, and so output should be brief.
* Any command line tools or credentials that you wish to use must be installed and set up on the instance you're using.
* Pipeline variables and project variables are passed to the script as Bash environment variables. Variable values can't be returned to the pipeline from the script.

### Python scripts

* Only Python3 is supported.
* Any output from a `print` statement in a Python script appears in the task completion message, and so output should be brief.
* You may import any modules from the Python Standard Library. Optionally, you may also import your own Python libraries from cloud storage (Amazon S3 bucket, Azure Blob Storage container, or GCS bucket). To do this, you need to specify the location of your libraries in the environment variable `EXTENSION_LIBRARY_LOCATION`. For more information on this, read [Installing Python libraries](/docs/guides/installing-python-libraries). To use these additional Python libraries, you will need to include appropriate imports in your Python script, following standard Python practice.
* Validation of the Python syntax is handled by the {script_runner} at runtime. If validation fails, the script doesn't execute and the component terminates with a failure condition.
* Pipeline and project [variables](/docs/guides/variables) can be used in the script. Note the following:
  * You can set variables within the script using regular expressions, date and numeric calculations, and interpolated values.
  * Date and time manipulation in variables (for example, `datetime`, `timedelta`, or similar) is supported, but note that `datetime` isn't supported as a data type in {maia} variables.
  * Updated variables can be passed back from the script to the pipeline.
  * To learn how to manipulate variables through a Python script, read [Using variables in scripts](/docs/guides/variables#using-variables-in-scripts).

***

## Properties

Reference material is provided below for the Connection, Authentication, and Execution details properties.

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

### Connection

<ResponseField name="Host" type="string" required>
  Your SSH host.
</ResponseField>

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

<ResponseField name="User name" type="string" required>
  Your SSH username.

  Run `echo "$USER"` to prompt your shell for your username.
</ResponseField>

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

<ResponseField name="Connection timeout (ms)" type="integer" required>
  The length of time in milliseconds before the connection times out. The default is `3000`.
</ResponseField>

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

<ResponseField name="Port" type="integer" required>
  The port number used to connect to the SSH host. The default is set to port `22`.
</ResponseField>

### Authentication

<ResponseField name="Authentication type" type="drop-down" required>
  Select whether to use a basic password or a key pair to authenticate on the host. The default is **Key Pair**.
</ResponseField>

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

<ResponseField name="Password" type="drop-down" required>
  Required when **Authentication type** is set to **Basic Password**.

  Use the drop-down to select the secret definition that contains the connection's password.

  Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.
</ResponseField>

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

<ResponseField name="Private key" type="drop-down" required>
  Required when **Authentication type** is set to **Key Pair**.

  Use the drop-down to select the secret definition that contains the connection's private key.

  Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.
</ResponseField>

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

<ResponseField name="Require passphrase" type="boolean" required>
  Required when **Authentication type** is set to **Key Pair**. Select whether to require a passphrase as part of using key pair authentication. Default is **No**.
</ResponseField>

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

<ResponseField name="Passphrase" type="drop-down" required>
  Required when **Authentication type** is set to **Key Pair** and **Require passphrase** is set to **Yes**. Use the drop-down to select the secret definition that contains the connection's passphrase.

  Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.
</ResponseField>

### Execution details

<ResponseField name="Interpreter" type="drop-down" required>
  Select the type of script that the component runs: **Bash** or **Python**.
</ResponseField>

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

<ResponseField name="Allow inline variable replacement" type="boolean" optional>
  Select whether to enable variable resolution in the script. When set to **Yes**, {designer} variables can be referenced in the script. Default is **Yes**.
</ResponseField>

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

<ResponseField name="Bash script" type="text editor" optional>
  If **Interpreter** is **Bash**, enter the Bash script that the component runs.
</ResponseField>

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

<ResponseField name="Python script" type="text editor" optional>
  If **Interpreter** is **Python**, enter the Python script that the component runs.
</ResponseField>

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

<ResponseField name="Exit script on failure" type="boolean" required>
  Select whether to terminate the script if any command fails. Only applicable if **Interpreter** is **Bash**. Default is **Yes**.
</ResponseField>

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

<ResponseField name="Script timeout (s)" type="integer" optional>
  The number of seconds to wait for script termination. After the set number of seconds has elapsed, the script is forcibly terminated. The default is 360 seconds (6 minutes).
</ResponseField>
