Overview
This node acts as a trigger that starts an n8n workflow when a Microsoft Teams message or activity is received via the Bot Framework. It listens for incoming webhook POST requests from Microsoft Teams, processes them according to specified filters, and optionally fetches additional user information from the Bot Framework API.
Common scenarios where this node is useful include:
- Automating responses or workflows based on messages sent in Microsoft Teams channels or chats.
- Filtering and processing only specific types of messages or activities (e.g., text messages only).
- Integrating Teams conversations with other systems by triggering workflows on message receipt.
- Handling file upload notifications and consent actions within Teams bots.
Practical example:
- A company wants to automate ticket creation whenever a user sends a text message to their Teams bot. This node triggers the workflow only on text messages, retrieves user info, and passes the data downstream for ticket creation.
Properties
| Name | Meaning |
|---|---|
| Company Code | The 6-digit company code identifying the enterprise (must be exactly 6 digits). |
| Path | The webhook path suffix appended after /webhook/ to form the full webhook URL. |
| Message Type Filter | Filter to select which incoming message types to process: - All Messages - Text Messages Only - Activities Only (non-message events) |
| Options | Collection of optional settings: - Response Code: HTTP status code to return (default 200) - Response Data: Custom response body to send back to Bot Framework (leave empty for automatic response) |
Output
The node outputs JSON data representing the incoming Teams message or activity enriched with user information retrieved from the Bot Framework API. The output structure includes:
- The original webhook payload fields (such as
type,from,conversation, etc.). - An added
userInfofield containing detailed information about the user who sent the message. - Wrapped inside a
workflowDataarray suitable for further processing in the workflow.
If the incoming request relates to a file upload or a declined file consent action, the node handles these cases specifically and returns appropriate webhook responses.
Binary data is not output by this node; it focuses on JSON message content and metadata.
Dependencies
- Requires an API key credential for authenticating with the Microsoft Bot Framework API.
- Makes HTTP requests to:
- Microsoft OAuth2 token endpoint to obtain access tokens.
- Bot Framework API endpoints to retrieve user membership details.
- External webhooks hosted at
https://n8n.factory456.comfor user info refresh and Teams upload handling.
- The node expects proper configuration of credentials providing client ID and secret for the Bot Framework.
Troubleshooting
- Invalid webhook requests: If the incoming request does not contain a valid Bot Framework message type, the node responds with HTTP 400 and an error message.
- Message filtering: When filtering by message type, non-matching messages are ignored with HTTP 200 and an "ignored" status.
- User info retrieval failure: If fetching user info from the Bot Framework fails, the node still processes the message but returns a warning status indicating the failure.
- HTTP errors during typing activity notification: Errors sending "typing" activity back to Teams are logged but do not stop the workflow.
- File upload handling: If the upload URL is missing or malformed, the node may fail to forward the upload info correctly.
- Ensure the provided company code matches the required 6-digit pattern to avoid validation errors.
- Verify that the webhook path is unique and correctly configured in Teams to receive messages.