You can trigger runs programmatically like this:

def set_up_dag_run(context, dag_run_obj):

    dag_run_obj.payload = {"config": context["config"]}

    dag_run_obj.run_id = str(uuid4())

    print context

    return dag_run_obj


my_dag_run = TriggerDagRunOperator(

        trigger_dag_id=my_workflow.workflow_name,

        python_callable=set_up_dag_run,

        task_id="run_my_workflow",

        owner="airflow")

my_dag_run.execute({"config": effective_config})

On Thu, Feb 1, 2018 at 9:05 PM Naik Kaxil <[email protected]> wrote:

> Hi Song Liu,
>
> In Airflow 1.8 and higher there is a button for each dag on the dashboard
> that looks like a play button, you will need to click on that button to
> Trigger that DAG.
>
> More info: https://stackoverflow.com/a/43375518/5691525 .
>
> Regards,
> Kaxil
>
> On 01/02/2018, 18:38, "Song Liu" <[email protected]> wrote:
>
>     Hi,
>
>     It seems that airflow scheduler is based on the start_date and
> interval, but is that possible to be triggered only by user request on
> demand immediately ? such as when user click a button "Run" then this dag
> will be started right now and be stopped when finished.
>
>     Thanks for any information!
>
>     Thanks,
>     Song
>
>
>
>
>
>
> Kaxil Naik
>
> Data Reply
> 38 Grosvenor Gardens
> London SW1W 0EB - UK
> phone: +44 (0)20 7730 6000 <+44%2020%207730%206000>
> [email protected]
> www.reply.com
>
-- 

Sergei

Reply via email to