taskflow icon indicating copy to clipboard operation
taskflow copied to clipboard

Feature Request: API to remove dependency between two tasks

Open qq978358810 opened this issue 4 months ago • 0 comments

Is there a way to remove a dependency between two tasks after it's been established?

Hello, thank you for this excellent library!

I'm currently using Taskflow to build a dynamic task graph editor, where users can create and remove connections (i.e., dependencies) between tasks at runtime.

I noticed that once a dependency is created via taskA.precede(taskB), there doesn't seem to be a way to remove it later unless I rebuild the entire Taskflow graph. I understand that Taskflow is designed to work with static DAGs, but for certain interactive applications (such as flow-based editors or graphical pipelines), it would be helpful to programmatically remove a dependency between two tasks, similar to how we can establish one.

Questions:

  1. Is there any internal or planned API that allows removing a dependency between two tasks (e.g., taskA.remove_precedence(taskB))?
  2. If not, is this feature something that could be considered in a future version?
  3. Are there any suggested workarounds besides rebuilding the entire graph?

Thanks again for your great work!

qq978358810 avatar Jun 19 '25 06:06 qq978358810