Skip to main content

Event - Trigger by other Flows (Subroutine)

Overview

This event is also known as a Subroutine which is a smaller flow for a particular task that is available for repeated use in the large flow. It allows users to create general actions that are reusable in different flows under their accounts. 
Similar to Actions, subroutine also has Inputs and Outputs which must be declared in advance.

A Subroutine flow has the following properties:

  • Predetermined input data structure.
  • Optional predetermined output data structure.
  • All branches of the subroutine flow must end with Return to Origin Flow action**,** returning output data with a structure that matches the predefined one.
  • Compatible with all types of Projects.

Configuration

In order to create a Subroutine, please follow the steps below:

  1. Create a new flow with trigger: Trigger by other Flows
  2. Fill in the requirements:
    • Input: Input needs to be passed into this subroutine when triggered.
    • Output: Output of this subroutine that can be used as an input of later actions.
    • Data type:
      • String: can take both numbers and characters.
      • Number: can take numbers only.
      • Boolean: can only take the values true or false.
    • Handle ongoing call*(optional)*
      • If you tick this option, it means that this subroutine is only available for the flows which have ongoing transactions (e.g. Incoming Call to Phone Numbers,...)
  3. Configure Actions
  4. Add the Action - Return to Origin Flow
  5. Activate your Subroutine Flow
  6. Use it for other Flows as an action

Example

Requirements:

  1. If the output of the previous subroutine is English, trigger branch: Caller chose English
  2. If the output of the previous subroutine is Indonesian, trigger branch: Caller chose Indonesian

Configuration:

In order to satisfy the requirements, please follow the steps below:

1. Subroutine Flow

Step 1: Event

  1. Create a new flow with trigger: Trigger by other Flows
  2. Fill in the requirements:
    • Input: Input needs to be passed into this subroutine when triggered.
      • Leave blank
    • Output: Output of this subroutine that can be used as an input for later actions.
      • Language - String
    • Handle ongoing call
      • Tick
  3. Create

   

Step 2: Action - Gather Input

Configure Actions - Gather Input:

  • Message"Thank you for calling B3Networks Academy. Please press 1 for English, press 2 for Indonesian."
  • Expose Output

   

Step 3: Action - Split Flow

  1. Configure Actions - Split Flow:
    • Path 1: English
      • User's input digits = 1
    • Path 2: Indonesian
      • User's input digits = 2
  2. Add the Action - Return to Origin Flowfor each Path
    • Path 1:
      • Language - English
    • Path 2:
      • Language - Indonesian

   

Step 4: Deploy

  1. Deploy your Subroutine Flow
  2. Use it for other Flows as an action

   

2. Main Flow

Step 1: Event

  1. Create a new flow with trigger: Incoming Calls to Phone Numbers
  2. Add the Action -Transfer to other Flow
    • Choose the Subroutine that you created in the previous step
    • Expose output

   

Step 2: Action - Split Flow

Choose Action - Split Flow

  • Conditions:
    • Path 1:
      • Name: Caller chose English
      • Outputs of the Subroutine = English
    • Path 2:
      • Name: Caller chose Indonesian
      • Outputs of the Subroutine = Indonesian

   

Step 3: Path 1 - Caller chose English

Actions:

  1. Play a Message: "You are calling B3Networks Academy for more information, please visit our website."
  2. Hang Up

   

Step 4: Path 2 - Caller chose Indonesian

Actions:

  1. Play a Message: "Anda menghubungi B3Networks Academy untuk informasi lebih lanjut, silakan kunjungi website kami."
  2. Hang Up

   

Step 5: Deploy

Deploy the flow.