Step 2: Create the Flow
The second step is to configure a Flow, which will execute the Flow component twice. This Flow will be designed in the following sequence:

The target entity is selected. (Target Entity)
When the entity is loaded, the Flow is qualified. (Qualified) The Flow component โActivityEmailSenderโ is called first.
User enters information of the relevant fields through Field Mapping and a record is created in the target entity. (Activity)
The customer anniversary congratulations email is sent. (Event)
When the first email is sent, a delay is called. For this exercise, the delay is configured to be two (2) minutes. (Delay)
The time has elapsed. (Event)
The Flow component โActivityEmailSenderโ is called the second time. User enters information of the relevant fields through Field Mapping and a record is created in the target entity. (Activity)
To create the Flow, proceed with the following steps:
To go to the Flows section, click โFlowโ under the โBackground processesโ menu on the left side panel.

To create a new Flow, click the [+ Flow] button.

A new Flow is displayed with the following icons: โTarget Entityโ โQualifiedโ This indicates that the creation of Flow is qualified or enabled only when the Target Entity is present.

To define the Flow, add the following details:
Enter the Flow name as โCustomerActivityCreatedโ. The name indicates that when this Flow is triggered, a customer activity is created.
Optionally add a description for the Flow.
To define the target entity, select the entity โUserName_Acc_Activitiesโ from the drop down menu. This defines that the customer activity record will be created in the entity โUserName_Acc_Activitiesโ.
To define an entity to store the logs for this Flow, select or add โFlow Progression Entityโ. This entity contains the logs for the execution of this Flow. The user can select an existing entity or create one by clicking the [+] button. Label it as โUserName_flowApp_progressionโ.

The Flow is disabled by default. When the Flow is being configured or updated, it needs to stay disabled by clicking the toggle button. It can be enabled after completing the Flow configuration before executing the Flow.

To add the Flow component โActivityEmailSenderโ, click โComponentsโ on the left side panel. It lists the user defined Flow components.

The Flow component โActivityEmailSenderโ is displayed with the icon configured in Step 1 of this exercise.

To place the Flow component as the first activity to be placed in the Flow after Qualified, click on the โActivityEmailSenderโ Flow component and drag it on to the โQualifiedโ icon.

The โActivityEmailSenderโ Flow component automatically gets placed to the right side of the โQualifiedโ icon connected with a line.

To define the Mapped Fields and view the Events for the Flow component, click on โActivityEmailSenderโ Flow component. A dialogue box displays with the General tab selected by default. Click on the โField Mappingโ tab.

In this section, the user can configure the Mapping Fields created in Step 1 (Flow component>Details tab). The values entered or selected in this field will be stored as the values of the entity field in the anniversary email record.
To add a new field, click the [Add Field] button.

The first Mapped Field displays with the name as โCustomerIDโ and data type as String (as defined in Step 1 Details>Field Mapping section).

To add all the Mapped Fields of the Flow component, click the [Add Field] button nine (9) times (for the nine mapped fields). Each time the [Add Field] button is clicked, the Mapped Fields will appear in the same order as the Mapped Fields defined in the Flow component>Details>Field Mapping section. When all the fields are added, the [Add Field] button gets inactivated.

To enter the details of the email record, define the sources (or constant text) for each field. The values added in these fields will be updated as the first record in the target entity. To define the sources in the Mapped Fields for this first activity (Flow component in the Flow), define the Mapped Fields as follows:
CustomerID: Select Source as variables>sourceEntity>Customer_ID. It is displayed as โsourceEntity.Customer_IDโ. This mapped field retrieves the value in the Customer_ID field from the โUserName_Acc_Activitiesโ entity (source).
From: Enter constant text for Source as โ[email protected]โ.
Subject: Enter constant text for Source as โHappy Langstack Anniversary!โ
EmailBody: Enter constant text for Source as โHi Customer! Congratulations on your anniversary!โ
ActivityType: Enter constant text for Source as โAnniversary Emailโ.
AssignedTo: Enter constant text for Source as โSales Teamโ.
Priority: Enter constant text for Source as โ3โ.
Description: Enter constant text for Source as โAnniversary Congratulationsโ.
EmailType: Enter constant text for Source as โAnniversary Emailโ.

To view and enable/disable events for this Flow component, select the โEventsโ tab. The eight (8) events defined in Step 1: Details>Events section are displayed and enabled. Users can disable any event. In this exercise, all events are enabled.

To save the settings for the Flow component, click the [Save] button.

To view the events of the Flow component โActivityEmailSenderโ in the Flow, click on the Flow component. The enabled events configured in the Details>Events section will be displayed on the right side connected to this Flow component. These are the events that can be triggered for this Flow component.
Based on the event, another Flow component can be triggered. At this point, define a Native Flow component โDelayโ to be triggered after the event โSentโ. (to give the 2 minutes delay before configuration of the second email record)

To define the Flow component โDelayโ , click โNative Componentsโ on the left side panel. โNative Componentsโ are predefined Flow components in which additional Events cannot be added.

To place the Native Flow component โDelayโ in the Flow, select it. Drag the โDelayโ Flow component and place it on the event โSentโ.

The โDelayโ Flow component is placed to the right side of the event โSentโ connected with a line. This indicates that the Delay will be called after the first email is sent.

To define the settings for the delay after the first email is sent, click โDelayโ Flow component . The โDelayโ Flow component configuration box will be displayed with the General tab selected by default. In the Delay settings, configure the time for delay as follows:
Select Delay Type as โTime Durationโ. It displays two (2) more fields of โDelay in hoursโ and โDelay in minutesโ.
Keep the โDelay in hoursโ value as โ0โ (zero).
Enter the โDelay in minutesโ value as โ2โ (two) to keep the delay as two (2) minutes.

To view the events for this Flow component and enable or disable them, select the โEventsโ tab. This Native Flow component has two (2) predefined events.
Elapsed: This event signifies that the configured time has elapsed.
Error: This event signifies that there is an error in execution of this Flow component. To save the settings for the Delay Flow component, click the [Save] button.

To display the events for the Delay Flow component in the Flow, click once on the โDelayโ Flow component. Both of its events will be displayed connected to the โDelayโ Flow component. At this point, the next Flow component to be placed will be after โElapsed.โ

To add the โActivityEmailSenderโ Flow component onto the event โElapsedโ, go to โComponentsโ. Select the Flow component and drag it onto the Event โElapsedโ.

The โActivityEmailSenderโ Flow component will be placed on the right side of the โElapsedโ entity connected with a line. This indicates that this activity will be called after the delay has elapsed.

To define the settings for the second โActivityEmailSenderโ Flow component in the Flow, select the โField Mappingโ tab. Enter the values to create the second email record after the anniversary congratulations email.

To add the Mapping Fields defined in Step 1 (Flow component>Details tab), click the [Add Field] button.

When the [Add Field] button is clicked, the first added Mapped Field will automatically have the CustomerID name and string data type.

To add all the Mapped Fields, click the [Add Field] button nine (9) times (for the nine mapped fields).
Each time the [Add Field] button is clicked, the Mapped Fields will appear in the same order as the Mapped Fields defined in the Flow component Details>Field Mapping section. When all the Mapped Fields are added, the [Add Field] button gets inactivated.

To define the values for these added Mapped Fields, select the sources or add constant text for each field. The values added in these fields will be updated as the second record in the target entity for this customer. To define the Flow component the second time (as the second activity in the Flow), add the values in the Mapped Fields as follows:
CustomerID: Select Source as variables>sourceEntity>Customer_ID. It is displayed as โsourceEntity.Customer_IDโ. This mapped field retrieves the โCustomer_IDโ from the โUserName_Acc_Activitiesโ entity (source).
From: Enter constant text for Source as โ[email protected]โ.
Subject: Enter constant text for Source as โPremium Account activated for 30 days.โ
EmailBody: Enter constant text for Source as โHi Customer, your account is on premium for the next 30 days.โ
ActivityType: Enter constant text for Source as โPremium trial emailโ.
AssignedTo: Enter constant text for Source as โSales Teamโ.
Priority: Enter constant text for Source as โ3โ (without quotes).
Description: Enter constant text for Source as โThe customer is offered a premium trial for 30 days as a gift for Anniversaryโ.
EmailType: Enter constant text for Source as โMarketingโ.

To save the settings, click the [Save] button.

The Flow โCustomerActivityCreatedโ is completed.
To save the Flow, click the [Save] button.

To enable the Flow, click the [Disabled] button to change the status to โEnabledโ.

Last updated
