Developing shared flows

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

Combine policies and resources into a shared flow that you can consume from multiple API proxies, and even from other shared flows. Although it's like a proxy, a shared flow has no endpoint. It can be used only from an API proxy or shared flow that's in the same organization as the shared flow itself.

Develop your shared flows using Apigee in Cloud Code as described in the following sections. See also Managing folders and files in an Apigee workspace.

Creating a shared flow

To create a shared flow using Apigee in Cloud Code:

  1. Perform one of the following steps:

    • Position your cursor over the sharedflows folder in your local workspace and click Create shared flow icon.

    • Select View > Command Palette to open the Command palette and select Cloud Code: Create Apigee shared flow bundle.

    The Create shared flow wizard opens.

  2. Enter a unique name for the shared flow at the prompt and press Enter.

After you complete the steps in the wizard, the new shared flow name appears under sharedflows in the Apigee section. Each shared flow folder is structured as described in Shared flow bundle directory structure

Uploading a shared flow bundle

To upload a shared flow bundle using Apigee in Cloud Code:

  1. Perform one of the following actions:

    • In your local workspace, position your cursor over the sharedflows folder and click Upload shared flow bundle icon.

    • Select View > Command Palette to open the Command palette and select Cloud Code: Import Apigee shared flow bundle.

  2. Navigate to the shared flow bundle that you want to upload and click Import shared flow. The shared flow bundle must be structured as described in Shared flow bundle directory structure.

  3. (Optional) By default, the name of the zip file minus its extension is used for the name of the shared flow. If this name is not unique, you are prompted to enter a unique name.

The uploaded shared flow folder is added under sharedflows in your Apigee workspace.

Configuring shared flows

Configure shared flows as described in the following topics:

Using shared flows

You can call a shared flow using the FlowCallout policy, as described in FlowCallout policy.

In addition, by attaching a shared flow to a flow hook you can execute the shared flow before a proxy or target request, or after a proxy or target response. For more information, see: