How to Connect Microsoft Teams to n8n
Teams webhook / Graph API setup.
How to Connect Microsoft Teams to n8n
Microsoft Teams integrations fail because most guides skip the authentication details that actually matter. This guide walks you through two proven connection methods: incoming webhooks
Method 1: Incoming Webhooks WebhooksClick to read the full definition in our AI & Automation Glossary. (Simple Notifications)
Use webhooks
What you can do: Send formatted messages, adaptive cards, and notifications to a single channel.
What you cannot do: Read messages, create channels, manage team membership, or interact with multiple channels.
Step 1: Generate the Webhook URL in Teams
- Open Microsoft Teams and navigate to the target channel
- Click the three dots next to the channel name, select Connectors
- Search for "Incoming Webhook" and click ConfigureWebhookClick to read the full definition in our AI & Automation Glossary.
- Name your webhook(example: "n8n Automation Bot")webhookClick to read the full definition in our AI & Automation Glossary.
- Upload an icon (optional but recommended for visual identification)
- Click Create and copy the webhookURL immediatelywebhookClick to read the full definition in our AI & Automation Glossary.
The URL format looks like: https://outlook.office.com/webhook/[GUID]/IncomingWebhook/[GUID]/[GUID]
Store this URL in a password manager. If you lose it, you must delete the connector and create a new one.
Step 2: Configure n8n to Send Messages
- In n8n, add an HTTP Request node (not the Microsoft Teams node)
- Set Method to POST
- Paste your webhookURL into the URL fieldwebhookClick to read the full definition in our AI & Automation Glossary.
- Set Body Content Type to JSON
- In the Body field, add this structure:
{
"text": "Your message here",
"title": "Optional Title"
}
For richer formatting, use adaptive cards:
{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"summary": "Workflow Alert",
"themeColor": "0078D7",
"title": "Automation Completed",
"sections": [{
"activityTitle": "Invoice Processing",
"activitySubtitle": "Processed 47 invoices",
"facts": [{
"name": "Status:",
"value": "Success"
}, {
"name": "Duration:",
"value": "3.2 seconds"
}]
}]
}
Step 3: Test and Verify
- Execute the workflow manually in n8n
- Check the Teams channel within 2-3 seconds
- If nothing appears, check the execution log for HTTP status codes:
- 200: Success
- 400: Malformed JSON in your request body
- 404: WebhookURL is incorrect or the connector was deletedWebhookClick to read the full definition in our AI & Automation Glossary.
Common failure: Copying the webhook
Method 2: Microsoft Graph API APIClick to read the full definition in our AI & Automation Glossary. (Full Control)
Use Graph API
What you can do: Create teams, add members, read channel messages, upload files, manage permissions, send activity feed notifications.
Setup time: 15-20 minutes for first-time configuration.
Step 1: Register an Azure AD Application
- Log into portal.azure.com
- Navigate to Azure Active Directory > App registrations
- Click New registration
- Enter application name: "n8n Teams Integration"
- Under Supported account types, select "Accounts in this organizational directory only"
- Under Redirect URI, select Web and enter:
https://oauth.pstmn.io/v1/callback - Click Register
After registration, copy these two values immediately:
- Application (client) ID: Found on the Overview page
- Directory (tenant) ID: Found on the Overview page
Step 2: Create a Client Secret
- In your app registration, click Certificates & secrets
- Click New client secret
- Add description: "n8n production"
- Set expiration to 24 months (maximum allowed)
- Click Add
- Copy the Value field immediately (this is your client secret)
Critical: The secret value only displays once. If you navigate away without copying it, you must create a new secret.
Step 3: Assign API APIClick to read the full definition in our AI & Automation Glossary. Permissions
- Click APIpermissions in your app registrationAPIClick to read the full definition in our AI & Automation Glossary.
- Click Add a permission > Microsoft Graph > Application permissions
- Add these permissions based on your use case:
For sending messages:
ChannelMessage.Send
For reading messages:
ChannelMessage.Read.All
For managing teams:
Team.CreateTeamMember.ReadWrite.AllGroup.ReadWrite.All
For activity feed notifications:
TeamsActivity.Send
- Click Add permissions
- Click Grant admin consent for [Your Organization] (requires Global Administrator role)
- Verify all permissions show a green checkmark under "Status"
Permission failure: If "Grant admin consent" is grayed out, you lack Global Administrator rights. Contact your IT admin or request the role temporarily.
Step 4: Configure n8n Credentials
- In n8n, go to Credentials > New
- Search for "Microsoft Teams" and select it
- Choose OAuth2 APIauthentication methodAPIClick to read the full definition in our AI & Automation Glossary.
- Enter your credentials:
- Client ID: Paste from Step 1
- Client Secret: Paste from Step 2
- Tenant ID: Paste from Step 1
- Click Connect my account
- Sign in with a Microsoft account that has Teams access
- Accept the permission consent screen
- Verify the credential shows "Connected" status
Step 5: Build Your First Graph API APIClick to read the full definition in our AI & Automation Glossary. Workflow
Example: Send a message to a specific channel
- Add a Microsoft Teams node to your workflow
- Select your credential from Step 4
- Set Resource to "Channel"
- Set Operation to "Send Message"
- Enter Team ID (find this in Teams URL:
teams.microsoft.com/l/team/[TEAM-ID]) - Enter Channel ID (find this in channel URL:
teams.microsoft.com/l/channel/[CHANNEL-ID]) - Set Message Type to "Text" or "HTML"
- Enter your message content
Example: Create a new team
- Add a Microsoft Teams node
- Set Resource to "Team"
- Set Operation to "Create"
- Enter Team Name
- Set Visibility to "Private" or "Public"
- Add Owner User ID (find in Azure AD user properties)
Step 6: Handle Authentication Errors
Error: "Insufficient privileges to complete the operation"
- You granted delegated permissions instead of application permissions
- Go back to Step 3 and verify you selected "Application permissions" not "Delegated permissions"
- Re-grant admin consent
Error: "Invalid client secret"
- Your secret expired (24-month maximum)
- Create a new secret in Azure AD and update n8n credentials
Error: "Resource not found"
- Team ID or Channel ID is incorrect
- Verify IDs by checking the Teams web URL while viewing the target team/channel
Webhook WebhookClick to read the full definition in our AI & Automation Glossary. vs. Graph API APIClick to read the full definition in our AI & Automation Glossary.: Decision Matrix
| Requirement | Use Webhook
Production Deployment Checklist
Before moving your Teams integration to production:
- [ ] Store all credentials in n8n's credential manager, never in workflow JSON
- [ ] Set client secret expiration reminders 30 days before expiry
- [ ] Test error handling by intentionally sending malformed requests
- [ ] Document which workflows use which Teams channels
- [ ] Create a separate Azure AD app for production vs. development environments
- [ ] Enable n8n workflow execution logging to track APIrate limitsAPIClick to read the full definition in our AI & Automation Glossary.
- [ ] Add retry logic for transient network failures (use n8n's built-in retry settings)
- [ ] Monitor Graph APIthrottling limits (current limit: 2,000 requests per app per tenant per 10 seconds)APIClick to read the full definition in our AI & Automation Glossary.
Rate Limits and Throttling
Webhook
Graph APIRetry-After header indicating wait time.
n8n configuration for rate limiting:
- Add a Function node before your Teams node
- Insert this code to add delays:
// Wait 300ms between requests
await new Promise(resolve => setTimeout(resolve, 300));
return items;
For bulk operations, batch requests using Graph API$batch endpoint to reduce total request count.
Troubleshooting Quick Reference
Webhook
Graph API
Messages appear delayed: Teams typically delivers within 2 seconds. Delays over 10 seconds indicate network issues or Microsoft service degradation. Check status.office.com.
Credential connection fails in n8n: Clear browser cache and retry OAuth flow. Ensure redirect URI in Azure exactly matches https://oauth.pstmn.io/v1/callback.
Cannot find Team ID or Channel ID: Open Teams in a web browser (not desktop app). The IDs appear in the URL bar when viewing the team or channel.

Reviewed by Revenue Institute
This guide is actively maintained and reviewed by the implementation experts at Revenue Institute. As the creators of The AI Workforce Playbook, we test and deploy these exact frameworks for professional services firms scaling without new headcount.
Revenue Institute
Need help turning this guide into reality? Revenue Institute builds and implements the AI workforce for professional services firms.