You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "raphaelauv (via GitHub)" <gi...@apache.org> on 2026/08/03 07:41:55 UTC

Re: [D] Manual DAG execution with defined delay [airflow]

GitHub user raphaelauv edited a comment on the discussion: Manual DAG execution with defined delay

best solution would be with TimeDeltaSensor , but the argument is not templated ( dynamic )

since apache-airflow-providers-standard version 1.17.0

you can do

```python
from datetime import datetime
from airflow.providers.standard.sensors.time_delta import WaitSensor
from airflow.sdk import DAG, Param

with DAG(
        dag_id="my_dag",
        start_date=datetime(2026, 8, 1),
        schedule=None,
        catchup=False,
        params={
            "duration_minutes": Param(
                default=1,
                type="integer",
                minimum=1,
                description="Duration in minutes to wait before continuing.",
            )
        },
):

    WaitSensor(
        task_id="wait_for_duration",
        time_to_wait="{{ params.duration_minutes }}",
        deferrable=True,
    )
```


GitHub link: https://github.com/apache/airflow/discussions/68383#discussioncomment-17790345

----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org