Exporting and importing flows

You can use the export and import functions in App Connect Designer to share flows with other users who want to configure identical or similar integrations. You can also use these functions to transfer files across your environments.

About this task

To share (or transfer) an event-driven or API flow, you must first export it from the App Connect Designer dashboard as a YAML or BAR file. Users with access to the exported flow can then import it into their own environments. API flows can also be exported as OpenAPI documents, as described in Exporting your API flow as an OpenAPI document.

Note: If you are using IBM® Cloud Pak for Integration, you can also share your flows by adding them as assets to an Automation assets instance, which provides a centralized location for storing, managing, and sharing integration assets across capabilities. For more information, see IBM Cloud Pak for Integration only: Creating and reusing assets in an Automation assets instance.

Exporting a flow

When you export a flow, all its configuration settings, other than the connection credentials for your accounts, are preserved in the exported definition.

Procedure

To export a flow, complete the following steps:

  1. From the App Connect Designer UI, click the Dashboard icon Dashboard icon to open the App Connect Designer dashboard (if not currently on display).
  2. From the App Connect Designer dashboard, locate the flow, open its menu, and then click Export. The flow should preferably be in a Stopped or Running state.
    Export option in the flow menu
    Tip: If you are sharing a flow with other users, avoid exporting a flow with an Incomplete status or configuration errors that will need to be investigated after an import. Errors that are related to your account credentials for example, don't affect the exported flow.
  3. Choose the appropriate option for the event-driven or API flow:
    • Design-time flow asset (YAML): Click this option to export the flow as a YAML file that can then be imported into any App Connect Designer instance in a cluster. For more information, see Importing a flow.

    • Runtime flow asset (BAR): Click this option to export the flow as a BAR file that can then be deployed into an App Connect Dashboard instance as an integration server or integration runtime that runs an integration.

      To export a Designer-authored flow as a BAR file, the flow must meet a set of export requirements. For information about the considerations for exporting a flow, and the supported and unsupported components for export, see Export guidelines. For information about deploying an exported BAR file to an integration server or integration runtime in an App Connect Dashboard instance, see Deploying Designer and Toolkit integrations in the App Connect Dashboard.

    • OpenAPI V3 YAML and Runtime flow BAR assets (ZIP): Click this option to export the flow in two separate formats within a ZIP archive. This archive contains an OpenAPI document (in YAML format), which conforms to the OpenAPI Specification Version 3.0, and a BAR file that can be deployed into an App Connect Dashboard instance as an integration server or integration runtime. This option is displayed only for API flows. For more information about using these files, see Exporting your API flow as an OpenAPI document, Export guidelines (for BAR files), and Deploying Designer and Toolkit integrations in the App Connect Dashboard.
    • OpenAPI V3.0 (YAML) or OpenAPI V3.0 (JSON): These options are displayed only for API flows and can be used to export API flows as OpenAPI documents that conform to the OpenAPI Specification Version 3.0. For more information, see Exporting your API flow as an OpenAPI document.
    • OpenAPI V2.0/Swagger document (YAML) or OpenAPI V2.0/Swagger document (JSON): These options are displayed only for API flows and can be used to export API flows as OpenAPI documents that conform to the OpenAPI Specification Version 2.0. For more information, see Exporting your API flow as an OpenAPI document.
    Export panel
  4. Click Export.
  5. If prompted, choose to save the file, which is named after your flow by default, as flow name.yaml, flow_name.bar, or flow name.zip. (If saved as a BAR file, spaces in the flow name are replaced with underscores.)
    Depending on your browser, the file might also be automatically downloaded to a configured download location.
  6. If you selected the Design-time flow asset (YAML) option, choose how to make the exported YAML file available to other users. For example, you can copy the file to a file system directory, or a content management and file sharing system. You can also upload the file to a server with a public HTTP or HTTPS URL.
    Restriction: The URL must point to a public network that anyone can freely connect to without login credentials; for example, a public GitHub repository or GitHub Pages site.

    If the file is hosted on a public GitHub repository, ensure that you provide the raw URL for sharing. To do so, navigate to the YAML file location; for example:

    https://github.com/username/myrepo/blob/main/Document%20API.yaml

    Then click Raw to obtain the raw URL; for example:

    https://raw.githubusercontent.com/username/myrepo/main/Document%20API.yaml

Importing a flow

You can import event-driven or API flows into your App Connect Designer instance by using a YAML file that contains an exported flow definition. The exported flow definition can be obtained from any App Connect Designer instance in a cluster.

About this task

Because connection details are not saved with an exported flow, you need to set up your own accounts for each application in the flow if you do not already have one. You can add these accounts from the Catalog page before you import the flow, or from the flow (or API) editor of the imported flow. For information about the necessary connection details, see the How to guides for apps.

After you import the flow, you must ensure that the configuration settings for the nodes are validated. You can also modify the flow in the flow editor or API editor if necessary. Do not attempt to modify the YAML file before you import it.

Procedure

To import an exported flow:

  1. From the App Connect Designer UI, click the Dashboard icon Dashboard icon to open the App Connect Designer dashboard (if not currently on display).
  2. From the App Connect Designer dashboard, click New > Import flow to open the Import a flow panel.
  3. Specify a file or URL location for the YAML file that you want to import:
    • If stored in a file system directory, select the file by using either of these methods:
      • Click within the Add a YAML file boxed area to open a file browser and locate the YAML file.
      • Drag the file from its location in an open file browser into the Add a YAML file area.

      You see the file name in the File to be imported area.

    • If stored on a server that is accessible from a URL, enter a valid fully qualified URL for the YAML file in the or specify a file URL field and then click Add file. This URL must be a public URL that does not require login credentials. Only the HTTP and HTTPS transports are supported. Examples:

      http://www.example.com/path/Pricing%20API.yaml

      https://raw.githubusercontent.com/username/myrepo/main/Pricing%20API.yaml

    Import a flow panel
  4. Click Import.

    The imported flow opens within the flow editor for an event-driven flow, or the Define tab of the API editor for an API flow. The flow name is inherited from the exported flow definition. If you already have an existing flow with an identical name on your dashboard (for example, Customer API), the imported flow is renamed by appending _n to its name, where n is a number that starts from 1 (for example, Customer API_1).

    The following example shows an imported event-driven flow within the flow editor. The flow was validated automatically and a validation error is indicated by a warning icon Validation warning icon, which is typically displayed on any application or toolbox nodes that require your attention.

    Imported event-driven flow within the flow editor

    The following example shows the Define tab for an imported API flow.

    Define tab in API editor
    Before you can run the flow or change its configuration to suit your requirements, you must validate it; for example, to ensure that you are connected to the appropriate accounts and to review the details of nodes in the flow.
    • To validate an event-driven flow, go to step 5.
    • To validate an API flow, go to step 6.
  5. Event-driven flow: Validate the flow definition:
    1. Resolve any validation errors as described in Validating your flow is ready to run.
      Tip: You can use auto-generated or custom sample data to try out (or test) any configured action and verify its effect. To verify that the configured nodes in a flow collectively produce the expected results, you can also try out the flow before you start it. For more information, see Testing a non-running flow with sample data.
    2. Start the flow by selecting Start flow from the flow menu.
      Start flow menu option
  6. API flow: Validate the settings for each model and its operations:
    1. From the Define tab, click the Operations tab for a model.
    2. For each operation, edit the flow as follows to review its configuration and resolve any validation errors.
      1. Click Edit flow. A warning icon Validation warning icon is displayed on any nodes that require your attention.
      2. Ensure that the preferred accounts are selected for each action.
      3. Resolve any validation errors as described in Validating your flow is ready to run.
      4. After updating the operation, click Done.
      Tip: You can use auto-generated or custom sample data to try out (or test) any configured action and verify its effect. To verify that the configured nodes in a flow collectively produce the expected results, you can also try out the flow before you start it. For more information, see Testing a non-running flow with sample data.
    3. When you’ve validated all your models and operations, start the API by selecting Start API from the flow menu.
      Start API menu option
  7. Test the running flow as follows:
    • Event-driven flow: Complete the event activity that triggers the flow and then verify that you can see the expected results in the target applications. For more information, see Testing a running event-driven flow.
    • API flow: Test each operation by using the built-in test facility, and review the responses to verify the behavior of the flow. You can optionally check for the expected results in the target applications. For more information, see Testing a running API flow.

What to do next

To run the flow in a production system, deploy it as an integration server or integration runtime in the App Connect Dashboard, which provides a runtime environment.
  1. After you successfully test the flow in your App Connect Designer authoring environment, export the flow as a broker archive (BAR) file that packages the integration.
  2. Upload the BAR file to an App Connect Dashboard instance and then deploy the file to an integration server or integration runtime to run the integration in the production system.

    For more information, see Deploying Designer and Toolkit integrations in the App Connect Dashboard.