API Composition
API composition is a pattern where a composer layer calls multiple upstream services, then combines and transforms their results into a single response. It lets clients retrieve data owned by different systems, such as a CRM and a billing provider, through one request.
Technical Architecture & Deep-Dive
In distributed systems, data is spread across services and SaaS tools. API composition implements cross-service queries in memory: the composer fetches each source, joins records by shared keys, and maps the merged result into the shape the client needs.
Running the composer at the edge keeps latency low because upstream calls execute in parallel from a well-connected network location. Declarative composition tools let teams define steps and output mappings without writing and hosting custom glue servers.
Key Architectural Benefits
Compose APIs Visually
Define upstream steps and output mappings, then deploy a composed endpoint globally.
Frequently Asked Questions
Q:How is API composition different from API aggregation?
The terms overlap. Aggregation emphasizes bundling multiple calls into one request, while composition emphasizes joining and reshaping the combined data into a new unified model.
Related Architecture Concepts
API Aggregation is the process of combining multiple distinct API calls into a single unified HTTP request. An intermediate edge gateway queries multiple upstream services in parallel, merges the returned data, and delivers a consolidated response to the client, drastically reducing mobile latency and network overhead.
Upstream Fan-out is an execution strategy where an edge gateway dispatches multiple HTTP subrequests to separate origin services concurrently rather than sequentially. The total latency is bound by the single slowest subrequest (max time) rather than the cumulative sum of all subrequests.
Response mapping is defining how fields from one or more upstream API responses are selected, renamed, and placed into a new output structure. Each mapping rule connects a source path, such as customer.email from a billing step, to a target path in the client response.
API orchestration is the coordination of multiple API calls in a defined sequence, where outputs from one step feed inputs to the next. An orchestrator manages ordering, dependencies, error handling, and the final response, so clients trigger a multi-step workflow with a single request.
Ready-to-Use Edge Recipes
To api composition tool for low code apps, configure parallel steps for REST API. Frontend / Web performs one authorized GET/POST to RealComposer and receives a merged payload.
Wire Salesforce REST from static sites with vault injection and no Express server. For "salesforce api composition tool for indie hackers", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let Static HTML / Jamstack hit only https://realcomposer.com/v1/workspace/salesforce-api-composition-indie-hackers with an rc_live_ client token.
Parallel fetch Salesforce Contact and HubSpot CRM contact into one JSON object. For "merge salesforce contacts with hubspot crm one api", store SALESFORCE_ACCESS_TOKEN, HUBSPOT_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let Frontend / Web hit only https://realcomposer.com/v1/workspace/merge-salesforce-with-hubspot-api with an rc_live_ client token.