Conditional Flow Response not executed

Not applicable

I have a proxy receiving a POST request. I have added a conditional flow. Proxy endpoint flow is hitting a target endpoint. After receiving response from target I want to execute a step to map response.

I have added a step in Response(JS-MapResponse) to execute a javascript, but it is not getting executed.

Any suggestions?

Step JS-MapResponse is not getting executed after

<Flow name="CreateEmployee"> <Description>Add a new Employee.</Description> <Condition>(proxy.pathsuffix MatchesPath "/profile/employee") and (request.verb = "POST")</Condition> <Request> <Step> <Name>EV-ExtractDetails</Name> </Step> </Request> <Response> <Step> <Name>JS-MapResponse</Name> </Step> </Response) </Flow>

0 2 638
2 REPLIES 2

There is a typo in response closing tag , if that's the reason how you deployed this proxy ? Deployment should have been failed.

<Flow name="CreateEmployee">
    <Description>Add a new Employee.</Description>
    <Condition>(proxy.pathsuffix MatchesPath "/profile/employee") and (request.verb = "POST")</Condition>
    <Request>
        <Step>
            <Name>EV-ExtractDetails</Name>
        </Step>
    </Request>
    <Response>
        <Step>
            <Name>JS-MapResponse</Name>
        </Step>
    </Response) 
</Flow><br>

Are you changing the request verb to hit your target endpoint? That would stop the condition matching on the response. See this post: https://community.apigee.com/questions/37126/when-does-response-flow-of-a-conditional-flow-get.html

Personally I think this is a design issue with Edge - I think once you've mapped which flow you're going down it's perfectly reasonable to assume the response flow linked to the request flow will get executed regardless.