How to support target pre and post flow in shared-flow in apigee ?

Not applicable

Hello Everyone,

I am trying to change the target URL of apigee proxy dynamically through the JavaScript policy. I have got the work done on this, by just putting the JavaScript policy in the PreFlow of target endpoint and writing the following lines into it,

var targeturl = context.getVariable("target.url"); 
context.setVariable("target.url", targeturl+"/dnfkjd");

Now i want the same thing to be done and in the same way with Shared Flow. In this case i have a proxy along with the default proxy and target endpoints. And to perform the change of target URL, i have put the JavaScript policy in the SharedFlow's Step.

Now its not working because, SharedFlow does not support the target pre or post flows.

0 1 500
1 REPLY 1

This should work without an issue. You simply need to add a Flow Callout to the target PreFlow.

It would be something like below, but with the name of your shared flow.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FlowCallout async="false" continueOnError="false" enabled="true" name="Flow-Callout-1">
    <DisplayName>Flow Callout-1</DisplayName>
    <FaultRules/>
    <Properties/>
    <SharedFlowBundle>Shared-FlowTemp</SharedFlowBundle>
</FlowCallout>

Hopefully that helps.