Teams workflows stop auto-approving from link previews
Microsoft Teams workflows using the "Send and Wait" operation will no longer randomly auto-approve or decline when links are shared in chat. A new User-Agent check blocks Preview Service requests that were inadvertently triggering approval workflows.
The Microsoft Teams node's "Send and Wait for Response" operation has been randomly auto-approving or declining workflows without any user clicking the buttons. This regression stems from Microsoft's Preview Service—when a link appears in a Teams chat, the service fetches the URL to generate a preview, inadvertently triggering the approval webhook.
Workflows should pause until an actual user clicks Approve or Decline. Instead, they were resuming immediately with a random outcome, making the approval workflow unreliable.
A new check in the shared webhook utilities now detects and blocks requests from Microsoft's Preview Service. The detection identifies requests by their User-Agent header, catching cases where the service fetches links sent in chat or pasted by users. Legitimate approval clicks from browsers and other clients continue to work as expected.
The fix is scoped to the Teams node's webhook handler, which now uses the shared sendAndWaitWebhook utility with the Preview Service check included.
View Original GitHub Description
Summary
<!-- Describe what the PR does and how to test. Photos and videos are recommended. -->Whenever a link is sent/pasted into the Teams chat, Microsoft's Preview Service makes a request to the URL to generate a link preview, which causes accidental approval or disapproval for the "Send and Wait" operation. To fix that, we block requests coming from the Preview Service based on the User-Agent header. Also, this change is scoped only to the Microsoft Teams node by creating a wrapper webhook function around the shared sendAndWaitWebhook
More context in the Linear issue
To test
- Set
WEBHOOK_URLto a publicly accessible URL using a tunneling service of your choice - Run n8n
- Create a workflow with Microsoft Teams node, Chat Message resource, Send and Wait operation
- Run the workflow
- Verify that the workflow resumes by itself after a few seconds (Preview Service triggered it)
- Checkout this branch, build and run n8n
- Run the workflow again
- Verify that the workflow is waiting
- Try going to the "Approve" link yourself
- Verify that it works and the workflow gets resumed
Related Linear tickets, Github issues, and Community forum posts
<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->https://linear.app/n8n/issue/NODE-4740/regression-teams-send-and-wait-for-response-still-auto-approves-after Follow-up to #25311, #26125
Review / Merge checklist
- PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
- Docs updated or follow-up ticket created.
- Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)