Invoking a callable flow from another flow in App Connect Enterprise as a Service

In this scenario, one flow that is running in App Connect Enterprise as a Service invokes (calls) another flow that is running in App Connect Enterprise as a Service.

About this task

You might use this scenario if your callable flow completes some processing that you want to share across multiple flows. Each of those flows can call the callable flow. The following instructions describe how to develop and deploy your callable flow, then create a flow that invokes the callable flow.
The diagram shows two flows in App Connect Enterprise as a Service. Flow 1 contains a Callable flow Invoke node, which calls a Callable flow Input node in flow 2. At the end of flow 2, a Callable flow Reply node returns data to the Callable flow Invoke node in flow 1.

Developing a callable flow

Procedure

To develop a callable flow in App Connect Enterprise as a Service, complete the following steps.

  1. On the App Connect Designer home page, click Create an event-driven flow or on the Designer dashboard, click New, then Event-driven flow.
  2. Enter a name for the flow.
  3. On the Applications tab, expand Callable flow and click Input.
    A flow is created that begins with a Callable flow Input node and ends with a Callable flow Reply node.
  4. Click the plus (+) icon between the nodes to add one or more actions or toolbox nodes to your flow.
  5. Configure the action nodes in your flow.
    For more information, see Configuring actions.
  6. Optional: You can use sample data to test the mappings or actions in your flow.
    For more information, see Testing flows during development.
  7. Click the Callable flow Reply node and use the LocalEnvironment.Variables and Message.JSON.Data fields to specify properties and data to return to the invoking flow.
    The Reply node returns data to the Invoke node of the invoking flow. Subsequent nodes in the invoking flow can then use the data that the callable flow returns. You can enter your own values or map data from the preceding nodes in the flow. The following example shows that two properties, FileName and Directory, are added and configured as local environment variables. These properties specify the directory and file name for the invoking flow to write to. The message tree that is sent to the invoking flow includes data that is mapped from the event that triggered the flow in App Connect Enterprise as a Service.
    Screenshot shows two LocalEnvironment.Variables properties: FileName is set to the name of a .txt file, and Directory is set to a directory on the C: drive. Three properties are configured for Message.JSON.Data: FirstName, LastName, and Email properties are mapped to the First name, Last name, and Email fields from the event that triggered the flow.
    • To define a property, click Add property, enter a name for the property, and select the appropriate data type for the value.
    • To add values for the properties, click Edit mappings, then type in a value or select a field from a previous node in the flow.
    • Alternatively, to specify a value in JSON format, click Map to object, then enter a JSON expression. The following example shows a simple JSON object message with one name-value pair:
      {"Message":"Hello World"}
      To add fields to your JSON expression that map data from previous nodes in the flow, click Insert a mapping The icon that represents Insert a mapping..

What to do next

You can test the behavior of your flow before you deploy it. Depending on your plan, you can either test with sample or real data. For more information, see Testing flows during development.

When your callable flow is complete, deploy it by following the appropriate instructions for your plan.

Deploying a callable flow (flow runs plan)

Procedure

If you're on the flow runs plan, deploy the callable flow in the following way.

  1. Go to the Manage Icon that represents the Manage page tab and click Deploy.
  2. Select the callable flow, then click Next.
  3. Check the summary of the flow, then click Deploy.
    A tile is added to the Manage page for your flow and is marked as Inactive.
  4. Open the tile menu Icon that represents the menu on a flow tile and click Activate.
    The status on the tile changes to Active and the deployed callable flow is ready to be called.

What to do next

Develop a flow to invoke the callable flow.

Deploying a callable flow (VPC hours plan)

Before you begin

Callable flows use a private network connection to communicate with each other. Therefore, when you deploy your callable flow, you must configure it to use a private network connection. You can apply the default private network connection configuration (default-switch-server-privatenetworkagent) when you create the integration runtime or you can create your own private network connection before you deploy the flow. To create a private network connection, expand Connect Icon that represents the Connect category in the navigation pane, click Private networks, then click Create.

Procedure

If you're on the VPC hours plan, deploy the callable flow in the following way.

  1. Export the flow from your Designer instance as a BAR file.
    (On the Designer dashboard Icon that represents the Designer dashboard, open the menu on the flow's tile, click Export, and select Runtime flow asset (BAR).)
  2. Switch to your Dashboard instance and click Deploy integrations.
  3. On the Size tab, select the appropriate size of integration runtime for your flow, then click Next.
  4. On the Integrations tab, upload the BAR file that contains your callable flow, then click Next.
  5. On the Configuration tab, select a Private network connection configuration to apply to the integration.

    The invoking and callable flows use the private network connection to communicate with each other. You can select the default private network connection configuration default-switch-server-privatenetworkagent or you can select one that you created yourself.

  6. Click Next.
  7. Enter a name for the integration runtime, select the version, and set any other properties that are appropriate. For more information, see Deploying integrations on the VPC plan.
  8. Click Create.
    The integration runtime is initially shown in pending status. Refresh the browser to update the status. When the integration runtime is ready, the callable flow is deployed and is ready to be called.

What to do next

Develop a flow to invoke the callable flow.

Developing an invoking flow

Procedure

To create a flow in App Connect Enterprise as a Service that can invoke the callable flow, complete the following steps.

  1. On the App Connect Designer home page, click Create an event-driven flow or on the Designer dashboard, click New then Event-driven flow.
  2. Enter a name for your flow.
  3. Choose an event to trigger your flow, either from the Applications tab or from the Toolbox.
  4. Click the plus (+) icon after the event, then on the Applications & APIs tab, expand Callable flow and click Invoke.
  5. In Application, select the name of the callable flow.
    This field contains the names of deployed flows that contain a Callable flow Input node. If you're on the VPC hours plan, the list also contains callable flows that are running in Designer. If you stop a running flow in Designer, the flow name is removed from the application list. Similarly, if you undeploy (or deactivate) the callable flow, it is removed from the list.
  6. In Endpoint, select default.
  7. Use the LocalEnvironment.Variables and Message.JSON.Data fields to specify properties and data to send to the callable flow.
    You can use the LocalEnvironment.Variables and Message.JSON.Data fields to provide data that can be used by nodes in the callable flow. You can enter your own values or write data from the trigger event to the local environment and message trees that are sent to the callable flow. The following example shows that two properties, FileName and Directory, are configured as local environment variables. These properties specify the directory and file name for the callable flow to write to. The message tree that is sent to the callable flow includes data that is mapped from the event that triggered the invoking flow.
    Screenshot shows two LocalEnvironment.Variables properties: FileName is set to the name of a .txt file, and Directory is set to a directory on the C: drive. Three properties are configured for Message.JSON.Data: FirstName, LastName, and Email properties are mapped to the First name, Last name, and Email fields from the event that triggered the flow.
    • To define a property, click Add property, enter a name for the property, and select the appropriate data type for the value.
    • To add values for the properties, click Edit mappings, then type in a value or select a field from a previous node in the flow.
    • Alternatively, to specify a value in JSON format, click Map to object, then enter a JSON expression. The following example shows a simple JSON object message with one name-value pair:
      {"Message":"Hello World"}
      To add fields to your JSON expression that map data from previous nodes in the flow, click Insert a mapping The icon that represents Insert a mapping..
  8. Add more actions or toolbox nodes to your flow after the Callable flow Invoke node to process the data that the callable flow returns.
    You can use the data that the callable flow returns in other applications by mapping the data. For more information, see Configuring actions.

What to do next

Deploy the invoking flow.

Deploying an invoking flow

Procedure

Deploy the flow that contains the Callable flow Invoke node by following the instructions for your plan and preferred method.
Deploying the flow on the flow runs plan
  1. Go to the Manage Icon that represents the Manage page tab and click Deploy.
  2. Select the flow that contains the Invoke node, then click Next.
  3. Check the summary of the flow, then click Deploy.

    A tile is added to the Manage page for your flow and is marked as Inactive.

  4. Open the tile menu Icon that represents the menu on a flow tile and click Activate.

    The status on the tile changes to Active and the deployed flow is ready to be triggered.

Deploying the flow from the Dashboard instance on the VPC hours plan
  1. Export the flow from your Designer instance as a BAR file.

    (On the Designer dashboard Icon that represents the Designer dashboard, open the menu on the flow's tile, click Export, and select Runtime flow asset (BAR).)

  2. Switch to your Dashboard instance and click Deploy integrations.
  3. On the Size tab, select the appropriate size of integration runtime for your flow, then click Next.
  4. On the Integrations tab, upload the BAR file that contains your invoking flow, then click Next.
  5. On the Configuration tab, select a private network connection configuration, then click Next. You can select the default private network connection configuration default-switch-server-privatenetworkagent or you can select one that you created yourself.
  6. Enter a name for the integration runtime, select the version, and set any other properties that are appropriate. For more information, see Deploying integrations on the VPC plan.
  7. Click Create.

    The integration runtime is initially shown in pending status. Refresh the browser to update the status. When the integration runtime is ready, the invoking flow is deployed and is ready to be triggered.

Deploying the flow from the Manage page on the VPC hours plan
  1. On the Manage page, go to the Integrations tab and click Deploy integration.
  2. Select the callable flow that contains the Invoke node, then click Next.
  3. Select an existing runtime, then click Next. Alternatively, create a runtime by clicking Create runtime. For more information, see Creating a runtime.
  4. On the Add configurations page, select a private network connection configuration, then click Next. You can select the default private network connection configuration default-switch-server-privatenetworkagent or you can select one that you created yourself.
  5. Check the summary of what you're deploying, then click Deploy.

    A message indicates that the integration is being deployed. Refresh the browser to update the status. When the integration is deployed, a tile is shown on the Integrations tab of the Manage page and the status is Active. The invoking flow is ready to be triggered.

Results

After both the invoking and callable flows are deployed, when the invoking flow is triggered, the Callable flow Invoke node invokes the Callable Input node of the callable flow. The callable flow runs and the Callable flow Reply node returns data to the Callable flow Invoke node. Subsequent nodes in the flow can then use this returned data.

Your callable flows are listed on the Callable flows page (in the Connect category Icon that represents the Connect category of the navigation pane). The table lists the applications and endpoints for the callable flows that you're connected to. You can also see whether the callable flow is provided by App Connect or by an on-premises integration server.