Triggering an Airflow DAG from terminal not working

amustafa picture amustafa · May 5, 2016 · Viewed 22.6k times · Source

I'm trying to use airflow to define a specific workflow that I want to manually trigger from the command line.

I create the DAG and add a bunch of tasks.

dag = airflow.DAG(
    "DAG_NAME",
    start_date=datetime(2015, 1, 1),
    schedule_interval=None,
    default_args=args)

I then run in the terminal

airflow trigger_dag DAG_NAME

and nothing happens. The scheduler is running in another thread. Any direction is much appreciated. Thank You

Answer

neolytics picture neolytics · Sep 13, 2016

I just encountered the same issue.

Assuming you are able to see your dag in airflow list_dags or via the web server then:

Not only did I have to turn on the dag in the web UI, but I also had to ensure that airflow scheduler was running as a separate process.

Once I had the scheduler running I was able to successfully execute my dag using airflow trigger_dag <dag_id>

My dag configuration is not significantly different from yours. I also have schedule_interval=None