3

We have some applications running and we want to start using airflow. From the documentation it seems that the only way to start a DAG is over command line. Is this true?

For example we have a flask server running and we want to start some workflow controlled by airflow. How can we achieve this? Is there an API to trigger e.g.: "Run DAG now with parameters x,y,h"?

2 Answers 2

5

There are couple of ways to achieve this with airflow. It depends on your situation which one or if any at all is suitable for you. Two suggestions that come to my mind:

  1. Use Triggered DAGs. Python Jobs running in the Background may trigger a DAG to be executed in case an event happens. Have a look at the example_trigger_controller_dag.py and example_trigger_target_dag.py in the repository: GitHub Airflow

  2. Use SensorTasks: There are some predefined sensors available which you can use to listen for specific events in a datasource f.e. If the existing once do not satisfy your need, airflow should be adaptable enough to let you implement your own sensor Airflow Sensor

Sign up to request clarification or add additional context in comments.

Comments

0

After reading your question i understand your usecase as:
That you wish to run/trigger a DAG from HTTP server

--> you can just use the provided Airflow webserver(localhost:8080/) from which you can trigger/run the dag manually

Also You Can go HERE ,which is still in experimentation mode and use the api as provided

Please elaborate more so as to understand question better.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.