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":
}