@advenimuss/n8n-nodes-msgraph
v0.2.6
Published
n8n node for Microsoft Graph API with retry handling
Maintainers
Readme
n8n-nodes-msgraph
This 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.
Features
- 🔄 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)
Installation
You can install this node in your n8n instance by:
npm install @advenimuss/n8n-nodes-msgraphConfiguration
- 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)
- 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
Rate Limiting Features
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
Development Setup
- Clone this repository:
git clone https://github.com/advenimuss/n8n-nodes-msgraph.git
cd n8n-nodes-msgraph- Install dependencies:
npm install- Build the node:
npm run build- Link for local testing:
npm link- In your local n8n installation directory:
npm link @advenimuss/n8n-nodes-msgraphTesting
- Run the linter:
npm run lint- Fix linting issues:
npm run lintfixBuilding for Production
- Update version in package.json
- Build the project:
npm run build- Test the build:
npm run lintPublishing to npm
- Login to npm:
npm login- Publish the package:
npm publish --access publicExample Usage
Basic GET Request
{
"resource": "custom",
"method": "GET",
"url": "https://graph.microsoft.com/v1.0/me",
"authentication": "msGraphOAuth2Api"
}Handling Rate Limits
{
"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}}"
}
}License
Support
- Create an issue in this repository
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
