Shared flow bundle configuration reference

A shared flow is reusable functionality similar to an API proxy. For more information, see Creating reusable shared flows.

Shared flow bundle directory structure

The shared flow bundle directory structure, shown below, is similar to the API proxy configuration directory structure.

Shared flow bundle directory structure

A shared flow bundle configuration consists of the following contents:

Base configuration Primary configuration settings.
Policies XML-formatted configuration files that conform to the Apigee policy schemas.
Resources Scripts, JAR files, and XSLT files referenced by policies to execute custom logic.
Shared flows Shared flows included in this bundle.

Base configuration

The base configuration file is located at the bundle's root directory. Its name is the name of the bundle.

/sharedflowbundle/traffic-management-shared.xml

The base configuration defines the contents of the shared flow bundle, along with information for tracking the bundle's revision history.

<SharedFlowBundle revision="2" name="traffic-management-shared">
    <ConfigurationVersion majorVersion="4" minorVersion="0"/>
    <CreatedAt>1478637529218</CreatedAt>
    <CreatedBy>gladys@example.com</CreatedBy>
    <Description>Shared flow to moderate API traffic</Description>
    <DisplayName>traffic-management-shared</DisplayName>
    <LastModifiedAt>1481573374023</LastModifiedAt>
    <LastModifiedBy>gladys@example.com</LastModifiedBy>
    <Policies>
        <Policy>Auth-Flow-Callout</Policy>
        <Policy>Extract-Token</Policy>
        <Policy>Spike-Arrest</Policy>
    </Policies>
    <Resources>
        <Resource>jsc://extract-token.js</Resource>
    </Resources>
    <SharedFlows>
        <SharedFlow>default</SharedFlow>
    </SharedFlows>
</SharedFlowBundle>

Base configuration attributes

Name Description Default Required?
SharedFlowBundle
name Name of the shared flow bundle, which must be unique within an organization. Valid characters include: A-Za-z0-9_- N/A Yes
revision Revision number of the shared flow bundle configuration. You do not need to explicitly set the revision number since Apigee automatically tracks the current revision of the shared flow. N/A No

Base configuration elements

Name Description Default Required?
SharedFlowBundle
ConfigurationVersion Version of the shared flow bundle configuration schema to which this shared flow conforms. The only supported value currently is majorVersion 4 and minorVersion 0. This setting may be used in the future to enable evolution of the shared flow bundle format. 4.0 No
CreatedAt and CreatedBy Date/time (in epoch time) that the shared flow bundle was created, and the email of the user who created it.
Description Textual description of the shared flow. If provided, the description will display in the Apigee UI. N/A No
DisplayName User-friendly name that may be different from the name attribute of the shared flow configuration. N/A No
LastModifiedAt and LastModifiedBy Date/time (in epoch time) that the shared flow bundle was last modified, along with the email of the user who modified it.
Policies List of policies in the /policies directory of this shared flow. You will normally only see this element when the shared flow was created using the Edge management UI. This is simply a 'manifest' setting, designed to provide visibility into the contents of the shared flow. N/A No
Resources List of resources (JavaScript, Python, Java, XSLT) in the /resources directory of this shared flow. You will normally only see this element when the shared flow was created using the Apigee UI. This is simply a manifest setting, designed to provide visibility into the contents of the shared flow. N/A No
SharedFlows Shared flow that this bundle contains. N/A Yes

Policies

/sharedflowbundle/policies

As in an API proxy, in a shared flow bundle the /policies directory contains configuration XML for all policies available to be attached to the shared flow in the bundle. Policies share a subset of elements, though this subset is augmented with elements that are specific to the policy. For more about how to configure a policy, Policy reference overview.

Resources

/sharedflowbundle/resources

Resources are scripts, code, and XSL transformations that can be attached to shared flows using policies. These appear in the Scripts section of the shared flow editor in the management UI.

See Managing resources for the supported resource types.

Shared flows

/sharedflowbundle/sharedflows/default.xml

The SharedFlow configuration defines the sequence in which flow elements should be executed. The <SharedFlow> element's <Step> child elements each specify a part of the sequence, such as a call to a policy.

The following SharedFlow configuration specifies three policies to be executed in a top-to-bottom sequence (left to right in the management console), with the SpikeArrest policy first and a FlowCallout policy last.

<SharedFlow name="default">
    <Step>
        <Name>Spike-Arrest</Name>
    </Step>
    <Step>
        <Name>Extract-Token</Name>
    </Step>
    <Step>
        <Name>Auth-Flow-Callout</Name>
    </Step>
</SharedFlow>

Shared flow configuration attributes

Name Description Default Required?
SharedFlow
name The name of the shared flow, which must be unique within an organization. Valid characters include: A-Za-z0-9_- N/A Yes
revision Revision number of the shared flow configuration. You do not need to explicitly set the revision number since Apigee automatically tracks the current revision of the shared flow. N/A No

Shared flow configuration elements

Name Description Default Required?
SharedFlow Sequence of policies in the shared flow. N/A Yes
Step Stage in the flow's sequence. N/A Yes
Name Name of the item referenced by the step. This element's value should be the same as the item's unique identifier, such as a policy's name attribute value. N/A Yes