In-Flow Data Exchange

When creating a Flow, by default it does not use an endpoint. Connecting your Flow to an endpoint allows data to be exchanged between the customer’s device and your business endpoint when a user interacts with the Flow. This allows you to deliver conditional logic within and between screens, unlocking personalisation and branching flows.

When to Add an Endpoint to Your Flow

You will need to add an endpoint to your Flow if:

  • You want to deliver conditional logic within a screen. For example, if you are building an appointment booking Flow, and will have a user select a date of an appointment, you may want to call your endpoint to retrieve the appointment slots available for this date. You then can populate a dropdown component with these slots.

  • You want to deliver conditional logic between screens. For example, if you are building an authentication Flow, you will first ask a user to provide a username and password on your first screen. When the user tries to navigate to the second screen, your endpoint will receive the data they have entered. Your endpoint can then respond to control whether the user has successfully authenticated and can proceed to the next screen.

You need to add an endpoint URI to your Flow if you need to retrieve dynamic data from your business endpoint. You should only exchange data between your endpoint and Flow when required, as any data exchange action can result in latency for the user.

The endpoint can be used in any of the following cases:

  • Initiation: When the user clicks the CTA button to open the Flow, an INIT request can be sent to the endpoint. The endpoint can then return the first screen and the input data.
  • Navigation: For any navigation between two screens, you could use the data_exchange action to call the endpoint. The endpoint will then return the next screen and its input data.
  • Completion: The endpoint can dynamically decide when to complete the Flow by responding with a Final Response Payload.
  • Back navigation: When the user clicks on the BACK button, by default the cached data will be used to display the previous screen. This behavior can be customised by setting the refresh_on_back property to true in the JSON. Then, a BACK request will be sent to the endpoint. The endpoint can then return the previous screen and its input data.
  • Selection: For some components, you could set an on-select-action which uses the endpoint to customize the selection behavior.

Learn more about connecting your Flow to your Endpoint