Back to n8n Fundamentals
n8n Fundamentals

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

for simple notifications and the Microsoft Graph API for full programmatic control. You'll get exact configuration steps, real credential values to collect, and troubleshooting fixes for the three most common authentication errors.

Method 1: Incoming Webhooks
(Simple Notifications)

Use webhooks

when you need n8n to post messages to a specific Teams channel. This method requires no Azure app registration and takes under 5 minutes to configure.

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

  1. Open Microsoft Teams and navigate to the target channel
  2. Click the three dots next to the channel name, select Connectors
  3. Search for "Incoming Webhook
    " and click Configure
  4. Name your webhook
    (example: "n8n Automation Bot")
  5. Upload an icon (optional but recommended for visual identification)
  6. Click Create and copy the webhook
    URL immediately

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

  1. In n8n, add an HTTP Request node (not the Microsoft Teams node)
  2. Set Method to POST
  3. Paste your webhook
    URL into the URL field
  4. Set Body Content Type to JSON
  5. 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

  1. Execute the workflow manually in n8n
  2. Check the Teams channel within 2-3 seconds
  3. If nothing appears, check the execution log for HTTP status codes:
    • 200: Success
    • 400: Malformed JSON in your request body
    • 404: Webhook
      URL is incorrect or the connector was deleted

Common failure: Copying the webhook

URL with extra spaces or line breaks. Always paste into a text editor first to verify clean formatting.

Method 2: Microsoft Graph API
(Full Control)

Use Graph API

when you need to read messages, create teams, manage channels, or perform any action beyond simple message posting. This requires Azure AD app registration and OAuth2 authentication.

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

  1. Navigate to Azure Active Directory > App registrations
  2. Click New registration
  3. Enter application name: "n8n Teams Integration"
  4. Under Supported account types, select "Accounts in this organizational directory only"
  5. Under Redirect URI, select Web and enter: https://oauth.pstmn.io/v1/callback
  6. 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

  1. In your app registration, click Certificates & secrets
  2. Click New client secret
  3. Add description: "n8n production"
  4. Set expiration to 24 months (maximum allowed)
  5. Click Add
  6. 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
Permissions

  1. Click API
    permissions
    in your app registration
  2. Click Add a permission > Microsoft Graph > Application permissions
  3. Add these permissions based on your use case:

For sending messages:

  • ChannelMessage.Send

For reading messages:

  • ChannelMessage.Read.All

For managing teams:

  • Team.Create
  • TeamMember.ReadWrite.All
  • Group.ReadWrite.All

For activity feed notifications:

  • TeamsActivity.Send
  1. Click Add permissions
  2. Click Grant admin consent for [Your Organization] (requires Global Administrator role)
  3. 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

  1. In n8n, go to Credentials > New
  2. Search for "Microsoft Teams" and select it
  3. Choose OAuth2 API
    authentication method
  4. Enter your credentials:
    • Client ID: Paste from Step 1
    • Client Secret: Paste from Step 2
    • Tenant ID: Paste from Step 1
  5. Click Connect my account
  6. Sign in with a Microsoft account that has Teams access
  7. Accept the permission consent screen
  8. Verify the credential shows "Connected" status

Step 5: Build Your First Graph API
Workflow

Example: Send a message to a specific channel

  1. Add a Microsoft Teams node to your workflow
  2. Select your credential from Step 4
  3. Set Resource to "Channel"
  4. Set Operation to "Send Message"
  5. Enter Team ID (find this in Teams URL: teams.microsoft.com/l/team/[TEAM-ID])
  6. Enter Channel ID (find this in channel URL: teams.microsoft.com/l/channel/[CHANNEL-ID])
  7. Set Message Type to "Text" or "HTML"
  8. Enter your message content

Example: Create a new team

  1. Add a Microsoft Teams node
  2. Set Resource to "Team"
  3. Set Operation to "Create"
  4. Enter Team Name
  5. Set Visibility to "Private" or "Public"
  6. 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
vs. Graph API
: Decision Matrix

| Requirement | Use Webhook

| Use Graph API
| |-------------|-------------|---------------| | Send notifications only | Yes | Overkill | | Read message history | No | Yes | | Create teams/channels | No | Yes | | Manage team membership | No | Yes | | Multi-channel posting | No (one webhook
per channel) | Yes | | No Azure AD access | Yes | No | | Setup time under 5 minutes | Yes | No |

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 API
    rate limits
  • [ ] Add retry logic for transient network failures (use n8n's built-in retry settings)
  • [ ] Monitor Graph API
    throttling limits (current limit: 2,000 requests per app per tenant per 10 seconds)

Rate Limits and Throttling

Webhook

limits: 4 requests per second per webhook
URL. Exceeding this returns HTTP 429.

Graph API

limits: 2,000 requests per 10 seconds per application. Microsoft returns a Retry-After header indicating wait time.

n8n configuration for rate limiting:

  1. Add a Function node before your Teams node
  2. 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

's $batch endpoint to reduce total request count.

Troubleshooting Quick Reference

Webhook

returns 400 Bad Request: JSON syntax error. Validate your JSON at jsonlint.com before sending.

Graph API

returns 403 Forbidden: Missing API
permissions or admin consent not granted. Review Step 3.

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.

Revenue Institute

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.

RevenueInstitute.com