Broke down/extended t2flow running code

Broke down running t2flow into functions and handled cases of: Running t2flow with trigger and without trigger