Airflow Provider
Detailed technical description of the RudderStack Airflow Provider.
Last updated
Was this helpful?
Detailed technical description of the RudderStack Airflow Provider.
Last updated
Was this helpful?
RudderStack's Airflow Provider lets you programmatically schedule and trigger your syncs from outside RudderStack and integrate them with your existing Airflow workflows.
For more information on the codebase and sample implementation, refer to our .
To use the Airflow Provider, you must have a working Apache Airflow installation. For more information, refer to the .
Follow the steps in the below sections to use the RudderStack Airflow Provider:
Initialize all the dependencies by running Apache Airflow via the following command:
The Airflow standalone server is not meant for use in production. It is highly recommended using alternate methods to install and run Airflow in a production environment.
Install the RudderStack Airflow Provider by running the following command:
To create a new Airflow connection, follow these steps:
In your Airflow dashboard, go to Admin > Connections, as shown:
Add a new connection by configuring the following details:
Connection ID: Specify a unique connection name. RudderstackOperator
will pick the connection with the name rudderstack_default
by default. If you have created a connection with a different name, make sure that name is passed as a parameter to RudderstackOperator
.
Connection Type: For this field, select HTTP from the list.
Host: Set the value for this field to https://api.rudderstack.com
.
Password: Enter your Personal Access Token here.
Next, define a DAG with the tasks as per your requirement.
The following code snippet highlights an Airflow DAG with one task named rs_trigger_sync
for the source ID 20dQV6yuUDUw31peWA8f7xxgHdN
:
Once you have defined a DAG and configured an Airflow connection, run the following commands to allow Airflow to pick up and run the DAG:
Make sure the Airflow scheduler is running in the background. Also, you must enable the DAG in the Airflow dashboard, as shown:
You can trigger a DAG by clicking on the play button on the right as seen above, and selecting Trigger DAG. Note that stopping the DAG will not cancel the ongoing sync.
The source ID is a unique identifier for any source set up in RudderStack.
To obtain the source ID, go to the configured Reverse ETL source in your RudderStack dashboard and navigate to the Settings tab.
For more information on generating an access token, refer to the guide.
For more information on obtaining the source ID, refer to the section below.
For more information on where to find the source ID, refer to guide.
For queries on any of the sections covered in this guide, you can or start a conversation in our community.