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:

  1. The target entity is selected. (Target Entity)

  2. When the entity is loaded, the Flow is qualified. (Qualified) The Flow component โ€œActivityEmailSenderโ€ is called first.

  3. User enters information of the relevant fields through Field Mapping and a record is created in the target entity. (Activity)

  4. The customer anniversary congratulations email is sent. (Event)

  5. When the first email is sent, a delay is called. For this exercise, the delay is configured to be two (2) minutes. (Delay)

  6. The time has elapsed. (Event)

  7. 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:

    1. Enter the Flow name as โ€œCustomerActivityCreatedโ€. The name indicates that when this Flow is triggered, a customer activity is created.

    2. Optionally add a description for the Flow.

    3. 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โ€.

    4. 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:

    1. 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).

    2. From: Enter constant text for Source as โ€œ[email protected]โ€.

    3. Subject: Enter constant text for Source as โ€œHappy Langstack Anniversary!โ€

    4. EmailBody: Enter constant text for Source as โ€œHi Customer! Congratulations on your anniversary!โ€

    5. ActivityType: Enter constant text for Source as โ€œAnniversary Emailโ€.

    6. AssignedTo: Enter constant text for Source as โ€œSales Teamโ€.

    7. Priority: Enter constant text for Source as โ€œ3โ€.

    8. Description: Enter constant text for Source as โ€œAnniversary Congratulationsโ€.

    9. 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.

In case an event is disabled, it will not be displayed in the Flow.

  • 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:

    1. Select Delay Type as โ€œTime Durationโ€. It displays two (2) more fields of โ€œDelay in hoursโ€ and โ€œDelay in minutesโ€.

    2. Keep the โ€œDelay in hoursโ€ value as โ€œ0โ€ (zero).

    3. 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.

    1. Elapsed: This event signifies that the configured time has elapsed.

    2. 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:

    1. 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).

    2. From: Enter constant text for Source as โ€œ[email protected]โ€.

    3. Subject: Enter constant text for Source as โ€œPremium Account activated for 30 days.โ€

    4. EmailBody: Enter constant text for Source as โ€œHi Customer, your account is on premium for the next 30 days.โ€

    5. ActivityType: Enter constant text for Source as โ€œPremium trial emailโ€.

    6. AssignedTo: Enter constant text for Source as โ€œSales Teamโ€.

    7. Priority: Enter constant text for Source as โ€œ3โ€ (without quotes).

    8. Description: Enter constant text for Source as โ€œThe customer is offered a premium trial for 30 days as a gift for Anniversaryโ€.

    9. 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