Teams Webhook
Teams Webhook
This component acts as a listener for Microsoft Teams. It waits for changes in the teams, channels, or chats you select, such as new messages, new channels, or new members, and sends that information to your workflow. This allows you to automate tasks based on what happens in Teams in real time.
How it Works
The component connects securely to Microsoft Teams using the Graph API. Once configured, it keeps an active connection to receive alerts instantly. When a change occurs in the monitored resources, Microsoft sends a notification to Nappai. The component captures this data, extracts the relevant details, and passes the information to the next steps in your workflow so you can react automatically.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with Microsoft Teams:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type Microsoft Teams and fill in the required fields (Client ID, Client Secret, Tenant ID, and Microsoft Teams Scope).
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
The following fields are available to configure this component:
- Event: Select which Microsoft Teams event triggers this flow. Options include new channels, channel messages, chat messages, and new members.
- Team: The team to monitor. Only teams you have joined are listed. The list of channels updates automatically when you change the team.
- Channel: The channel to monitor for new messages. The list refreshes automatically when the selected team changes.
- Chat: The chat conversations to monitor. Select one or more chats. The interface shows the other participant for 1-on-1 chats or the topic and members for group chats.
- Ignore Own Messages: When enabled, messages sent by the authenticated user are ignored to prevent infinite loops in your automation.
Outputs
The component produces data describing the event that occurred in Microsoft Teams. You can use this data to trigger actions in other components, such as updating records, sending notifications, or running AI analysis.
Output Data Example (JSON)json
{ “notification_payload”: { “resourceUrl”: “https://graph.microsoft.com/v1.0/teams/…/messages/…”, “changeType”: “created”, “resourceData”: { “id”: “12345”, “body”: { “contentType”: “text”, “content”: “Hello Team, new task assigned.” } }, “clientState”: “optional-state”, “expirationDateTime”: “2023-10-27T10:30:00Z” }, “event_type”: “created”, “resource_url”: “https://graph.microsoft.com/v1.0/teams/…/messages/…”, “client_state”: “optional-state”, “status_code”: 202 }
Connectivity
This component is typically used as a trigger in your workflow. It should be connected to other components that you want to execute when a Teams event occurs. For example, you can connect this component to an AI Assistant to analyze messages, to a Send Email component to notify a manager, or to a Database component to log chat activity. Connect the output of this node to the inputs of the actions you wish to automate.
Usage Example
Scenario: Notify Manager on New Channel Messages
- Add a Teams Webhook component and select a Team and Channel to monitor.
- Set Event to “On new channel message”.
- Enable Ignore Own Messages if you do not want to react to your own posts.
- Connect this webhook to an Email component.
- In the email body, map the message content from the webhook output. Result: When anyone posts a new message in the selected channel (except you), an email is automatically sent to the manager.
Tips and Best Practices
- Enable Ignore Own Messages to avoid infinite loops where a webhook triggers an action that sends a message, which triggers the webhook again.
- The component automatically manages subscription renewal, so you do not need to worry about the configuration expiring.
- Select specific channels or chats to monitor to ensure you only receive relevant notifications and reduce unnecessary data.
- Use the Event field to filter the types of changes you care about, such as focusing only on new messages or new team members.
Security Considerations
This component uses secure OAuth 2.0 authentication via Microsoft Entra ID. Ensure you configure the credential with the minimum necessary permissions (scopes) required for your workflow. The component validates incoming requests to ensure they originate from Microsoft, protecting your automation from unauthorized notifications.