To connect n8n to Microsoft Teams, you can integrate using either Incoming Webhooks (to send messages to Teams) or the Microsoft Graph API (for advanced interactions like reading messages, creating teams, etc.).
🔁 Method 1: Using Microsoft Teams Incoming Webhook (Easiest)
🔧 Step-by-Step:
Create a Webhook in Microsoft Teams:
- Go to the channel where you want to receive messages.
- Click the "..." (More options) next to the channel > Connectors.
- Find and configure the Incoming Webhook connector.
- Give it a name and optionally upload an image.
- Copy the webhook URL (you’ll need this in n8n).
Create Workflow in n8n:
Add a Trigger Node (e.g., Webhook, Cron, etc.).
Add an HTTP Request node:
Method: POST
URL: Your Teams Webhook URL
Headers: Content-Type: application/json
Body (JSON):
{
"text": "Hello from n8n! 🚀"
}
Execute the workflow and check your Teams channel for the message.
🧠 Method 2: Using Microsoft Graph API (Advanced)
For more advanced functionality like:
- Sending messages to specific users
- Creating Teams/channels
- Managing members, etc.
You’ll need to:
🛠️ Step-by-Step:
Register an App in Azure:
- Go to Azure Portal > Azure Active Directory > App registrations > New registration
- Add API permissions:
- For example:
Chat.ReadWrite, Team.ReadBasic.All, User.Read, etc.
- Generate a Client Secret
- Note the Tenant ID, Client ID, and Secret
In n8n:
Send a Message via Graph API:
Endpoint example:
POST https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages
Headers: Authorization: Bearer {{access_token}}
Body:
{
"body": {
"content": "Hello from n8n via Graph API!"
}
}
✅ Summary
| Integration Type | Use Case | Difficulty |
| ------------------- | ------------------------------------- | ----------- |
| Incoming Webhook | Send simple messages to a channel | ⭐ Easy |
| Microsoft Graph API | Full-featured Teams bot functionality | 🔧 Advanced |