This repository provides a custom N8N node for interacting with the Microsoft Graph API across multiple tenants, based on a fork of advenimuss-n8n-nodes-msgraph
. It extends the original node by allowing dynamic data retrieval from many Microsoft tenants using a multi-tenant Azure app registration.
Before you begin, you’ll need:
- An Azure AD multi-tenant app
- Appropriate Microsoft Graph API permissions
- An N8N instance
To configure your Azure AD app for multi-tenant access:
- Log in to the Azure Portal.
- Navigate to Azure Active Directory > App registrations.
- Click New registration.
- Set the Supported account types to:
✅ Accounts in any organizational directory (Any Azure AD directory - Multitenant)
- After registration:
- Copy the Application (client) ID
- Copy the Directory (tenant) ID
- Go to Certificates & secrets and:
- Create a client secret or upload a certificate for authentication.
- In API permissions, add the required Microsoft Graph permissions (e.g.,
User.Read.All
,Group.Read.All
) and grant admin consent. - Share the consent URL with each tenant admin so they can authorize your app.
- Install the NPM package in your N8N instance using your preferred method (e.g., cloning the repo into your custom nodes directory).
- Restart N8N to load the new node.
- Add the Microsoft Graph (Multi-Tenant) node to your workflow.
- Provide a Tenant ID:
- Dynamically using expressions or looping over a list of tenant IDs.
- Or statically by hardcoding a single tenant ID if only one is required.
- Configure the desired action (e.g., list users, get groups, send email).
- Optionally add custom headers for advanced API scenarios (e.g., API version, consistency level, preferences).
- Execute the workflow to fetch data from the Microsoft Graph API.
This project is licensed under the MIT License.
It is a fork of the original advenimus/n8n-nodes-msgraph project and includes modifications to support multi-tenant Microsoft Graph access in N8N.
See the LICENSE file for full license details.