The structure of Org files—hierarchy and lists—makes it easy to define TODO dependencies. Usually, a parent TODO task should not be marked as done until all TODO subtasks, or children tasks, are marked as done. Sometimes there is a logical sequence to (sub)tasks, so that one subtask cannot be acted upon before all siblings above it have been marked as done. If you customize the variable
org-enforce-todo-dependencies, Org blocks entries from changing state to DONE while they have TODO children that are not DONE. Furthermore, if an entry has a property ‘
ORDERED’, each of its TODO children is blocked until all earlier siblings are marked as done. Here is an example:
* TODO Blocked until (two) is done
** DONE one
** TODO two
** TODO a
** TODO b, needs to wait for (a)
** TODO c, needs to wait for (a) and (b)
You can ensure an entry is never blocked by using the ‘
NOBLOCKING’ property (see Properties and Columns):
* This entry is never blocked
C-c C-x o (
Toggle the ‘
ORDERED’ property of the current entry. A property is used for this behavior because this should be local to the current entry, not inherited from entries above like a tag (see Tags). However, if you would like to track the value of this property with a tag for better visibility, customize the variable
C-u C-u C-u C-c C-t
Change TODO state, regardless of any state blocking.
If you set the variable
org-agenda-dim-blocked-tasks, TODO entries that cannot be marked as done because of unmarked children are shown in a dimmed font or even made invisible in agenda views (see Agenda Views).
You can also block changes of TODO states by using checkboxes (see Checkboxes). If you set the variable
org-enforce-todo-checkbox-dependencies, an entry that has unchecked checkboxes is blocked from switching to DONE.
If you need more complex dependency structures, for example dependencies between entries in different trees or files, check out the contributed module ‘