Skip to main content

How to Pause and Unpause a Dag in Apache Airflow®

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

A paused Apache Airflow® Dag creates no scheduled runs. Every new Dag starts paused, so unpausing is the first thing you do with one, and pausing is how you stop a Dag from running on its schedule without deleting anything. This guide does both with the toggle on the Dag's page, on Airflow 3.4.0.

What Paused Means​

Airflow's documentation on Dags: paused Dags "do not schedule task instances, although you can trigger manual runs". When a Dag is paused, running tasks are allowed to finish.

Prerequisites​

  • Apache Airflow® running, and a Dag in its list. This guide uses hello_pause, a Dag with one task.

Step 1: Find the Toggle​

Open the Dag. The toggle is at the top right, next to Trigger. Hover over it:

The hello_pause Dag page with the pause toggle switched off and its tooltip, Unpause hello_pause, next to the Trigger button.

The toggle is off and its tooltip says Unpause hello_pause: the Dag is paused, as every new Dag is. That comes from the setting [core] dags_are_paused_at_creation, which is True by default.

Step 2: Unpause It in the UI​

Click the toggle:

The hello_pause Dag page with the pause toggle switched on.

It's on: the Dag is active and runs on its schedule. hello_pause has no schedule (schedule=None), so nothing starts by itself, but you can now trigger runs that start right away.

Step 3: Pause It Again​

Click the toggle once more:

The hello_pause Dag page after clicking the toggle again: the toggle is off and the tooltip says Unpause hello_pause.

It's off again, with no question asked, because nothing was running. The tooltip shows Unpause hello_pause again since the mouse is still over it.

Common Mistakes​

MistakeWhat happensDo this instead
Waiting for a confirmation after clicking the toggleNothing more appears when nothing is running: the change is immediateLook at the toggle's position
Triggering a run on a paused Dag from the terminalThe run stays queued: airflow dags trigger's help says the task won't runUnpause first
Pausing to stop a task that's already runningRunning tasks are allowed to finish, as the documentation saysExpect the running task to finish

Troubleshooting​

SymptomLikely causeFix
A new Dag doesn't run on its scheduleNew Dags start pausedUnpause it

FAQ​

Can I still run a paused Dag by hand?​

Yes, with the Trigger button: the dialog asks whether to unpause it, drain it or keep it paused (How to Trigger a Dag from the Apache Airflow® UI).

Does pausing delete anything?​

No. The Dag, its runs and its logs stay.

Conclusion​

The toggle on hello_pause's page showed the Dag paused, as every new Dag is, then unpaused it and paused it again with one click each, with no dialog because nothing was running.

Additional Resources​

Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.