Overview
This node enables interaction with any OData REST interface by sending HTTP requests to an OData service URL. It supports common HTTP methods (GET, POST, PATCH, DELETE) and allows users to specify OData query parameters or raw queries to filter, select, order, and paginate data.
Typical use cases include:
- Querying Microsoft Graph API or other OData-compliant services to retrieve filtered or specific data sets.
- Creating, updating, or deleting resources on an OData service.
- Integrating OData-based APIs into workflows for automation, such as syncing user data or managing entities.
For example, you could use this node to fetch a list of users from Microsoft Graph with specific fields selected and filtered by last name, or to create a new user by posting JSON data.
Properties
| Name | Meaning |
|---|---|
| URL | The base URL of the OData service endpoint (e.g., https://graph.microsoft.com/v1.0/). |
| Authentication | Choose authentication method: None or a generic credential type supporting various auth schemes. |
| Credential Type | Select the predefined credential type when using predefined authentication (OAuth1, OAuth2, etc.). |
| Generic Auth Type | Select the generic authentication credential type if "Generic Credential Type" is chosen. |
| Method | HTTP method to use: GET, POST, PATCH, or DELETE. |
| Resource | The OData resource path to target (e.g., People('scottketchum')). |
| Data | JSON string representing the data to send in POST or PATCH requests. |
| Advanced | Toggle to show advanced options for query customization. |
| Raw Query | Raw OData query as a JSON string that overrides individual query options. |
| $select | Comma-separated list of fields to select in the response. |
| $filter | OData filter expression to restrict results. |
| $orderby | Field(s) to order the results by. |
| $top | Number of results to return (limit). |
| $skip | Number of results to skip (offset). |
Output
The node outputs an array of items where each item contains a json property holding the parsed JSON response from the OData service. Each element corresponds to one entity or record returned by the OData query or operation.
If the response is a single object, it is wrapped into an array for consistency. There is no binary output.
Example output structure:
[
{
"json": {
"id": "123",
"displayName": "John Doe",
"mail": "john.doe@example.com"
}
},
{
"json": {
"id": "456",
"displayName": "Jane Smith",
"mail": "jane.smith@example.com"
}
}
]
Dependencies
- Requires access to an OData-compatible REST API endpoint.
- Supports optional authentication via generic credentials or predefined OAuth credentials.
- Uses the external
odatalibrary for building and executing OData queries. - If authentication is used, appropriate credentials must be configured in n8n (e.g., OAuth2 tokens or basic auth).
Troubleshooting
- Invalid JSON in Data or Query: The node expects valid JSON strings for the
DataandRaw Queryproperties. Malformed JSON will cause parsing errors. Ensure JSON syntax is correct. - Authentication Errors: If using authentication, ensure credentials are correctly set up and valid. Expired tokens or incorrect credentials will result in authorization failures.
- Incorrect Resource Path: The
Resourceproperty must be a valid OData resource path. Incorrect paths may lead to 404 or other HTTP errors. - Unsupported HTTP Methods: Only GET, POST, PATCH, and DELETE are supported. Using others will cause errors.
- Network Issues: Connectivity problems to the OData service URL will cause request failures.
- Error Handling: If the node is set to continue on fail, errors for individual items will be included in the output with error details; otherwise, execution stops on the first error.