API / APIGEE Gateway Interview Questions
What are Flows in Apigee and what is the request/response processing pipeline?
A Flow is an ordered sequence of policy steps that Apigee executes as a request travels from client to backend and back. Understanding the flow pipeline is fundamental to knowing where to attach each policy.
| Phase | Direction | Description |
|---|---|---|
| ProxyEndpoint PreFlow | Request | First to execute; runs for every request regardless of path; ideal for security policies (key verification, OAuth) |
| ConditionalFlows (ProxyEndpoint) | Request | Named flows with conditions (e.g. path suffix or verb); only the first matching flow executes |
| ProxyEndpoint PostFlow | Request | Runs after conditional flows; rarely used on request side |
| TargetEndpoint PreFlow | Request | Runs just before Apigee forwards to backend; last chance to transform the outgoing request |
| Backend | Both | The actual backend service |
| TargetEndpoint PostFlow | Response | First to run on response; transform backend response before client sees it |
| ProxyEndpoint PostFlow | Response | Last policy stage before client receives the response |
| Error Flow (FaultRules) | Either | Executes when a policy raises an error; used for custom error responses |
<!-- Example: PreFlow with security policy --> <ProxyEndpoint name="default"> <PreFlow name="PreFlow"> <Request> <Step><Name>VerifyAPIKey</Name></Step> <!-- Step 1: check key --> <Step><Name>Quota</Name></Step> <!-- Step 2: enforce quota --> </Request> <Response/> </PreFlow> <Flows> <Flow name="GetOrders"> <Condition>request.verb == "GET" and proxy.pathsuffix MatchesPath "/orders"</Condition> <Request> <Step><Name>AssignMessage.SetHeaders</Name></Step> </Request> </Flow> </Flows> <PostFlow name="PostFlow"> <Response> <Step><Name>ResponseCache</Name></Step> <!-- cache the response --> </Response> </PostFlow> </ProxyEndpoint>
More Related questions...