I have a DAG that runs daily at specific scheduled interval that fetched data from the API, process it and transfer it to Google Cloud.
Now as the Authorization token keeps on expiring for the API, I need to automate the task of fetching the auth token(using API) and update the connections in Airflow. For that I have added one more task in my DAG, that updates the Auth token in my Airflow connections.
But I want to schedule that particular task only once a month and not daily.
This is my default_args in DAG
default_args = {
"owner": "airflow_admin",
"start_date": datetime(2017, 8, 29),
"schedule_interval": "0 5 * * *"
}
This is my task
update_auth_token = PythonOperator(
task_id = "update_auth_token",
python_context = True,
python_callable = update_auth_token,
dag=dag,
)
How can I schedule only task update_auth_token once a month and not daily unlike other tasks running in the DAG? Can I just add start_date, schedule_interval in the task seperately? Are there any other approaches?