Moments
Flow elements
Functions and integrations

Functions and integrations

Functions

The elements in Flow that help you plan and direct your messages the way you want are called functions. They let you wait for events such as purchases to send a relevant message or have a failover channel in case the customer does not check the messages on the first one that you used.

Segment Audience

Split your audience based on attributes and behavior. If, for instance, you want to send different messages to people belonging to different age groups who recently checked out your web page, this is exactly what the Segment Audience element is for.

Attributes and events that you need for segmentation are selected in the element`s side panel.

Available attributes:

  • Standard - basic, predefined customer information
  • Custom - customer information that you define yourself in the People module
  • Contact Information - email address, phone number, and other channels available for contacting this customer
  • Channel Specific - showing when the customer was contacted last time
  • Computed attributes -  customer information created from computed attributes

Operators per attribute:

BOOLEANTEXTNUMBERDATE
isisisis
is notis notis notis not
 containsless thanbefore
 starts withless than or equaluntil
 ends withgreater than or equalsince
 is emptygreater thanafter
 is not emptyis emptyis empty
  is not emptyis not empty
   will be in
   will be within
   will be more than
   was
   was within
   was more than
   was today

To get an idea how attributes work, select a custom attribute "age" and operator "less or equal" inside the Segment Audience side panel.

customer attributes in cloud communication

The types of events to be combined with attributes are as follows:

  • External - actions on other platforms like websites and apps
  • People - changes in profile information
  • Channel - interaction with messages
  • Product events - information about when a person entered or exited the communication flow

Visit the People Real-Time Event article to learn more about each type and then think about how to include them in your future communication campaigns. (The Wait for an Event trigger and element are used when you want to base your communication on events only, while the Segment Audience element allows you to use both attributes and events.)

So, if you were to send a message to two different age groups (attribute) who viewed your webpage (external event), the final setup would look like this:

final-setup-age-page push messages in segmentation

Wait for an event

Use this element to perform specific actions based on events of person profiles who already entered the flow.. Example: Add the event, addToCart, to the Wait for an event element. When an end user adds an item to the cart on your website, the flow performs the actions that are specified for the add to cart happened branch in the next elements in the flow (Example: Send SMS message).

Use this element to identify how end users interact with your digital assets such as websites, how they react to your messages, and if there are any changes in their profile information.

For more information about events, refer to the People documentation.

The Wait for an event element

Events tracked through the element

You can track the following categories of events through this element:

Use cases for the element

The following are some examples of using this element.

  • In abandoned cart campaigns when you want to remind customers that the products that they selected are still in the cart
  • Offer a discount to end users who view the same item three or more times within 7 days.
  • Other advanced multi-step campaigns.

Configure the element

Follow these steps to configure the element.

  1. Define the condition by which flow audience needs to be branched.
  2. (Optional) Save the information in variables.
  3. Select the waiting time.
  4. (Optional) Include events from the entrance of the flow.
Configure the element

For more information, refer to the following sections.

Define the conditions

Define one or more conditions that trigger the flow.

In each condition, do the following.

  1. Select the event.
  2. Select the operator for the event. You can target either customers who performed the action or those who did not perform the action.
  3. Define the criteria for the event.
  4. (Optional) If the event has properties, you can add them to the condition to refine the target audience.
Select the event

Select the event. For more information about events, refer to the Events documentation in People.

Follow these guidelines.

  • To select a custom event, you must define the event, along with its properties, in People.
  • For Product events, the person entered flow and person exited flow events are available. Use the event property fields to add the following:
    • The name of the flow or flow version (communication) where the event occurred.
    • The time when the event happened and the number of occurrences.

You can search by event name and filter by event type.

Filter and search for events
Select the operator

Select which end users you want to target.

  • Happened: Targets end users who performed the action. You can set the time and number of occurrences. Example: To trigger the flow and send a communication the third time an event happens within a 7-day period, specify the time as within the last 7 days and the number of occurrences as equals 3 times.

    Select the operator for the condition
  • Not happened: Targets end users who did not perform the action. Example: An end user did not launch an App after a certain period.

Note

Do not use Not happened condition by itself. Use it only with the Happened condition. This is because while it is possible to trigger a flow when an event occurs, it is not possible to start the flow when an event does not occur.

Example: Start the flow when Event A happened AND Event B did not happen.

Define the criteria for the condition

Each event has specific fields for the criteria. Complete all the fields.

Select the criteria for the condition

You can include the names of the send elements and events from the current flow. This feature is available for active and drafted communications, but not for finished ones.

Select the send elements
Add event properties to the condition (Optional)

If the event has properties, you can add them to the condition to refine the target audience. Select Property.

Add as many properties as required.

In the example shown in the following image, itemId, which is a property in the Item viewed event, is added as a filter.

Add properties to the condition

Map event properties to flow variables (Optional)

If the event has properties, you can map them to flow variables. You can reuse these variables later in the flow.

Example: In your flow, you use the Wait for an Event element to wait for the end user to book an appointment. The event has properties such as Appointment time and Appointment name. You can save these properties as flow variables. At a later stage in the flow, you can use these variables to send the end user a confirmation message with the appointment details.

Depending on the configuration, the values of the mapped variables could change as the end user moves through the flow.

Example: You flow uses order delivery status as a variable. As the delivery event progresses to the next stage, the delivery status variable changes from Pending to Dispatched.

You can pass list attributes to flows. For more information, refer to the Pass lists in events to flows documentation.

For more information about creating and using variables, refer to the Map event properties to flow variables documentation.

Waiting

Specify how long the flow should wait for the event.

Select one of the following options.

  • For specific time: Specify the duration.
  • Indefinitely: If you select Indefinitely, the wait time is dependent on the flow schedule, which you configure in the Flow settings. If no flow element is activated for 1 year, the flow ends.
Configure waiting period

Include events from the entrance of the flow (Optional)

By default, the Wait for an event element considers events only when an end user arrives at this element in a flow.

If you want to wait for events that occured earlier in the flow, select Include events from the entrance of the flow.

This option is useful to avoid situations where an end user gets stuck in a flow waiting for an event that might have already occurred.

Example: A marketer builds a funnel to track emails by using the Wait for an event element. This element waits for 3 events - Email sent, then Email opened, and then Email Link Clicked, each with a waiting period of 2 days. The end user opens the email but the email client blocks the Email opened event for privacy. After 2 days, the end user reaches the Email clicked event. But the waiting period for this event is over. So, the end user cannot move forward in the flow. If you enable Include events from the entrance of the flow, then the past events are considered, and the end user moves forward in the flow as expected.

If all the events in the conditions already happened before the flow started, the person does not enter the flow. However, if the flow is recurrent, the person enters the flow only if these events happen again.

Next steps

Configure each of the following:

  • What happens if the event occurs during the waiting period: Add an element, such as SMS message, as the next step in the flow.
  • What happens if the event does not occur during the waiting period: Add the next element in the flow.
Configure the next steps for the Wait for event element

Wait for Change in People Profile

When you want to wait a predetermined amount of time for a change in a specific attribute of a person who entered the Flow after an event happened, opt for the element called Wait for Change in People Profile.

This is what you will need to configure:

  • The change in attribute the flow should wait for
  • How long the Flow should wait for that change
  • What happens if the change occurs during the waiting period
  • What happens if the change doesn’t occur during the waiting period
wait for change in people profile
  • This element will be helpful in more advanced automation campaigns.

Wait for a Date

NEW

To continue your communication before, on, or after a specific date/time from a person`s profile, add the Wait for a Date element.

What you need to do beforehand is add this "profile information" as a custom attribute using our People platform.

appointment-date-time-custom-attribute

There are several options available inside this element:

IS IN – use this condition to continue communication hours or days before the date/time you have set as a custom attribute inside the person profile.

For example, with “TrialExpiryDateTime is in 4 hours,” the customer will reach the next step in the flow when the current date/time is 4 hours before the one set in the TrialExpiryDateTimeattribute.

WAS – the amount of time that has passed after the set date/time had been reached. For instance, you would set “TrialExpiryDate was 1 day ago” to get the customer to the next step in the communication one day after the date set in the TrialExpiryDatecustom attribute.

IS TODAY – use it when you want the customer to get to the next step in communication on the very date set in the custom attribute (“DueDate is today”).

IS TOMORROW – the customer will reach the next step in the Flow one day before the date set in the custom attribute.

WAS YESTERDAY – the customer will reach the next step in the Flow one day after the date set in the custom attribute.

DO THIS ACTION EVERY YEAR – select this check box if you want to perform this same action every year for each person (ignores the year in the person attribute and makes it a recurring action).

due date wait for time

You can also start a communication based on a specific date or time.

Pause

This is the element that delays your communication flow for a specific amount of time. For example, you send one message from the flow and you want to wait before sending another one. What you need to do is select Pause and then select the type of pause and its duration along with a time unit – seconds, minutes, hours, days.

There are 3 types of pause you can select from:

  • Pause until a day and/or time - This will pause until the day or time milestone is hit. For example, Pause until Monday at 13:00.
  • Pause for a period of time - This is useful if you want to set a generic waiting period that will start counting after the user comes into contact with the Pause element in the Flow. Choose from seconds, minutes, hours, and days. For example, Pause for 3 days until 13:00.
  • Pause until an exact date and time - This is useful for planning user communications to remind users about an event that will happen at a known time. For example, sending a message before a holiday or appointment. Such as pause until 30th November at 13:00.
Add pause to flow

When the time specified for the pause passes, the next element (for instance, an SMS message) in the communication flow will be triggered.

The Pause element can also be used with all the Evaluate elements available in the Flow.

Update Person Profile

To update and save values for the customer standard or custom data attributes that are stored in the People module, use the Update Person Profile element.

Select Update Person Profile and then, in the right side panel, select the attribute you want to update and how you want the attribute to be updated. You can choose to update the person profile with a value, set it to empty (i.e. erase), or apply a formula to the attribute.

  • If you select with value, then the user can add a static value, or select a different attribute from People or a variable using the curly brackets.
  • If you select with formula, the expression editor will open you can define your formula using expression language.
  • If you set to empty, then the data in the person profile attribute will be set to empty.

Any data that customers provide related to the plan will be saved on the People platform to help you in future communication campaigns.

moments-flow-update-person-profile

Add or Remove Tag

If you want to mark customers based on their actions, use tags so that they can be included in any future communication based on these tags.

Flow supports two tag related elements:

  1. Add tag
  2. Remove tag
tags-in-flow

To get a better idea about how to apply this feature, check out how tags can be used for feedback.

Add or Remove from Do Not Contact List

When end users want to stop receiving communications from your business, they can opt out or unsubscribe. Use the Add to Do not contact list element to unsubscribe end users from communications sent from your Infobip account. These end users are added to the Do not contact list in People. A contact that is in this list does not receive any communication from the selected senders and channels.

When these end users opt back in, use the Remove from Do not contact list element to remove the contact from the Do not contact list.

Design the flow

Design your flow such that opt-ins or opt-outs are compliant with your local laws and regulations as well as with your corporate policy. Example: Track inbound keywords, such as Stop, to unsubscribe a contact.

Example

Use the Inbound message trigger or the Evaluate inbound message element to identify whether the end user's message contains the keyword to opt in or opt out.

Then, use the Add to Do not contact list and Remove from Do not contact list elements in your flow to add or remove these end users from the Do not contact list.

Add or remove from Do not contact list

Add to Do not contact list

Use the Add to Do not contact list element to add end users to the Do not contact list.

You can add the following to the list.

  • Channel. Messages are not sent on the selected channel. You can continue to send messages on other channels. Example: An end user wants to receive emails about offers but not SMS messages. In this case, add the SMS channel.

    The channel that you add does not necessarily need to be the same as the channel on which the end user contacted you.

  • One or more senders for the selected channel. Messages are not sent from the selected senders. You can continue to send messages from other senders. Example: An end user wants to receive emails about offers but not your newsletter. In this case, add only the sender for newsletters.

When an end user comes to this element in the flow, the contact information from the end user's profile is added to the Do not contact list for the specified channel and senders.

Design the flow

To add an end user to the Do not contact list, do the following:

  1. Add the Add to Do not contact list element to your flow.

  2. In the element, select Add channel.

    Add channel
  3. Select the channel that you want to add to the Do not contact list.

    Select the channel
  4. For the selected channel, select the senders that you want to add to the Do not contact list.

    Select the sender
  5. Define the next steps. Example: Send a message to the end user saying that they have been successfully unsubscribed.

    Configure the next steps
Important

If you use the Add to Do not contact list element to manage opt outs or manage end users who want to stop receiving messages, make sure that the flow does not expire. Otherwise, end users who opted out will receive messages.

To set the flow to not expire, in the Flow settings > Scheduling tab, make sure that Run this flow for 1 year is enabled.

Remove from do not contact list

Use the Remove from Do not contact list element to remove end users from the Do not contact list.

You can remove the following from the list.

  • Channel. Messages can now be sent on the channel that you remove. Example: An end user wants to receive emails about offers but not SMS messages. In this case, remove the Email channel.

    The channel that you remove does not necessarily need to be the same as the channel on which the end user contacted you.

  • One or more senders for the selected channels. Messages can now be sent from the senders that you remove. Example: An end user wants to receive emails about offers but not your newsletter. In this case, remove only the sender for offers.

When an end user comes to this element in the flow, the contact information from the end user's profile is removed from the Do not contact list for the specified channel and senders.

Design the flow

To remove an end user from the Do not contact list, do the following:

  1. Add the Remove from do not contact list element to your flow.

  2. In the element, select Add channel.

    Add channel
  3. Select the channel that you want to remove from the Do not contact list.

    Select the channels
  4. For the selected channel, select the senders that you want to remove from the Do not contact list.

    Select the senders
  5. Define the next steps. Example: Send a message to the end user saying that they have been successfully subscribed.

    Define the next steps
Important

If you use the Remove from Do not contact list element to manage opt ins or manage end users who want to receive messages, make sure that the flow does not expire. Otherwise, end users who opted in will not receive messages.

To set the flow to not expire, in the Flow settings > Scheduling tab, make sure that Run this flow for 1 year is enabled.

Split Audience

Divide your audiences and get more precise metrics about how they react to your content. The Split Audience element is especially useful when you want to do the following:

•    Perform simple experiments such as testing two versions of the same Email message as shown in the image below.
•    Create more advanced experiments that involve testing which channel (Email, SMS, Push, etc.) works best.

Testing Flow in Moments

Notify Internal Recipients

Sometimes it is important to send an email or SMS notification to internal business units as part of a flow. Perhaps you would like to notify store managers, staff, or a physical store when a customer has started the process of returning an item. Maybe you would like to send a confirmation email to a physical store with an action reminder or even notify an employee that they do not have the authorization to do a particular operation.  All this can be done with the Notify Internal Recipients element.

This element is different from the send Email or SMS channels because here you set the exact recipient of the message and choose the channel in the element rather than defining it in the entry point when the flow begins.

When you add this element to your flow you choose if you would like to send SMS or Email and then compose your message in the message editor. You can define your recipient through manual input of the phone number / email address.

You can define your recipient through manual input of the phone number,  email address or using Flow Variables if you have dynamic recipients. For example, if the phone number of the store manager is different depending on what store the customer visits.

NOTE

Each variable can only contain one destination phone number or email address

flow-notify-internal-recipients

Track Performance

If you would like to track the performance of non-customer related communications that are generated using the Notify Internal Recipients element you can do so by hovering over the element in a flow. On hover you will be able to track total engagements for this element. Other performance metrics are coming soon.

Update Variable

Use the Update variable function to update the value of any Flow variables you have predefined. If you have multiple variables defined in your flow you can choose to update only a single variable or multiple variables at the same time. This is particularly useful if you need your session information like order status to be dynamic and adapt as the flow progresses i.e. from ordered to dispatched or canceled.

You can even make your variables go even further by using them with expression language. To set an expression inside the Update variable element, click the pencil icon next to the variable value field. See expression language to learn more.

NOTE

Update Variable functionality is not available for use with IVR Flows (Voice call sessions).

moments-flow-update-variable

Integrations

Use integration elements in Flow to connect to external platforms.

Start a Conversation

This element is helpful if you want to direct customers to live agents or for similar scenarios. In the side panel, select a tag (create it on the spot or use the existing one) that tells the agent what the conversation will be about. For example, a data verification tag would mean that the agent will need to verify the customer`s information.

Add to Flow

The Add to Flow element should be used when you would like to send your user to a different 'secondary' flow. This is a very powerful element that contributes to the creation of modular flows which can help you split very complex flows into smaller, more manageable flows.  To learn more, we've captured all the benefits of modular flows, when to use them, and also provided some examples in the Benefits of Modular Flows section of docs.

NOTE

There is a limit of 100 elements per Flow so if your Flow has more than this number will not be able to add more elements and should split your Flows using Modular Flows.

The Add to Flow element can be used at any position in a flow. If you use the Add to Flow element just before the exit element the user will end the current flow and be moved to another flow that you define. Whereas if you add the element at another step in the flow (that isn't the last step) then the user will continue the journey in both flows.

IMPORTANT

Before you use the Add to Flow element make sure that you have created all the flows that you would like to connect and that they have the appropriate Existing Flow entry point. Then when you add the element to your flow you will then be able to choose from all flows that are available to be used.

Variables and variable values can also be passed from your flow to a chosen flow using the Add to Flow element. By doing so you can ensure that as a user passes between flows any corresponding placeholder data will be passed too.

As good practice it is advisable to also include a failover branch at 'In all other cases' in the Add to Flow element. This way if it is not possible for the user to be transferred to the secondary flow (for instance, if the secondary flow is set to draft or has been canceled) then the user will still be able to continue on their journey.

Secondary Flow Participants

By default, any person passing through the Add to Flow element will also enter the secondary flow. They will participate in both primary and secondary flows until they exit from the flow.

You can also configure the element to so that another user can pass through the flow based on their contact information. To do so toggle to add another participant when you are adding your Add to Flow element. You can then define the primary contact information (phone number or email) to use for this participant that matches a flow variable, or a standard/custom attribute of the person who is currently in the Flow

If the participant exists in People then the flow will be started for the person as identified by their contact information and any mentioned attributes in the flow will be updated. If the person does not exist in People then a person profile will be created for them and an attribute value will be assigned to the profile.

A good use case for using the secondary flow participant functionality could be for a referral program to get the client to share the contact information of friends or family to receive benefits. As an example, you would ask the client  to share the email of a friend over messenger. Then you would parse the email from the inbound message and saving the value into a variable.

You can then use the Add to Flow element to start a flow for another person with contact information and email extracted from the variable. This is a great way to enhance your reach, just always ensure that there is opt-in confirmation from the friend or family member in order to meet data requirements for your region.

Call API

Call API will allow interaction between an external system, such as a website or a CRM, and Flow in real time. This is a step in the Flow builder which lets you to request information from your third-party system or database and save responses to flow variables to personalize and steer communication in the flow depending on that data.

In the side panel of this Flow element, you can set up the following: Request, Response, and Scheduling.

Request

The Call API request has the following parameters that should be set:

HTTP(S) URL – URL of the third-party system with which the flow wants to communicate. Be sure to specify the correct URL to the service that will receive or send the data that flow requires.

METHOD – defines the method that will be used to call API. These are POST, GET, PUT, and DELETE. Each of these is used for different use cases. Responses can be saved to variables (explained below):

POST– API that is called should do something with the provided request. Often POST is used to create a new entity or update an existing one on the third-party side.

GET– used to retrieve information from the called API.

PUT– used to store something on the third-party side.

DELETE– used to remove something on the third-party side.

PATCH– used to apply a partial modification to something.

HEADER – Data that will be sent along with the URL. Data can be entered in KEY-VALUE formats, such as username: user1 and password.

BODY – Data that will be sent along with the URL.  Data can be entered in KEY-VALUE format, such as name: Tom, or external user ID or in JSON format, for example {'name': 'Tom'}. Currently, two types of BODY are supported: JSON and URL Encoded Form. Default data entered by the user will be sent as JSON. To send it as URL Encoded Form data, you have to add a header with the name. Content-type and value: application/x-www-form-urlencoded

To authorize every call, you'll probably need to provide a username and a password in HEADER, and in BODY you should pass the EXTERNAL ID for each user stored in the People module so a third-party system knows which end user's data should be stored or fetched.

Headers are empty by default. Most of the web frameworks and services require a content-type header in the request to process it properly. For example, if you are trying to send a JSON, you should add a header with the name. Content type and value: application/json

call api request filled in

Response

These are the parameters that need to be set for the Response:

WAIT UNTIL RESPONSE IS RECEIVED – select this check box and the next step in the Flow will be activated only after the response has been received.

RESPONSE HEADER VARIABLE -  allows the server to pass additional information about the response which cannot be placed in the Status-Line. The header fields provide information about the server and further access to the resource identified by the Request-URI.

RESPONSE BODY VARIABLE – the called API data received from the external system can be saved to a flow variable and used in the rest of the flow. To save data to the variables you will need to do the following: Enter a JSON path expression such as $ loyalty_points. A path must point to a single value; if the value is an array or object, it will be considered an error and NULL will be set to this variable.

call api response flow

Handle Error Codes

The flow can be branched based on whether the response has been received or not, and based on the error code.  Use Conditions to specify how you want to treat the response codes.

The code types:

**On success –***Exit: “In case of 2XX error”.*Requires no action and it is being handled through the prior conditions.
On error -Exit: "In case of any error."
All client error codes -Exit: "In case of 4XX error."
Server error codes -Exit: “In case of 5XX error.”

error codes in call api

Scheduling

The options shown in this section will help streamline the data exchange. To start scheduling, enable the following features in the Scheduling tab:

Delivery Time window

•    Select the start time for data delivery
•    Select end time for data delivery
•    Select the time zone

Define Message Sending Speed

•    Enter the number of messages you want delivered within a specific time period
•    Select per minute, per hour, or per day

call-api-scheduling-new

Custom Exchange elements

Create custom elements in Exchange and use them in your flow to add new functionality to the flow.

Example: Create a custom element to integrate your flow with third-party systems. Call third-party APIs and personalize the flow journey based on the response.

Configure the element once and reuse it across multiple communications.

The following are examples of use cases.

  • Integrate your flow with a webinar platform to automatically register the end user for meetings.
  • Connect your flow with a GenAI platform to generate personalized content within the flow.
  • Connect your flow to your CRM to transfer data or add profiles to specific groups.

For more information, refer to the Developing with Infobip documentation.

Need assistance

Explore Infobip tutorials

Encountering issues

Contact our support

What's new? Check out

Release notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Service Terms & ConditionsPrivacy policyTerms of use