> For the complete documentation index, see [llms.txt](https://taiger.gitbook.io/taiger-converse/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://taiger.gitbook.io/taiger-converse/advanced/building-transactional-flows.md).

# Building Transactional Flows

## Introduction

Transactional Conversation Flows are interactions with the Bot that require calling one or more external web services in order to fulfil the Chat User's request.

Some examples of Transactional Flows include:

* Making an appointment booking with a Customer Support Representative
* Submitting an Insurance Claim
* Resetting an user account's password

Converse makes it straightforward to execute custom functionality that performs performs web service calls and run computation logic by providing:

* Converse Plugin SDK (Java)
* Converse Middleware, which serves as a Plugin Manager to host compatible Plugins

For details on how the Plugin Architecture works and how to build custom Plugins, please see [Converse Middleware Plugins](/taiger-converse/advanced/data-integrations.md#converse-middleware-plugins)

This guide provides instructions for building a Flow that provides available Hotels for a given city, an arrival date and a return date. Note: You will need the "Flights And Hotels" Plugin to be installed on the Converse Middleware to follow through this guide. This should come as standard with Demo/Sandbox Converse installation for testing purposes.

## Step By Step Guide

| Step Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Example                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| <p><strong>Step 1</strong></p><ul><li>Navigate to the Intent Management page</li><li>Create a new Intent called <strong>"Get Available Hotels"</strong></li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                       | ![](/files/-MJVwIqHooS3hELuq8rO)                                                                           |
| <p><strong>Step 2</strong></p><ul><li>Add a phrase to the intent and hit Enter</li><li>Then close the Phrase Panel</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | ![](/files/-MJVwIqI8pKwqOdVYNrW)                                                                           |
| <p><strong>Step 3</strong></p><p>In the first State do the following:</p><ul><li>Change State Name to "<strong>Collect City</strong>"</li><li>Add 2 Text Message components to the State and enter in the content in the screenshot on the right</li><li>Add the Data Collection block and set the <em>variable</em> field to "<strong>city"</strong></li></ul>                                                                                                                                                                                                                                         | <p><img src="/files/-MJVwIqJ492oCSIRRtzF" alt=""></p><p><img src="/files/-MJVwIqKkyplSg1S6LwP" alt=""></p> |
| <p><strong>Step 4</strong></p><ul><li>In the Graphical Editor, click on the <img src="/files/-MJVwIqLR4PmyxliBM6R" alt="">button in the under the State Node</li><li>In the Popup that appears, enter "<strong>Collect Arrival Date</strong>".</li><li>Click Save to Create the new State</li></ul>                                                                                                                                                                                                                                                                                                     | ![](/files/-MJVwIqMYKStESeA_Oxc)                                                                           |
| <p><strong>Step 5</strong></p><ul><li>In the newly created<em>"Collect Arrival Date"</em> State:</li><li>Add a Text Message Component with the text: <strong>"What's your arrival date?"</strong></li><li>Add the Data Collection block and set the <em>variable</em> field to "<strong>arrivalDate"</strong></li></ul><p>Now, follow the same process in Step 4 and create a new State named: "<strong>Collect Return Date</strong>"</p>                                                                                                                                                               | ![](/files/-MJVwIqNXDclWDm2kDMM)                                                                           |
| <p><strong>Step 6</strong></p><p>In the newly created <em>"Collect Return Date"</em> State:</p><ul><li>Add a Text Message Component with the text: <strong>"What's your return date?"</strong></li><li>Add the Data Collection block and set the <em>variable</em> field to "<strong>returnDate"</strong></li></ul><p>Now, follow the same process in Step 4 and create a new State named: "<strong>Call Service</strong>"</p>                                                                                                                                                                          | ![](/files/-MJVwIqOUx0hMJp3U8wl)                                                                           |
| <p><strong>Step 7</strong></p><p>Great! Now you have set up the Flow to collect all the required user inputs. Now, we will configure the Service call via Service Action block</p><p>In the newly created <em>"Call Service"</em> State:</p><ul><li>Add a Service Action Block and set it up like the screenshot on the right.</li><li>Note that the Reference ID of the Service Action is set to "<strong>hotelsApi</strong>". This reference ID will be used in future steps.</li></ul>                                                                                                               | ![](/files/-MJVwIqPGWAG4b58CGXJ)                                                                           |
| <p><strong>Step 8</strong></p><p>In the <em>"Call Service" State:</em></p><ul><li>Set the Text Message component's text to "<strong>Getting available hotels…</strong>" to inform the Chat User that processing is ongoing.</li></ul>                                                                                                                                                                                                                                                                                                                                                                   | ![](/files/-MJVwIqQEa8F0SG-W7NQ)                                                                           |
| <p><strong>Step 9a</strong></p><p>In the <em>"Call Service" State:</em></p><ul><li>Add a Transition that checks if an error has occurred in the Service Action</li><li>This is done by checking the <strong>error.message</strong> property of the Service Action exists.</li><li>If this condition is true, then the Transition will trigger.</li></ul>                                                                                                                                                                                                                                                | ![](/files/-MJVwIqRgDEjJf1ts2cd)                                                                           |
| <p><strong>Step 9b</strong></p><p>Now complete setting up the Transition by specifying the Destination State to go to if the Transition's Condition is true.</p><ul><li>Click on "+ Add New State" in the dropdown to create a new Destination State.</li><li>In the Popup that appears, enter the State Name as "<strong>Failure</strong>"</li><li>Click Save to create the new State.</li></ul>                                                                                                                                                                                                       | <p><img src="/files/-MJVwIqSfzaeHe-dXQH6" alt=""></p><p><img src="/files/-MJVwIqTsxhCjku8eRFf" alt=""></p> |
| <p><strong>Step 9c</strong></p><p>Verify that the Transition has been set up like the screenshot on the right.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | ![](/files/-MJVwIqU70ZXFyJrf6Pv)                                                                           |
| <p><strong>Step 10</strong></p><p>In the <em>"Call Service" State:</em></p><ul><li>Create another Transition to check if there were no results found</li><li>To do so, check if the <em>numHits</em> property in the data object is equal to <strong>0</strong>.</li><li>Note: We know there is a <em>numHits</em> data property because it is specified in the Plugin Function's Data Outputs (see Step 7)</li></ul>                                                                                                                                                                                   | ![](/files/-MJVwIqV4krbkp15Sq4A)                                                                           |
| <p><strong>Step 11</strong></p><p>In the <em>"Call Service" State:</em></p><ul><li>Scroll to the bottom of the State Editor to find the Dialog Settings panel.</li><li>Toggle <strong>OFF</strong> Ready To Reply</li><li>This tells the Dialog Engine to evaluate the Transitions and trigger the next State without waiting for a User Input.</li></ul>                                                                                                                                                                                                                                               | ![](/files/-MJVwIqWvFNXWZ91ftNo)                                                                           |
| <p><strong>Step 12</strong></p><p>Click on the "<em>Failure</em>" State in the Graphical Editor to edit it.</p><p>Set the Text Message component with the content shown on the right.</p>                                                                                                                                                                                                                                                                                                                                                                                                               | ![](/files/-MJVwIqXDZg7gpHApyCx)                                                                           |
| <p><strong>Step 13</strong></p><p>Click on the "<em>No Available Hotels</em>" State in the Graphical Editor to edit it.</p><p>Set the Text Message component with the content shown on the right.</p>                                                                                                                                                                                                                                                                                                                                                                                                   | ![](/files/-MJVwIqY87A_s2db24VF)                                                                           |
| <p><strong>Step 14</strong></p><p>Click on the "<em>Display Hotels</em>" State in the Graphical Editor to edit it.</p><p>Set the Text Message component with the content shown on the right.</p><p>Note: We can use the <em>numHits</em> property in the Text Message Component by surrounding it with a <code>%()</code></p><p>Add a Dynamic Component, and set the value with the content shown on the right.</p><p>Here, we are displaying the Message Component(s) dynamically generated by the Converse Plugin Function. In this case, it is a Carousel Component containing a list of Hotels.</p> | ![](/files/-MJVwIqZ3KKNdmj30Xwm)                                                                           |

**Step 15**

Test the flow! Scroll up to the Intent Header, and click on the ![](/files/-MJVwIq_eWLoB_tMHxV_)Quick-Test icon on the right side of the Intent Name.

![](/files/-MJVwIqadVzttH7ag3YL)![](/files/-MJVwIqbpbZLE8qu28uk)

Use the Admin Chat UI's Info Panel to view Data Collected or Data sent to/from Service Action

To open the panel, click on the "..." on the top-left side of the Admin Chat Header (as below).

![](/files/-MJVwIqcy4qpWq_BhJUF)

| ![](/files/-MJVwIqdNc0iql9on1mO) | ![](/files/-MJVwIqekfrbHLKozFRs) |
| -------------------------------- | -------------------------------- |

**Step 16**

**Activate the Intent** by clicking on the "Activate Intent" button at the top-right side of the page.

![](/files/-MJVwIqfxvd6YGMr_WqK)

The Intent Status label should now be "Active"

![](/files/-MJVwIqgK1Z5j4NJ2Ug_)

You're all done! You just successfully created a Transactional Flow using Service Action.

Using the process described in this guide, we can build complex conversational processes involving multiple Service calls, and weave dynamic data and static dialog content into a smooth conversational experience.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://taiger.gitbook.io/taiger-converse/advanced/building-transactional-flows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
