Microsoft Teams Trigger Node Not Capturing Messages After a Period of Inactivity

Describe the problem/error/question

I’ve observed that when the Microsoft Teams Trigger node in n8n is published and remains inactive for a few days due to no incoming messages, it sometimes stops picking up new messages when activity resumes. Is this expected behavior, or could it be related to the trigger subscription expiring or requiring renewal?

What is the error message (if any)?

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.44.3
  • Database (default: SQLite):Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):Main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows

Hey @AstralVyom, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@Quintus, @Olek, @krisn0x - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

The Microsoft Teams Trigger node relies on Microsoft Graph API “subscriptions” to receive real-time notifications (webhooks) when events occur (like a new message). These subscriptions are not permanent; Microsoft requires them to be renewed periodically.

If the trigger remains inactive for a period where no messages are sent, the underlying subscription may expire. In some cases, the node may fail to automatically renew these subscriptions, causing the trigger to stop “listening” even though the workflow appears to be active and “published” in n8n.

You can do this:

  1. Create a separate “Maintenance” workflow.
  2. Add a Schedule Trigger: Set it to run once a day (or at a frequency that ensures you renew before the subscription expires, e.g., every 24–48 hours).
  3. Use the HTTP Request Node: Use this node to send a PATCH request to the Microsoft Graph API endpoint for your specific subscription.
    • Goal: You are essentially telling Microsoft, “I am still active, please extend my subscription expiration date by another X hours/days.”
    • Documentation Reference: You would need your subscriptionId and the appropriate expirationDateTime in the request body.

A practical workaround while the renewal issue exists: toggling the workflow off and on recreates the Graph subscription. You can automate that with a small second workflow on a Schedule Trigger every 12 hours that calls the n8n public API, POST /api/v1/workflows/{id}/deactivate and then /activate, with an n8n API credential. Not pretty, but it keeps the subscription fresh. Also worth checking the executions list right after it goes quiet, since a failed renewal tends to show up there as a 401 or 404 from Graph.

Hello, I’ve got a notice from how I’ve fixed this issue. I use this workflow:

{
"name": "Teams subscriptions verlengen",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-80,
-112
],
"id": "10b32786-dfe8-4d95-a47d-3b3a31941ddf",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"url": "``https://graph.microsoft.com/v1.0/subscriptions``",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "microsoftTeamsOAuth2Api",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
208,
0
],
"id": "e7599067-49d4-45b3-afa3-57bff28981f7",
"name": "HTTP Request"
},
{
"parameters": {
"jsCode": "const allItems = $input.all();\nconst allSubscriptions = allItems[0].json.value;\nconst teamsSubscriptions = allSubscriptions.filter(sub => sub.resource.startsWith('/chats/'));\n\n// Voor elk Teams-abonnement: bereken nieuwe datum en retourneer compleet object\nconst result = teamsSubscriptions.map(subscription => {\n // Bereken de nieuwe vervaldatum (72 uur vanaf NU)\n const newExpiry = new Date(new Date().getTime() + (72 * 60 * 60 * 1000));\n\n // Retourneer een compleet nieuw object met alle originele velden + de nieuwe datum\n return {\n json: {\n ...subscription, // Dit kopieert id, resource, etc.\n expirationDateTime: newExpiry.toISOString() // Dit overschrijft de oude datum\n }\n };\n});\n\n// Stuur de lijst met bijgewerkte abonnementen naar de PATCH-node\nreturn result;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
416,
0
],
"id": "815ec519-28e1-4da8-8cca-09a96c54e1ff",
"name": "Filter Teams-abonnementen"
},
{
"parameters": {
"method": "PATCH",
"url": "=``https://graph.microsoft.com/v1.0/subscriptions/``{{ $json.id }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "microsoftTeamsOAuth2Api",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n "expirationDateTime": "{{ $json.expirationDateTime }}"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.3,
"position": [
624,
0
],
"id": "693eb3b9-e54e-4dd2-b56e-2b0af53484a2",
"name": "HTTP Request1"
},
{
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
-96,
112
],
"id": "79116cf7-482c-4d42-8435-15ea262d53e9",
"name": "Schedule Trigger"
}
],
"pinData": {},
"connections": {
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request": {
"main": [
[
{
"node": "Filter Teams-abonnementen",
"type": "main",
"index": 0
}
]
]
},
"Filter Teams-abonnementen": {
"main": [
[
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false,
"timeSavedMode": "fixed",
"timezone": "Europe/Amsterdam",
"callerPolicy": "workflowsFromSameOwner"
},
"versionId": "65a6a915-215a-4393-9aac-e667ce05b598",
"nodeGroups": ,
"id": "qrKNTBUzUuUIIZ0A",
"tags":
}

The screenshots don’t confirm expiry, so I’d check the trigger output and earlier failed execution first.

I’d use a separate maintenance workflow: Schedule Trigger every 30 minutes, HTTP Request to list Graph subscriptions, Code to select this workflow’s production notification URL and expected resource, then HTTP Request to renew each matching subscription.

Use the same Microsoft credential as the trigger. PATCH /v1.0/subscriptions/{id} with expirationDateTime within that subscription type’s allowed lifetime, then verify the returned expiry advanced. Don’t renew every subscription indiscriminately.

If a subscription is missing or returns 404, recreate it through the original trigger’s activation process and alert on failure. Also handle lifecycle notifications separately from messages.

Test after a quiet period beyond the original expiry. Renewal won’t automatically recover missed messages; use a catch-up step with message-ID deduplication if needed.

Hey, I tried importing the workflow using the JSON you shared, but there seem to be some errors in the JSON that are preventing the workflow from being imported correctly.

I also tried fixing the JSON myself, but after making the changes, the Code node was not producing any output.

Could you please share the exact, corrected JSON for the workflow and help me ensure that the Code node is working as expected? I want to make sure the workflow can be imported and executed without any issues.

Thanks for your help!

@AstralVyom I’ve attached a replacement export for a manual check first. It has no schedule, and the PATCH node is disabled until you’ve confirmed the selected subscription.

The pasted export has JSON syntax problems in jsonBody and the final nodeGroups/tags fields. The backticks inside the URL strings are a separate request-configuration problem. After those are fixed, the original /chats/ prefix filter can still discard a channel subscription or a resource without the leading slash.

In the attached workflow:

  1. Select the same Microsoft credential as your Teams Trigger in both HTTP Request nodes.
  2. Run List subscriptions on its own. Find your trigger’s subscription, then copy its notificationUrl and exact resource into the two constants in Select exact subscription. Use double-quoted JavaScript strings: Graph resource paths can contain apostrophes. Keep those values local.
  3. Run the manual workflow. The selector handles value or body.value, normalizes the leading slash and requires one exact URL/resource match. Empty results, pagination, ambiguous matches and expired entries produce an explanation instead of silently returning no items.
  4. Once the selected ID is correct, enable Renew selected subscription and run again. The renewal branch requests 50 minutes from now only when the current expiry is sooner; it won’t shorten a longer expiry. Check the PATCH response’s expirationDateTime against the previous value. If more than 50 minutes already remain, the selector explains why no PATCH is needed.

The 50-minute window is for this manual check, not an unattended maintenance setup. Microsoft requires a lifecycle notification URL for Teams subscriptions extending more than an hour. After the manual path works, the renewal interval, lifecycle handling and missed-message recovery still need configuring.

I checked JSON parsing and 22 local mocked cases, including nested responses, wrong URLs, duplicates and expired subscriptions. I haven’t imported it into n8n 2.44.3 or called your Graph tenant, so those are still checks to perform in your environment.

If the selector stops, share its diagnostic message with IDs and URLs redacted. Don’t post credentials or clientState.
teams-subscription-inspect-renew.json (6.0 KB)

Glad the subscription-renewal workflow fixed it. One addition for anyone who finds this later: if the renewal step itself ever fails, nothing errors and the trigger just goes quiet again. A small safety net is a scheduled workflow (e.g. every 6 hours) → HTTP Request to GET /api/v1/executions?workflowId=<teams-workflow-id>&limit=1 → IF startedAt is older than your normal quiet period → send an alert. Also alert on the renewal workflow’s own failures through an error workflow.

Disclosure: I work on FlowWatch, which flags workflows that go quiet like this automatically. The DIY check above works fine too: https://flowwatchhq.com