FlowCallout policy runtime error troubleshooting

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

SharedFlowNotFound

Error code

flow.SharedFlowNotFound

Error response body

{
    "fault": {
        "faultstring": "Shared Flow shared_flow_name Not Found",
        "detail": {
            "errorcode": "flow.SharedFlowNotFound"
        }
    }
}

Possible Causes

The possible causes for this error are:

Cause Description
Shared flow not available The shared flow does not exist.
Shared flow not deployed The shared flow exists but is not deployed.

Cause: Shared flow not available

In the Flow Callout policy, if the shared flow defined within the <SharedFlowBundle> element does not exist in the environment, then this error occurs.

For example, If the <SharedFlowBundle> element in the Flow Callout policy contains a shared flow called SharedFlow_Sample and if this shared flow does not exist in the environment, then the error occurs.

Example Error Message

{
    "fault": {
        "faultstring": "Shared Flow SharedFlow_Sample Not Found",
        "detail": {
            "errorcode": "flow.SharedFlowNotFound"
        }
    }
}

Diagnosis

  1. Identify the shared flow which does not exist. You can find this in the faultstring element of the error response. For example, in the following faultstring, the shared flow name is SharedFlow_Sample:

    "faultstring": "Shared Flow SharedFlow_Sample Not Found"

  2. Examine all the Flow Callout policies in the specific API Proxy where the failure has occurred. Check if there is any Flow Callout policy in which <SharedFlowBundle> element is specified with the flow name identified in step #1 above.

    For example, the following policy specifies the <SharedFlowBundle> as SharedFlow_Sample, which matches with what's in the fault string.

    <FlowCallout async="false" continueOnError="false" enabled="true" name="Auth-Flow-Callout">
       <DisplayName>Auth Flow Callout</DisplayName>
       <SharedFlowBundle>SharedFlow_Sample</SharedFlowBundle>
    </FlowCallout>
    
  3. In the Edge UI, check if this shared flow exists under APIs > Shared Flows. If it does not exist, then that's the cause of the error. (Note that in the New Edge UI, you can find Shared Flows under the Develop tab.)

    For example, in the screenshot shown below, the shared flow SharedFlow_Sample does not exist.

    Because this shared flow does not exist, you receive the error code:

    flow.SharedFlowNotFound
    

Resolution

Ensure that the shared flow specified in the <SharedFlowBundle> element in the Flow Callout policy, exists and deployed in the specific environment in which the API request is executed.

You could choose one of the following ways to address the issue:

  1. Create a shared flow called SharedFlow_Sample as shown below and deploy it the test environment as shown below:

  2. Use an already existing Shared Flow that is deployed in the test environment in the Flow Callout policy. For example, you could specify SharedFlow_demo in the Flow Callout policy.

    <FlowCallout async="false" continueOnError="false" enabled="true" name="Auth-Flow-Callout">
      <DisplayName>Auth Flow Callout</DisplayName>
      <SharedFlowBundle>SharedFlow_demo</SharedFlowBundle>
    </FlowCallout>
    

    If you make an API call to the test environment, you will no longer see the error, because the Flow Callout is deployed to the test environment as well.

Cause: Shared flow not deployed

If the shared flow specified in the <SharedFlowBundle> element of the Flow Callout policy, is not deployed, then this error occurs.

For example, If the <SharedFlowBundle> element in the Flow Callout policy contains a shared flow called SharedFlow_example which is not deployed in the specific environment in which the API request is made, then the error occurs.

Example Error Message

{
    "fault": {
        "faultstring": "Shared Flow Shared-Flow_example Not Found",
        "detail": {
            "errorcode": "flow.SharedFlowNotFound"
        }
    }
}

Diagnosis

  1. Identify the shared flow which is not deployed. You can find this in the faultstring element of the error response. For example, in the following faultstring, the shared flow name is Shared-Flow_example:

    "faultstring": "Shared Flow Shared-Flow_example Not Found"

  2. In the Edge UI, check if this shared flow is deployed.

    For example, you will notice in the below screenshot that the shared flow SharedFlow_example exists butis not deployed.

    Since this shared flow is not deployed, you receive the error code:

    flow.SharedFlowNotFound
    

Resolution

Ensure that the shared flow specified in the <SharedFlowBundle> element in the Flow Callout policy, exists and deployed in the specific environment in which the API request is executed.

To correct the above example, deploy the shared flow called SharedFlow_example in the test environment as shown below:

If you make an API call to the test environment, you will no longer see the error, because the Flow Callout is deployed to the test environment as well.