Explain the Composite API family. What are the differences between composite request, sObject tree, batch, and graph?
Suggested answer
The Composite API family allows multiple REST API calls in a single HTTP request, reducing round trips:
Composite Request: Execute up to 25 sub-requests sequentially. Each sub-request can reference the response of a previous one using @{referenceId}. Supports mixed object types. All requests share one governor limit context. If one fails and allOrNone: true, all are rolled back.
sObject Tree: Create up to 5 parent records and their related children (up to 200 records total) in one call. Ideal for inserting a hierarchy (e.g., Account + Contacts + Opportunities) atomically.
Composite Batch: Execute up to 25 independent sub-requests. Requests do NOT share context — each is processed independently. No cross-referencing between requests. Failures do not roll back others.
Composite Graph: Execute multiple independent composite graphs in one request. Graphs within a request are independent; sub-requests within a graph can cross-reference each other. More powerful than composite request for complex dependency trees.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.