I would like to modify an instance of a workflow (not the workflow definition) on the fly by adding/removing task nodes by providing some kind of user interface to user. Ex if there is a workflow definition with nodes A-> B-> C-> D and there are 10 instances running is it possible to change one of these instances a-> b-> c-> d by adding a new task node like a-> b-> b1-> c-> c1-> d. Let me know if this is supported by Alfresco workflow APIs.
JayJayECL is correct that you can't change a workflow on the fly.
However what you would need to do for your use-case is to anticipate and build in the decisions into your workflow.
Two approaches that will work for your example. you could always include "b1" but make it a no-op depending on a condition. you could have a decision node in your workflow, "how many instances running > 10 B1 else C."