How to change tasks dynamically in behaviour tree ?

Initially a dog follows a player, When player character clicks “F” input a stick must me spawned at another location then Dog move towards stick and pick it up and come towards player and throw in front of him. Someone help me please??