Hi, First observation: > > When I set the heading 1 to DONE (without assigning it any other > keyword), the TRIGGER events are ignored totally. I guess this is > an edge-case that may be considered as a bug. > ​This is the result of Line 219 in org-depend.el: (unless (and (member from org-not-done-keywords) (member to org-done-keywords)) In this instance 'from' is set to nil so the 'and' returns nil and org-depend doesn't process the change of TODO to look for dependents. I don't know why it was defined this way as org-todo.el accepts headings with no TODO entry. I can't think of any reason other than explicitly blocking a user from processing a heading without a TODO entry, but it seems that if the user went to the effort of populating a TRIGGER property that they probably want this to be acted upon by org-depend.el. If there are no concerns raised in this thread I'll push a patch to all have org-depend process the example you listed. > Second observation: > > However, what is bugging me even more is that even when "heading 1" > has a TODO keyword assigned, in *some* cases, the TRIGGER event does > not get executed when I do it in my large Org-mode file. > > Copying the corresponding headings (the one with the TRIGGER prop > and the headings containing the "target" IDs) from my real-world > Org-mode file to my small test.org from above and marking the > heading that contains the TRIGGER properties to DONE, it then works > as expected. > > I then took the simple example from above, added a TODO keyword to > the heading 1, copied it to my real-world Org-mode file and even > this did not work: Heading 2 and 3 don't get their "NEXT" keyword > assigned. > > So the behavior changes within different Org-file contexts. > Therefore, I do have an issue creating a minimal example to > demonstrate the bug. > > Can somebody give me an advice how to debug this behavior? > ​My only thought is that there is an ID clashing with your sample ID and it is being updated instead of the heading you are interested in. org-depend.el looks at the local file for an ID and then looks globally for an ID match. You could instrument 'org-depend-trigger-todo' to trace the behaviour while processing the TODO update. Otherwise, you could use a process of elimination in a copy of your existing file to find the MWE that causes the issue and post it here. You could successively delete headings or other entries until the issue stops occurring.​ I have read your post on org-depend and found it insightful so thanks for that. When I was looking around at patching some new functionality into org-depend I was put onto org-edna[1] which was built as an alternative to org-depend. The syntax isn't compatible with org-depend, but org-edna is more powerful than org-depend. I am now using org-edna and am quite happy with it. [1] https://elpa.gnu.org/packages/org-edna.html