If it happens to be an API call / data retrieval, then the control flow handle will remain within the ‘dialogue management’ component that will further use/persist this information to predict the next_action, once again. The dialogue manager will update its current state based on this action and the retrieved results to make the next prediction. Once the next_action corresponds to responding to the user, then the ‘message generator’ component takes over.
Previous generations of chatbots were present on company websites, e.g. Ask Jenn from Alaska Airlines which debuted in 2008 or Expedia's virtual customer service agent which launched in 2011.  The newer generation of chatbots includes IBM Watson-powered "Rocky", introduced in February 2017 by the New York City-based e-commerce company Rare Carat to provide information to prospective diamond buyers. 
With competitor Venmo already established, peer-to-peer payments is not in and of itself a compelling feature for Snapchat. However, adding wallet functionality and payment methods to the app does lay the groundwork for Snapchat to delve directly into commerce. The messaging app’s commerce strategy became more clear in April 2016 with its launch of shoppable stories with select partners in its Discover section. For the first time, while viewing video stories from Target and Lancome, users were able to “swipe up” to visit an e-commerce page embedded within the Snapchat app where they could purchase products from those partners.
It’s not all doom and gloom for chatbots. Chatbots are a stopgap until virtual assistants are able to tackle all of our questions and concerns, regardless of the site or platform. Virtual assistants will eventually connect to everything in your digital life, from websites to IoT-enabled devices. Rather than going through different websites and speaking to various different chatbots, the virtual assistant will be the platform for finding the answers you need. If these assistants are doing such a good job, why would you even bother to use a branded chatbot? Realistically this won’t take place for sometime, due to the fragmentation of the marketplace.
Three main reasons are often cited for this reluctance: the first is the human side—they think users will be reluctant to engage with a bot. The other two have more to do with bots’ expected performance: there is skepticism that bots will be able to appropriately incorporate history and context to create personalized experiences and believe they won’t be able to adequately understand human input.
The classic historic early chatbots are ELIZA (1966) and PARRY (1972). More recent notable programs include A.L.I.C.E., Jabberwacky and D.U.D.E (Agence Nationale de la Recherche and CNRS 2006). While ELIZA and PARRY were used exclusively to simulate typed conversation, many chatbots now include functional features such as games and web searching abilities. In 1984, a book called The Policeman's Beard is Half Constructed was published, allegedly written by the chatbot Racter (though the program as released would not have been capable of doing so).