allOrNone Parameters in Composite and Collections Requests
If a Composite request uses sObject Collections, there are two or more allOrNone parameters that can interact, one on the Composite request and one on each sObject Collections subrequest.
- If the Composite request has
allOrNoneset totrue, then the all-or-none behavior also applies to each of the sObject Collections subrequests, overriding the value ofallOrNonein the subrequests. - If the Composite request has
allOrNoneset tofalse, then each sObject Collections subrequest behaves according to its value ofallOrNone.
Consider, for example, what happens with this job where a Composite request includes two items: an sObject Collections request and a request to create a Contact. The sObject Collections request tries to create two Accounts, one of which fails because there is already an existing Account with the same information.
The outerFlag and innerFlag parameters are either true or false, which leads to four possible cases.
Case 1: outerFlag = false, innerFlag = false
In this case, neither request has allOrNone set to true, so neither request is rolled back. One account is created and one fails.

Case 2: outerFlag = false, innerFlag = true
In this case, the inner sObject Collections request has allOrNone set to true, so it is rolled back. The outer Composite request is not rolled back.

Case 3: outerFlag = true, innerFlag = true
In this case, both requests have allOrNone set to true, so they are both rolled back.

Case 4: outerFlag = true, innerFlag = false
The response body for this case is:
In this case, the inner sObject Collections request has allOrNone set to false, so it is not immediately rolled back. However, the outer Composite request has allOrNone set to true so it is rolled back, which also rolls back the inner sObject Collections request.

Even though the response body for sObject Collections request shows "success" : true for the creation of the first Account, the fact that the Composite request is rolled back means that the Account creation is rolled back. The final result is that the new Account is not created.