Microsoft Graph icon

Microsoft Graph

Make requests to Microsoft Graph API with retry handling

Microsoft Graph

AI-generated

Overview

This node allows making HTTP requests to the Microsoft Graph API with built-in support for OAuth2 authentication or manual access token usage. It supports all common HTTP methods (GET, POST, PATCH, PUT, DELETE) and enables users to specify the full Microsoft Graph API URL, request body, query parameters, and custom headers. The node also handles rate limiting by automatically retrying requests when receiving HTTP 429 responses, with configurable retry limits and delays. It is useful for integrating Microsoft Graph API capabilities into workflows, such as accessing user data, managing resources, or automating Microsoft 365 services.

Use Case Examples

  1. Retrieve a list of users from Microsoft Graph using a GET request with OAuth2 authentication.
  2. Create or update a resource in Microsoft Graph by sending a POST or PATCH request with a JSON body.
  3. Query Microsoft Graph with OData parameters like $select or $filter to customize the data returned.
  4. Handle rate limiting automatically when making multiple requests to Microsoft Graph in a workflow.

Properties

Name Meaning
Authentication Type Selects the authentication method to use for Microsoft Graph API requests, either OAuth2 credentials configured in n8n or a manually provided access token.
Access Token Bearer token obtained from Microsoft Identity Platform, required if using manual access token authentication.
HTTP Method The HTTP method to use for the request (GET, POST, PATCH, PUT, DELETE).
URL The full Microsoft Graph API URL to send the request to, e.g., https://graph.microsoft.com/v1.0/users.
Request Body JSON body content for PATCH, POST, or PUT requests.
Query Parameters OData query parameters such as $select, $filter, $expand, $top, $orderby to customize the API response.
Headers Custom HTTP headers to include in the request.
Options Additional request options including response format (JSON or text), whether to return the full response, request timeout, rate limiting handling, max retries, and error continuation.

Output

JSON

  • body - The parsed response body from the Microsoft Graph API, or the full response object if 'Full Response' option is enabled.
  • headers - HTTP response headers returned by the Microsoft Graph API (only if 'Full Response' option is enabled).
  • statusCode - HTTP status code of the response (only if 'Full Response' option is enabled).
  • data - The response data as a string if the response format is set to text.

Dependencies

  • Requires OAuth2 credentials configured in n8n for Microsoft Graph or a manual access token.
  • Uses Microsoft Graph API endpoints.

Troubleshooting

  • Ensure the access token is valid and has the required Microsoft Graph API permissions.
  • If using OAuth2, verify that the OAuth2 credentials are correctly configured in n8n.
  • Check that the request body is valid JSON for PATCH, POST, and PUT methods.
  • If rate limited (HTTP 429), the node automatically retries based on configured settings; adjust max retries or disable retry if needed.
  • If the node throws an error with status code other than 2xx or 429, verify the API URL and permissions.
  • Use the 'Continue On Error' option to allow workflow execution to proceed despite errors.

Links

Discussion