on_success_callback isn't run when marking a task instance as successful when it's not in a running state
See original GitHub issueApache Airflow version
2.2.3
What happened
When a task instance is in a failed state (or any other non running state), and then it’s marked as successful through the UI, the on_success_callback set on the task instance is not run.
What you think should happen instead
The on_success_callback should run when marking a task instance successful from the UI regardless of its state.
How to reproduce
- Create a DAG
- Add a task with an
on_success_callbackthat throws an exception (so it fails) - Run the DAG in the UI
- Wait for the task instance to fail for that DAG run
- Mark the task instance successful in the UI for that DAG run
Operating System
Debian 10 (Buster)
Versions of Apache Airflow Providers
apache-airflow-providers-databricks==2.5.0
This is the main provider we care about at the moment.
Deployment
Other Docker-based deployment
Anything else
From my observations, it seems as though the on_success_callback is run when a task instance is in a RUNNING state, and then is marked successful from the UI, but not when the task instance is in any other state. From some brief digging this behaviour appears to be related to the heartbeat_callback based on this old bug report but I can’t see any equivalent logic for when the task isn’t running.
For context - we are using this behaviour to track issues occurring in Airflow with a 3rd party tool where marking a task instance as successful is effectively an “ignore”, and our on_success_callback lets us register that ignore to another tool that tracks alerting.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
This seems to be a duplicate of https://github.com/apache/airflow/issues/18113
@tirkarthi ,
Yep that looks like the same issue.
Based on what @andrewgodwin said in #18113, it looks like this type of thing could be done in the future via running callback-only workloads on executors, but right now it doesn’t seem like a change that’d be easy to add.