n8n node for Microsoft Graph API with retry handling
npm install @advenimuss/n8n-nodes-msgraphThis is a custom n8n node that provides enhanced Microsoft Graph API integration with built-in rate limiting and retry handling. It allows you to make requests to any Microsoft Graph API endpoint while automatically handling throttling responses (HTTP 429) using Microsoft's recommended retry-after approach.
* 🔄 Automatic rate limit handling with retry logic
* ⏱️ Configurable retry intervals using Microsoft's retry-after header
* 🎯 Support for all Microsoft Graph API endpoints
* 🔐 OAuth2 authentication support
* 📝 Detailed error handling and logging
* 🛠️ Configurable request parameters (method, URL, headers, query parameters, body)
* 📦 Response format selection (JSON/String)
You can install this node in your n8n instance by:
``bash`
npm install @advenimuss/n8n-nodes-msgraph
1. Create a new Microsoft Graph API credential in n8n:
* Go to Settings > Credentials > New
* Search for "Microsoft Graph API"
* Configure with your Azure AD application details (or with an existing access token via a previous API call to get the token with a client secret)
2. In your workflow:
* Add the "Microsoft Graph" node
* Select your credential
* Configure the HTTP method, URL, and other parameters
* Enable/configure rate limit handling if needed
The node includes smart handling of Microsoft Graph API rate limits:
* Automatically detects HTTP 429 responses
* Uses the retry-after header from Microsoft's response
* Configurable maximum retry attempts
* Customizable retry delay with expression support
* Detailed logging of retry attempts
1. Clone this repository:
`bash`
git clone https://github.com/advenimuss/n8n-nodes-msgraph.git
cd n8n-nodes-msgraph
2. Install dependencies:
`bash`
npm install
3. Build the node:
`bash`
npm run build
4. Link for local testing:
`bash`
npm link
5. In your local n8n installation directory:
`bash`
npm link @advenimuss/n8n-nodes-msgraph
1. Run the linter:
`bash`
npm run lint
2. Fix linting issues:
`bash`
npm run lintfix
1. Update version in package.json
2. Build the project:
`bash`
npm run build
3. Test the build:
`bash`
npm run lint
1. Login to npm:
`bash`
npm login
2. Publish the package:
`bash`
npm publish --access public
`typescript`
{
"resource": "custom",
"method": "GET",
"url": "https://graph.microsoft.com/v1.0/me",
"authentication": "msGraphOAuth2Api"
}
`typescript``
{
"resource": "custom",
"method": "GET",
"url": "https://graph.microsoft.com/v1.0/users",
"authentication": "msGraphOAuth2Api",
"options": {
"enableThrottling": true,
"maxRetries": 5,
"retryAfter": "{{$response.headers['retry-after'] || 2}}"
}
}
* Create an issue in this repository
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request