From universal bot we want to take the triggered intent names from connected standard bots and want to store it in a data table. This storing task is in separate bot.

when we type agent at starting of the conversation it should not save any intent name.
when we type agent in middle of the chat it should save the on going task name.
when we type agent after anything else task it should save the completed task name.
when we type another task name after completion of one task then it should save the present task name after whole completion.
If the user responses no to the anything else (Bot task) the completed task should be saved.
This all tasks will trigger from a universal bot, and all the completed task should be save in one data table.

How can we achieve this?