---
title: Snowflake - Load data - Apache Airflow load control
description: Load the deployed Snowflake solution with Apache Airflow by running the DAG that the generator writes.
---

[Skip to content](https://knowledge.bigenius-x.com/snowflake-load-data-apache-airflow-load-control#main-content)

[Contact us](https://knowledge.bigenius-x.com/kb-tickets/new?hsLang=en) [Go to Customer Portal](https://knowledge.bigenius-x.com/customer-portal?hsLang=en)

[![TRI\_Logo\_biGENIUS\_2020\_RGB\_s](https://knowledge.bigenius-x.com/hs-fs/hubfs/Marketing/TRI_Logo_biGENIUS_2020_RGB_s.png?width=150&height=42&name=TRI_Logo_biGENIUS_2020_RGB_s.png)](https://www.bigenius-x.com/)

Open main navigation

Close main navigation

- [Contact us](https://knowledge.bigenius-x.com/kb-tickets/new)
- [Go to Customer Portal](https://knowledge.bigenius-x.com/customer-portal)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [biGENIUS-X Knowledge Base](https://knowledge.bigenius-x.com/?hsLang=en)
2. [Generators](https://knowledge.bigenius-x.com/generators?hsLang=en)
3. [Load data with Apache Airflow](https://knowledge.bigenius-x.com/generators?hsLang=en#load-data-with-apache-airflow)

# Snowflake - Load data - Apache Airflow load control

**Applies to**  
Platform: Snowflake

Load the deployed Snowflake solution with Apache Airflow by running the DAG that the generator writes. The DAG has one task per loader, runs them in dependency order and calls each loader through the Airflow connection `snowflake_default`. Afterwards the Graph of the run shows the state of every loader task.

The DAG is written for Apache Airflow 2. It imports `airflow.operators.dummy` and `SnowflakeSqlApiOperator` of the provider `apache-airflow-providers-snowflake`, which uses key-pair authentication.

### Prerequisites

- [LoadControl Options](https://knowledge.bigenius-x.com/loadcontrol-options-project?hsLang=en) contains `Airflow`, and [Configure LoadControl](https://knowledge.bigenius-x.com/configure-loadcontrol-project?hsLang=en) is `true`.
- The artifacts are [deployed](https://knowledge.bigenius-x.com/snowflake-deployment?hsLang=en) without errors.
- An Airflow 2 environment with the Snowflake provider, for example the one of [Apache Airflow - Load control environment](https://knowledge.bigenius-x.com/apache-airflow-load-control-environment?hsLang=en).
- A Snowflake user with [key-pair authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth) and an encrypted private key. Airflow needs the private key text and the passphrase that encrypts it.

### Run the DAG

1. Copy `LoadControl\<project>_dag.py` from the replaced artifacts into the folder `dags` of Airflow. `<project>` is the project name in lower case with underscores; the DAG ID is the file name without `_dag.py`.
2. In the Airflow UI, open Admin, choose Connections and select + (Add a new record).  
   ![Airflow Admin menu with Connections highlighted](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-36-12-8250-AM.png?width=507&height=168&name=image-png-Jun-06-2024-06-36-12-8250-AM.png)  
   ![Airflow List Connection page with the add button highlighted](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-37-07-9860-AM.png?width=503&height=139&name=image-png-Jun-06-2024-06-37-07-9860-AM.png)
3. Enter the connection. Each task names its loader with database and schema, so one connection serves all layers: 
     - Connection Id: `snowflake_default`
     - Connection Type: Snowflake
     - Schema: empty
     - Login: the Snowflake user
     - Password: the passphrase of the private key
     - Account: the account identifier `<organization>-<account>` from the account URL `https://<organization>-<account>.snowflakecomputing.com`; Region stays empty. With an account URL `https://<locator>.<region>.snowflakecomputing.com`, enter `<locator>` in Account and `<region>` in Region.
     - Warehouse: the warehouse that runs the loaders. The Snowflake provider of the Airflow 2.9.1 image runs every task on this warehouse, even though the DAG names a warehouse for each layer. Without a value, the tasks use the default warehouse of the user.
     - Database: empty
     - Role: the role that runs the loaders. Without a value, the tasks use the default role of the user.
     - Private key (Text): the private key, from `-----BEGIN ENCRYPTED PRIVATE KEY-----` to `-----END ENCRYPTED PRIVATE KEY-----`
   ![Airflow Add Connection form for connection type Snowflake with empty fields](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Oct-03-2024-02-50-42-3090-PM.png?width=640&height=952&name=image-png-Oct-03-2024-02-50-42-3090-PM.png)
4. Select Test; it shows `Connection successfully tested` when Airflow reaches Snowflake. Then select Save.  
   ![Test button on the connection form](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-52-25-8266-AM.png?width=158&height=49&name=image-png-Jun-06-2024-06-52-25-8266-AM.png)  
   ![Connection successfully tested message](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-52-00-3336-AM.png?width=640&height=54&name=image-png-Jun-06-2024-06-52-00-3336-AM.png)  
   ![Save button on the connection form](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-52-54-6833-AM.png?width=158&height=49&name=image-png-Jun-06-2024-06-52-54-6833-AM.png)
5. Open DAGs and switch on the toggle left of the DAG, or run `docker compose exec airflow-scheduler airflow dags unpause <dag id>`.  
   ![Airflow menu bar with DAGs highlighted](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-54-19-7985-AM.png?width=541&height=42&name=image-png-Jun-06-2024-06-54-19-7985-AM.png)
6. Select Trigger DAG in the column Actions, or run `docker compose exec airflow-scheduler airflow dags trigger <dag id>`.  
   ![Trigger DAG button in the Actions column](https://knowledge.bigenius-x.com/hs-fs/hubfs/image-png-Jun-06-2024-06-55-31-9128-AM.png?width=129&height=87&name=image-png-Jun-06-2024-06-55-31-9128-AM.png)

The DAG starts with the task `begin` and ends with the task `end`. Each loader task runs after the tasks of the loaders it depends on. The task ID of each loader task is the generated loader name; the diagram shows them for an example with the Stage objects ITEM and PRICE and the Hub, Satellite and PIT ITEM; the Satellite reads both Stage objects. Arrows point from the task that runs first to the task that waits for it.

![Run order of the DAG on Snowflake, with the loader task IDs: the task begin starts the Stage Loader tasks STG\_ST\_ITEM\_Loader and STG\_ST\_PRICE\_Loader; the Hub Loader RDV\_HUB\_ITEM\_Loader runs after STG\_ST\_ITEM\_Loader, the Satellite Loader RDV\_SAT\_ITEM\_Loader runs after both Stage Loaders STG\_ST\_ITEM\_Loader and STG\_ST\_PRICE\_Loader, and the PIT Loader RDV\_PIT\_ITEM\_Loader runs after the Satellite Loader. The task end runs after RDV\_HUB\_ITEM\_Loader and RDV\_PIT\_ITEM\_Loader, the tasks that no other task waits for.](https://knowledge.bigenius-x.com/hs-fs/hubfs/knowledge_base_screenshots/snowflake-load-data-apache-airflow-load-control-run-chain-v2.png?width=688&height=166&name=snowflake-load-data-apache-airflow-load-control-run-chain-v2.png)

All tasks of a DAG run pass the same load timestamp to their loaders: the logical date of the run. The DAG has no schedule; it runs when you trigger it.

### Check the result

Select the DAG, then the run, and open the tab Graph. The run succeeded when every task shows the state `success`. `docker compose exec airflow-scheduler airflow dags list-runs -d <dag id>` shows the state of each run.

### Example

The DAG `test_vaultandmart_snowflake` of a Data Vault and Mart project has one task per loader between the tasks `begin` and `end`. Each task calls one loader:

```
run_stg_st_bdc_customer_loader = SnowflakeSqlApiOperator(
    task_id = "STG_ST_BDC_CUSTOMER_Loader",
    sql="""CALL DWH.SA.STG_ST_BDC_CUSTOMER_LOADER(
      TO_TIMESTAMP_TZ('{{ logical_date.strftime(...) }}'),
      TO_TIMESTAMP_TZ('{{ logical_date.strftime(...) }}'))""",
    snowflake_conn_id='snowflake_default',
    database='DWH', schema='SA', warehouse='COMPUTE_WH',
    poll_interval=10, task_concurrency=1,
)
```

Here `DWH`, `SA` and `COMPUTE_WH` are the replaced example values of the Stage layer.

### Failure symptoms and recovery

#### A task fails because the connection is missing

Cause: No Airflow connection has the ID `snowflake_default`.  
Fix: Create the connection as in step 3. Then clear the failed task and its downstream tasks in the Graph, so that they run again.

#### The DAG shows an import error

Cause: The Airflow environment has no Snowflake provider, or it runs Airflow 3, which no longer contains `airflow.operators.dummy`.  
Fix: Use an Airflow 2 environment with `apache-airflow-providers-snowflake`, as described in [Apache Airflow - Load control environment](https://knowledge.bigenius-x.com/apache-airflow-load-control-environment?hsLang=en).

For failures in other steps, see [Troubleshoot generation, deployment and load failures](https://knowledge.bigenius-x.com/troubleshoot-generation-deployment-and-load-failures?hsLang=en).

### Related articles

- Previous: [Snowflake - Deployment](https://knowledge.bigenius-x.com/snowflake-deployment?hsLang=en), [Apache Airflow - Load control environment](https://knowledge.bigenius-x.com/apache-airflow-load-control-environment?hsLang=en)
- Reference: [LoadControl Options (Project)](https://knowledge.bigenius-x.com/loadcontrol-options-project?hsLang=en), [Configure LoadControl (Project)](https://knowledge.bigenius-x.com/configure-loadcontrol-project?hsLang=en), [Snowflake - Placeholder values](https://knowledge.bigenius-x.com/snowflake-placeholder-values?hsLang=en)
- See also: [Understand load control](https://knowledge.bigenius-x.com/understand-load-control?hsLang=en), [Snowflake - Load data - Native load control](https://knowledge.bigenius-x.com/snowflake-load-data-native-load-control?hsLang=en), [Snowflake - Artifacts](https://knowledge.bigenius-x.com/snowflake-artifacts?hsLang=en)

- [Getting started](https://knowledge.bigenius-x.com/getting-started?hsLang=en#main-content)

    - [Guidelines](https://knowledge.bigenius-x.com/getting-started?hsLang=en#guidelines)
    - [Start working](https://knowledge.bigenius-x.com/getting-started?hsLang=en#start-working)
    - [Account](https://knowledge.bigenius-x.com/getting-started?hsLang=en#account)
- [General overview](https://knowledge.bigenius-x.com/general-overview?hsLang=en)
- [Artificial Intelligence](https://knowledge.bigenius-x.com/artificial-intelligence?hsLang=en#main-content)

    - [MCP server](https://knowledge.bigenius-x.com/artificial-intelligence?hsLang=en#mcp-server)
- [Application Modules](https://knowledge.bigenius-x.com/application-modules?hsLang=en#main-content)

    - [Administration](https://knowledge.bigenius-x.com/application-modules?hsLang=en#administration)
    - [Solutions](https://knowledge.bigenius-x.com/application-modules?hsLang=en#solutions)
    - [Global Features](https://knowledge.bigenius-x.com/application-modules?hsLang=en#global-features)
    - [Projects](https://knowledge.bigenius-x.com/application-modules?hsLang=en#projects)
    - [Branches](https://knowledge.bigenius-x.com/application-modules?hsLang=en#branches)
    - [Data Connections](https://knowledge.bigenius-x.com/application-modules?hsLang=en#data-connections)
    - [Dataflow Modeling - Overview](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-overview)
    - [Dataflow Modeling - Wizard Steps](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-wizard-steps)
    - [Dataflow Modeling - Terms](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-terms)
    - [Dataflow Modeling - Term Mapping](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-term-mapping)
    - [Dataflow Modeling - Relationships](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-relationships)
    - [Dataflow Modeling - Data Quality](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-data-quality)
    - [Dataflow Modeling - Indexes](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-indexes)
    - [Relationship Modeling](https://knowledge.bigenius-x.com/application-modules?hsLang=en#relationship-modeling)
    - [Generate Artifacts](https://knowledge.bigenius-x.com/application-modules?hsLang=en#generate-artifacts)
    - [Project Settings](https://knowledge.bigenius-x.com/application-modules?hsLang=en#project-settings)
    - [Data Marketplace](https://knowledge.bigenius-x.com/application-modules?hsLang=en#data-marketplace)
- [Generators](https://knowledge.bigenius-x.com/generators?hsLang=en#main-content)

    - [Databricks](https://knowledge.bigenius-x.com/generators?hsLang=en#databricks)
    - [Databricks dbt](https://knowledge.bigenius-x.com/generators?hsLang=en#databricks-dbt)
    - [Fabric Lakehouse](https://knowledge.bigenius-x.com/generators?hsLang=en#fabric-lakehouse)
    - [Fabric Warehouse](https://knowledge.bigenius-x.com/generators?hsLang=en#fabric-warehouse)
    - [Microsoft SQL Server](https://knowledge.bigenius-x.com/generators?hsLang=en#microsoft-sql-server)
    - [Oracle](https://knowledge.bigenius-x.com/generators?hsLang=en#oracle)
    - [Snowflake](https://knowledge.bigenius-x.com/generators?hsLang=en#snowflake)
    - [Snowflake dbt](https://knowledge.bigenius-x.com/generators?hsLang=en#snowflake-dbt)
    - [Artifacts](https://knowledge.bigenius-x.com/generators?hsLang=en#artifacts)
    - [Replace Placeholders](https://knowledge.bigenius-x.com/generators?hsLang=en#replace-placeholders)
    - [Target solution environment](https://knowledge.bigenius-x.com/generators?hsLang=en#target-solution-environment)
    - [Deployment](https://knowledge.bigenius-x.com/generators?hsLang=en#deployment)
    - [Deployment with an Azure DevOps pipeline](https://knowledge.bigenius-x.com/generators?hsLang=en#deployment-with-an-azure-devops-pipeline)
    - [Delta Deployment](https://knowledge.bigenius-x.com/generators?hsLang=en#delta-deployment)
    - [Load control environment](https://knowledge.bigenius-x.com/generators?hsLang=en#load-control-environment)
    - [Load data with a native load control](https://knowledge.bigenius-x.com/generators?hsLang=en#load-data-with-a-native-load-control)
    - [Load data with Apache Airflow](https://knowledge.bigenius-x.com/generators?hsLang=en#load-data-with-apache-airflow)
    - [Model Object Type](https://knowledge.bigenius-x.com/generators?hsLang=en#model-object-type)
    - [Properties](https://knowledge.bigenius-x.com/generators?hsLang=en#properties)
    - [Default Terms](https://knowledge.bigenius-x.com/generators?hsLang=en#default-terms)
- [Discovery application](https://knowledge.bigenius-x.com/discovery-application?hsLang=en#main-content)

    - [Discovery configurations](https://knowledge.bigenius-x.com/discovery-application?hsLang=en#discovery-configurations)
- [Best practices](https://knowledge.bigenius-x.com/best-practices?hsLang=en#main-content)

    - [Modeling Approaches](https://knowledge.bigenius-x.com/best-practices?hsLang=en#modeling-approaches)
    - [Use Cases](https://knowledge.bigenius-x.com/best-practices?hsLang=en#use-cases)
    - [Business Rules](https://knowledge.bigenius-x.com/best-practices?hsLang=en#business-rules)
    - [Data Quality Rules](https://knowledge.bigenius-x.com/best-practices?hsLang=en#data-quality-rules)
- [FAQs](https://knowledge.bigenius-x.com/faqs?hsLang=en)
- [Product Release Notes](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#main-content)

    - [SaaS Application](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#saas-application)
    - [Discovery application](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#discovery-application)
    - [Generators](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#generators)
    - [MCP server](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#mcp-server)
- [Legal Documents](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#main-content)

    - [Current legal docs](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#current-legal-docs)
    - [Software Product and Limits](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#software-product-and-limits)

- [Contact us](https://knowledge.bigenius-x.com/kb-tickets/new?hsLang=en)
- [Customer Portal](https://knowledge.bigenius-x.com/customer-portal)
- [Sign in](https://knowledge.bigenius-x.com/_hcms/mem/login)

[![biGENIUS logo](https://knowledge.bigenius-x.com/hubfs/TRI_Logo_biGENIUS_2020_RGB-1.svg "biGENIUS logo")](https://www.bigenius-x.com)

<https://www.linkedin.com/company/bigenius> <https://www.youtube.com/@biGENIUS_DWA>

All rights reserved © 2025, biGENIUS AG