API / APIGEE Gateway Interview Questions
What are Shared Flows in Apigee and when do you use them?
A Shared Flow is a reusable sequence of policies that can be called from any API proxy using the FlowCallout policy. Shared flows solve the problem of duplicating the same policy logic across dozens of proxies -- a change to the shared flow propagates to all proxies that reference it.
| Aspect | API Proxy | Shared Flow |
|---|---|---|
| Has a ProxyEndpoint | Yes -- receives direct client traffic | No -- cannot receive traffic directly |
| Has a TargetEndpoint | Yes | No |
| Can it be called externally | Yes (it has a URL) | No (called by FlowCallout from within a proxy) |
| Purpose | Full API lifecycle | Reusable policy bundle for cross-cutting concerns |
| Deployed to | Environment (same as proxies) | Environment (same as proxies) |
<!-- In an API proxy: calling a shared flow --> <FlowCallout name="FC.CommonSecurity"> <SharedFlowBundle>common-security</SharedFlowBundle> </FlowCallout> <!-- common-security shared flow content (sharedflowbundle/): --> <!-- VerifyAPIKey.xml --> <!-- SpikeArrest.xml --> <!-- Quota.xml --> <!-- MessageLogging.xml --> <!-- Typical shared flow use cases: - Common security (VerifyAPIKey + Quota + SpikeArrest) - Standard error handling (FaultRules + AssignMessage) - Logging (MessageLogging + StatisticsCollector) - Header injection (add internal headers before backend) - CORS handling across all proxies --> <!-- A platform team creates and governs the shared flow. Individual API teams attach it via FlowCallout. Policy change in one place = change across all proxies. -->
Governance pattern: a central platform team creates and enforces shared flows containing organisation-wide security, logging, and traffic management standards. API teams build proxies that must include the required shared flows via FlowCallout, ensuring policy consistency without manual duplication.
More Related questions...