Actions6
- Allowed Operations Actions
- Composite Requests Actions
- Models Actions
- Query Actions
- User Views Actions
Overview
This node enables sending composite POST requests to a service endpoint, specifically designed for the "Composite Requests" resource with the "Post Services Composite" operation. It allows users to bundle multiple sub-requests into a single HTTP POST request body, which is useful for batch processing or transactional operations where multiple related API calls need to be executed together.
Typical use cases include:
- Creating or updating multiple related records in one API call.
- Executing a series of dependent operations atomically.
- Reducing network overhead by combining several requests into one.
For example, you might send a composite request that creates a new vendor account and simultaneously references this creation in subsequent operations within the same payload.
Properties
| Name | Meaning |
|---|---|
| Additional Body Fields | Optional fields to add to the POST request body. The main configurable field here is Body, which expects a JSON schema describing a single sub-request. This includes: HTTP method (e.g., POST), path, headers (like Idempotency-Key), the actual body content, and a result reference name. Users can add multiple such sub-requests as part of the composite request payload. |
The Body field JSON example:
{
"method": "POST",
"path": "/objects/accounts-payable/vendor",
"headers": {
"Idempotency-Key": "e9606bb2-6be1-4c9e-a2a7-134cd644a5ee"
},
"body": {
"lastName": "Doe",
"firstName": "John",
"id": "Doe, John"
},
"resultReference": "contactRef"
}
Output
The node outputs the response from the composite POST request. The json output field contains the parsed JSON response returned by the composite service, which typically includes results for each sub-request identified by their resultReference. This allows downstream nodes to access individual sub-request results easily.
If the service returns any binary data, it would be included accordingly, but based on the provided code and properties, the primary output is structured JSON data representing the composite request's response.
Dependencies
- Requires an API key credential for authenticating with the target service.
- The base URL for the API is configured via credentials.
- Uses the
@avantguardllc/n8n-openapi-nodepackage internally for building request properties and handling OpenAPI specifications. - The node expects the composite service to accept JSON-formatted POST bodies describing multiple sub-requests.
Troubleshooting
- Invalid JSON in Body Field: If the JSON entered in the
Bodyfield is malformed, the node will fail to parse it. Ensure valid JSON syntax. - Authentication Errors: Missing or incorrect API credentials will cause authentication failures. Verify that the API key or token is correctly set up in n8n credentials.
- Incorrect Endpoint or Path: Sub-request paths must be valid endpoints supported by the composite service. Invalid paths will result in errors.
- Idempotency Key Conflicts: Reusing the same idempotency key improperly may cause request conflicts or duplicate processing. Use unique keys per request when necessary.
- Response Parsing Issues: Unexpected response formats may cause parsing errors. Confirm the composite service returns JSON responses as expected.
Links and References
- Composite Request Pattern - General Concept
- Documentation for the specific composite service API (not provided here; consult your API provider)
- n8n documentation on Creating Custom Nodes