Implement future state property of task
- Dominant language
- Python
- Stars
- 46.9k
- Forks
- 17.8k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 483
Description
### Description
We propose to implement future state or promised state as a property of a task instance or even task class itself. It would be really valuable, especially if it can be controlled via gui. The behavior is: From GUI futureState may be set/unset to for example to skipped value or other values of State enumeration type.
Once a task is scheduled for execution it will check if it has something set in futureState variable if so: it will copy the value to the state and stop itself execution.
This would lead to user can control state of task during time before its execution, and it does not enforce omitting dependencies of affected task.
### Use case/motivation
Our operators of airflow want to skip some task instances from the airflow GUI, especially in the case the task instance was not yet scheduled for execution.
Technically it does not make sense with the current behaviour, because with Trigger rule: none_failed it enforce excution of depended task immediatelly once TI state is set to skipped and dependencies of the affected task are ommited.
We have already implemented the proposed feature easy way by: Our task instance is checking its notes for strings:
[skip], [stop], if text like these is seen in task notes once task is executed it set its state to "skipped" or "stopped", but our operators demands full support of the GUI via buttons.
### Related issues
_No response_
### Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
No files, tests, or specific entry points are identified. Start by tracing task-instance scheduling and the GUI controls for task state, then define how a future state is stored, applied, and cleared without prematurely satisfying dependent tasks. Done means the GUI can set or unset a valid future state and execution applies it consistently with dependency behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data-engineering, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100