Skip to main content
In this tutorial, you’ll learn how to create a simple xApp from scratch. You’ll create an agent that asks users whether they’re new or existing customers. If the user already exists, the agent directs them to an xApp that collects their login data. If the user is new, the agent guides them to an xApp that collects registration information.

Configure a basic xApp flow

  1. Create a new flow in Cognigy and name it Basic xApp Tutorial.
  2. In the flow editor, add an xApp: Init Session node to initialize the xApp session.
  3. Below the xApp: Init Session node, add an xApp: Show Adaptive Card node to update the initialized xApp session with a new adaptive card-based xApp page.
  4. In the AdaptiveCard Definition field, paste the following JSON:
  5. Click Save Node.
  6. Below the xApp: Show Adaptive Card node, add a Question node. Use this node to prompt the user, via the primary channel, to provide data through the xApp. The node then waits for the xApp’s submit input before the flow continues.
  7. In Question Type, select xApp so that the node accepts only data from the xApp as a valid answer.
  8. Select the Text with Buttons output type to display a button with the xApp URL.
  9. Configure the prompt message to instruct users to enter their email using the xApp. In the Text field, paste the following text:
  10. Click Add Button. Fill in the following fields:
    • Button Title — enter Open xApp.
    • Select Button Type — select URL from the list.
    • URL — click token and select the xApp Session URL token.
    • URL Target — select Open URL in a new tab.
  11. Click Save.
  12. If a user types anything in the chat, inform them that they need to use the xApp URL to enter their email. To do that, go to the Reprompt Options section and paste the following reprompt message:
  13. Click Save Node.
  14. Below the Question node, add an If node to your flow and set the condition to:
    This lets you update the xApp session with a different xApp based on the user’s selection.
  15. Click Save Node.
  16. In the Then branch, add an xApp: Show Adaptive Card node to update the initialized xApp session with a new adaptive card-based xApp page.
  17. In the AdaptiveCard Definition field, paste the following JSON:
    This asks the user to provide their name, date of birth, and email address.
  18. Click Save Node.
  19. Repeat the same node for the Else branch and paste the following JSON:
    This asks the user to log in via their username and password.
  20. Click Save Node.
  21. Below the Then and Else branches, add a Wait for Input node. This node waits for the xApp input.
  22. Click Save Node.
  23. At the end, add a Say node.
  24. In the Text field, paste the following text:
  25. Click Save Node.
After you build your first xApp, test it via the Interaction Panel.

Test the app via the interaction panel

  1. Open the Interaction Panel and enter a message like Hi to trigger the flow.
  2. In the Interaction Panel, click Open xApp to access the xApp session. You can also check the Info tab to see the xApp’s URL in the input.apps.url input object.
Interaction Panel with the Open xApp button to access the xApp session
  1. Open the URL in a new tab to view the xApp with the adaptive card and select your customer status.
xApp page displaying an adaptive card for selecting customer status
  1. When you select New Customer and submit the action, a new page loads.
xApp showing the new page loaded after selecting New Customer
  1. You can submit data in the entry fields and observe the behavior, for example, Dan Schneider, 01.01.1999, and dan@cognigy.com.
  2. Check the input result via the Interaction Panel.
Interaction Panel showing the input result after xApp form submission
You can download a Cognigy package with the xApp flow example.

More information

Last modified on November 11, 2026