n8n-nodes-msteams-botframework 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Weon Software
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,113 +1,160 @@
1
1
  # n8n-nodes-msteams-botframework
2
2
 
3
- Custom n8n node để tương tác với Microsoft Teams thông qua Azure Bot Framework.
3
+ [![npm version](https://badge.fury.io/js/n8n-nodes-msteams-botframework.svg)](https://www.npmjs.com/package/n8n-nodes-msteams-botframework)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## Tính năng
6
+ n8n community node for Microsoft Teams Azure Bot Framework integration. Send messages, Adaptive Cards, and build AI-powered chatbots in Microsoft Teams.
6
7
 
7
- ### MS Teams Bot (Action Node)
8
- - ✉️ Gửi tin nhắn text đến channel hoặc user
9
- - 🎴 Gửi Adaptive Cards
10
- - 💬 Reply vào tin nhắn cụ thể
11
- - ✏️ Cập nhật tin nhắn đã gửi
12
- - 🗑️ Xóa tin nhắn
8
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
13
9
 
14
- ### MS Teams Bot Trigger (NEW in v1.1.0) 🎣
15
- - 📥 Nhận tin nhắn từ Teams qua webhook
16
- - 👥 Nhận thông báo khi có người join/leave
17
- - 👍 Nhận reactions vào tin nhắn
18
- - ✏️ Nhận thông báo khi message được edit
19
- - 🗑️ Nhận thông báo khi message bị xóa
20
- - 🤖 Tự động filter bot messages
21
- - ⌨️ Tự động gửi typing indicator
10
+ ## Features
22
11
 
23
- ## Yêu cầu
12
+ 🤖 **Complete Bot Framework Integration**
13
+ - Send text messages and rich Adaptive Cards
14
+ - Reply to, update, and delete messages
15
+ - Receive webhooks from Teams (messages, reactions, member changes)
16
+ - Full Azure Bot Framework Adapter support
24
17
 
25
- - n8n version 0.187.0 trở lên
26
- - Azure Bot Service đã được cấu hình
27
- - Microsoft App ID App Password
18
+ 🧠 **AI-Powered Chatbots**
19
+ - Seamless integration with n8n AI Agent
20
+ - Support for OpenAI, Claude, Azure OpenAI, and more
21
+ - Conversation memory (in-memory, Redis, Postgres, Pinecone)
22
+ - Function calling and custom tools
28
23
 
29
- ## Cài đặt
24
+ **Flexible Response Control**
25
+ - Immediate webhook responses
26
+ - Delayed responses (when workflow completes)
27
+ - Manual response control with Respond to Webhook node
30
28
 
31
- ### Cài đặt trong n8n Community Node
29
+ ## Installation
32
30
 
33
- 1. Trong n8n, vào **Settings** > **Community Nodes**
34
- 2. Chọn **Install** và nhập: `n8n-nodes-msteams-botframework`
35
- 3. Chấp nhận rủi ro và cài đặt
31
+ ### Community Nodes (Recommended)
36
32
 
37
- ### Cài đặt từ source (Development)
33
+ Install directly in n8n:
34
+
35
+ 1. Go to **Settings → Community Nodes**
36
+ 2. Click **Install**
37
+ 3. Enter `n8n-nodes-msteams-botframework`
38
+ 4. Click **Install**
39
+
40
+ ### Manual Installation
38
41
 
39
42
  ```bash
40
- # Clone repository
41
- git clone <repository-url>
42
- cd n8n-nodes-msteams-botframework
43
+ npm install n8n-nodes-msteams-botframework
44
+ ```
45
+
46
+ For production deployment with zero-downtime, see [Production Installation Guide](INSTALL-PRODUCTION.md).
47
+
48
+ ## Quick Start
49
+
50
+ ### 1. Setup Azure Bot
51
+
52
+ 1. Create an Azure Bot Service in Azure Portal
53
+ 2. Get your **Microsoft App ID** and **Microsoft App Password**
54
+ 3. Add credentials in n8n:
55
+ - Go to **Credentials → New**
56
+ - Select **MS Teams Bot Framework API**
57
+ - Enter App ID and Password
43
58
 
44
- # Cài đặt dependencies
45
- npm install
59
+ ### 2. Send a Message
46
60
 
47
- # Build
48
- npm run build
61
+ Add **MS Teams Bot Framework** node to your workflow:
49
62
 
50
- # Link vào n8n local
51
- npm link
52
- cd ~/.n8n/custom
53
- npm link n8n-nodes-msteams-botframework
63
+ ```
64
+ Operation: Send Message
65
+ Service URL: https://smba.trafficmanager.net/apis/
66
+ Conversation ID: [your-conversation-id]
67
+ Message: Hello from n8n!
54
68
  ```
55
69
 
56
- ## Cấu hình Azure Bot Service
70
+ ### 3. Receive Messages (Webhook)
57
71
 
58
- ### 1. Tạo Azure Bot
72
+ Add **MS Teams Bot Trigger** node:
59
73
 
60
- 1. Đăng nhập vào [Azure Portal](https://portal.azure.com)
61
- 2. Tạo **Azure Bot** resource mới
62
- 3. Chọn **Type of App**: Multi Tenant
63
- 4. Sau khi tạo, vào **Configuration** để lấy thông tin:
64
- - **Microsoft App ID**
65
- - **Microsoft App Password** (Client Secret)
74
+ 1. Copy the webhook URL from the node
75
+ 2. Configure it in Azure Bot Service → Configuration → Messaging endpoint
76
+ 3. Your workflow will trigger when users send messages
66
77
 
67
- ### 2. Cấu hình Teams Channel
78
+ ### 4. Build AI Chatbot
68
79
 
69
- 1. Trong Azure Bot, vào **Channels**
70
- 2. Thêm **Microsoft Teams** channel
71
- 3. Chấp nhận Terms of Service
72
- 4. Enable channel
80
+ Use n8n's built-in AI Agent for intelligent conversations:
73
81
 
74
- ### 3. Cấu hình Messaging Endpoint (Nếu cần nhận webhook)
82
+ ```
83
+ MS Teams Bot Trigger
84
+
85
+ AI Agent (+ Chat Model + Memory + Tools)
86
+
87
+ MS Teams Bot (Send Reply)
88
+ ```
75
89
 
76
- 1. Vào **Configuration** > **Messaging endpoint**
77
- 2. Nhập URL: `https://your-n8n-instance.com/webhook/msteams`
78
- 3. Lưu thay đổi
90
+ See [AI Agent Workflow Guide](AI-AGENT-WORKFLOW-GUIDE.md) for detailed setup.
79
91
 
80
- ## Sử dụng trong n8n
92
+ ## Available Nodes
81
93
 
82
- ### 1. Tạo Credentials
94
+ ### MS Teams Bot Framework (Action Node)
83
95
 
84
- 1. Trong n8n workflow, thêm node **MS Teams Bot Framework**
85
- 2. Tạo credential mới:
86
- - **Microsoft App ID**: Paste App ID từ Azure
87
- - **Microsoft App Password**: Paste App Password từ Azure
88
- 3. Lưu credential
96
+ **Operations:**
97
+ - **Send Message** - Send text messages to channels or users
98
+ - **Send Adaptive Card** - Send interactive Adaptive Cards
99
+ - **Reply to Message** - Reply to specific messages
100
+ - **Update Message** - Edit existing messages
101
+ - **Delete Message** - Remove messages
89
102
 
90
- ### 2. Gửi tin nhắn đơn giản
103
+ ### MS Teams Bot Trigger (Trigger Node)
91
104
 
92
- ```json
93
- {
94
- "operation": "sendMessage",
95
- "serviceUrl": "https://smba.trafficmanager.net/amer/",
96
- "conversationId": "19:meeting_xxx...",
97
- "messageText": "Hello from n8n!"
98
- }
99
- ```
105
+ **Supported Events:**
106
+ - Message Received
107
+ - Conversation Update (members join/leave)
108
+ - Message Reaction
109
+ - Message Update
110
+ - Message Delete
111
+
112
+ **Response Options:**
113
+ - Immediately (default)
114
+ - When Last Node Finishes
115
+ - Using Respond to Webhook Node
116
+
117
+ ### MS Teams AI Bot (Legacy)
118
+
119
+ Custom AI bot node with OpenAI/Claude integration. **Note:** We recommend using n8n's AI Agent instead for better flexibility.
120
+
121
+ ## Documentation
122
+
123
+ ### Getting Started
124
+ - [Quick Start Guide](QUICKSTART.md) - Get started in 5 minutes
125
+ - [Production Quick Start](PRODUCTION-QUICKSTART.md) - Deploy to production
100
126
 
101
- ### 3. Gửi Adaptive Card
127
+ ### Installation Guides
128
+ - [Detailed Installation (Vietnamese)](HUONG-DAN-CAI-DAT.md)
129
+ - [Production Installation](INSTALL-PRODUCTION.md)
130
+ - [Quick Installation](INSTALL-QUICK.md)
131
+
132
+ ### AI & Advanced Features
133
+ - [AI Agent Workflow Guide](AI-AGENT-WORKFLOW-GUIDE.md) - Build AI chatbots (Recommended)
134
+ - [AI Chatbot Guide](AI-CHATBOT-GUIDE.md) - Legacy custom AI bot
135
+ - [Webhook Guide](WEBHOOK-GUIDE.md) - Receive Teams events
136
+
137
+ ### Technical Documentation
138
+ - [Project Structure (Vietnamese)](CAU-TRUC-DU-AN.md)
139
+ - [NPM Publishing Guide](PUBLISH-NPM-GUIDE.md)
140
+ - [Changelog](CHANGELOG.md)
141
+
142
+ ### Example Workflows
143
+ - [Basic Workflow](example-workflow.json) - Send messages and cards
144
+ - [Webhook Workflow](example-webhook-workflow.json) - Receive and respond to messages
145
+ - [AI Agent Complete](example-ai-agent-complete.json) - Full AI chatbot setup
146
+
147
+ ## Usage Examples
148
+
149
+ ### Send an Adaptive Card
102
150
 
103
151
  ```json
104
152
  {
105
153
  "operation": "sendAdaptiveCard",
106
- "serviceUrl": "https://smba.trafficmanager.net/amer/",
107
- "conversationId": "19:meeting_xxx...",
108
- "adaptiveCardJson": {
154
+ "serviceUrl": "https://smba.trafficmanager.net/apis/",
155
+ "conversationId": "19:meeting_xxx",
156
+ "cardJson": {
109
157
  "type": "AdaptiveCard",
110
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
111
158
  "version": "1.4",
112
159
  "body": [
113
160
  {
@@ -115,126 +162,87 @@ npm link n8n-nodes-msteams-botframework
115
162
  "text": "Hello from n8n!",
116
163
  "size": "Large",
117
164
  "weight": "Bolder"
118
- },
119
- {
120
- "type": "TextBlock",
121
- "text": "This is an Adaptive Card",
122
- "wrap": true
123
- }
124
- ],
125
- "actions": [
126
- {
127
- "type": "Action.OpenUrl",
128
- "title": "Learn More",
129
- "url": "https://n8n.io"
130
165
  }
131
166
  ]
132
167
  }
133
168
  }
134
169
  ```
135
170
 
136
- ### 4. Reply vào tin nhắn
171
+ ### AI Chatbot with Memory
137
172
 
138
- ```json
139
- {
140
- "operation": "replyToMessage",
141
- "serviceUrl": "https://smba.trafficmanager.net/amer/",
142
- "conversationId": "19:meeting_xxx...",
143
- "activityId": "1234567890",
144
- "replyText": "This is a reply!"
145
- }
173
+ ```
174
+ Trigger: MS Teams Bot Trigger
175
+
176
+ AI Agent:
177
+ - Chat Model: OpenAI (gpt-3.5-turbo)
178
+ - Memory: Window Buffer Memory (session: conversation.id)
179
+ - System: "You are a helpful assistant"
180
+
181
+ Action: MS Teams Send Reply
146
182
  ```
147
183
 
148
- ## Lấy thông tin cần thiết
149
-
150
- ### Service URL
151
-
152
- Service URL thường có trong webhook payload từ Teams. Các giá trị phổ biến:
153
- - `https://smba.trafficmanager.net/amer/` (Americas)
154
- - `https://smba.trafficmanager.net/emea/` (Europe/Middle East/Africa)
155
- - `https://smba.trafficmanager.net/apac/` (Asia Pacific)
156
-
157
- ### Conversation ID
158
-
159
- Conversation ID có thể lấy từ:
160
- - Webhook payload khi nhận tin nhắn từ Teams
161
- - Teams URL (phần sau `conversations/`)
162
- - Graph API
163
-
164
- Ví dụ: `19:meeting_MjdhNjc4...@thread.v2`
184
+ See [AI-AGENT-WORKFLOW-GUIDE.md](AI-AGENT-WORKFLOW-GUIDE.md) for complete examples.
165
185
 
166
- ### Activity ID
186
+ ## Credentials
167
187
 
168
- Activity ID ID của tin nhắn, có thể lấy từ:
169
- - Response khi gửi tin nhắn (trả về `activityId`)
170
- - Webhook payload khi nhận tin nhắn
188
+ Create credentials in n8n:
171
189
 
172
- ## dụ Workflow
190
+ 1. **Credential Type:** MS Teams Bot Framework API
191
+ 2. **Required Fields:**
192
+ - **Microsoft App ID** - From Azure Bot Service
193
+ - **Microsoft App Password** - From Azure Bot Service
173
194
 
174
- ### Workflow 1: Nhận webhook reply
195
+ Get these from Azure Portal Bot Services → Your Bot → Configuration.
175
196
 
176
- ```
177
- Webhook Trigger (MS Teams)
178
-
179
- MS Teams Bot Framework (Reply to Message)
180
-
181
- [Success]
182
- ```
197
+ ## Compatibility
183
198
 
184
- ### Workflow 2: Schedule message với Adaptive Card
199
+ - **n8n version:** 0.200.0 or later
200
+ - **Node.js:** 18.x or later
201
+ - **Dependencies:**
202
+ - `botbuilder` ^4.20.0
203
+ - `axios` ^1.6.0
185
204
 
186
- ```
187
- Schedule Trigger (Cron)
188
-
189
- MS Teams Bot Framework (Send Adaptive Card)
190
-
191
- [Success]
192
- ```
205
+ ## Roadmap
193
206
 
194
- ### Workflow 3: Theo dõi GitHub và thông báo Teams
207
+ ### Planned Features
208
+ - File attachments support
209
+ - Bot mentions (@bot)
210
+ - Proactive messaging
211
+ - Meeting notifications
212
+ - Calendar integration
213
+ - Graph API integration
195
214
 
196
- ```
197
- GitHub Trigger (On Push)
198
-
199
- Function (Format message)
200
-
201
- MS Teams Bot Framework (Send Message)
202
-
203
- [Success]
204
- ```
215
+ See [CHANGELOG.md](CHANGELOG.md) for version history and upcoming features.
205
216
 
206
- ## Troubleshooting
217
+ ## Contributing
207
218
 
208
- ### Lỗi 401 Unauthorized
209
- - Kiểm tra lại App ID và App Password
210
- - Đảm bảo Bot đã được add vào Team/Channel
211
- - Verify token chưa hết hạn
219
+ Contributions are welcome! Please feel free to submit a Pull Request.
212
220
 
213
- ### Lỗi 404 Not Found
214
- - Kiểm tra Service URL đúng không
215
- - Verify Conversation ID còn tồn tại
216
- - Đảm bảo bot còn trong conversation
221
+ 1. Fork the repository
222
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
223
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
224
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
225
+ 5. Open a Pull Request
217
226
 
218
- ### Adaptive Card không hiển thị
219
- - Validate JSON schema tại [Adaptive Cards Designer](https://adaptivecards.io/designer/)
220
- - Kiểm tra version phù hợp với Teams (khuyến nghị 1.4)
221
- - Đảm bảo cú pháp JSON đúng
227
+ ## Support
222
228
 
223
- ## Tài liệu tham khảo
229
+ For issues, questions, or feature requests:
224
230
 
225
- - [Azure Bot Service Documentation](https://docs.microsoft.com/en-us/azure/bot-service/)
226
- - [Bot Framework REST API](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference)
227
- - [Adaptive Cards](https://adaptivecards.io/)
228
- - [Teams Bot Overview](https://docs.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots)
231
+ - **GitHub Issues:** [github.com/weon-software/n8n-nodes-msteams-botframework/issues](https://github.com/weon-software/n8n-nodes-msteams-botframework/issues)
232
+ - **n8n Community:** [community.n8n.io](https://community.n8n.io/)
233
+ - **Email:** doannv@weon.vn
229
234
 
230
- ## Đóng góp
235
+ ## License
231
236
 
232
- Contributions, issues và feature requests đều được chào đón!
237
+ [MIT](LICENSE)
233
238
 
234
- ## License
239
+ ## Credits
235
240
 
236
- MIT
241
+ **Developed by:** [Weon Software](https://weon.vn)
242
+ **Author:** Doan Nguyen Van
243
+ **Email:** doannv@weon.vn
244
+ **Website:** https://weon.vn
237
245
 
238
- ## Tác giả
246
+ ---
239
247
 
240
- Tạo bởi cộng đồng n8n
248
+ **Keywords:** n8n, Microsoft Teams, Bot Framework, Azure, chatbot, workflow automation, AI agent, OpenAI, Claude, Adaptive Cards
@@ -194,10 +194,12 @@ class MsTeamsBotFrameworkTrigger {
194
194
  const activity = context.activity;
195
195
  // Check if we should process this activity type
196
196
  if (!events.includes(activity.type)) {
197
+ shouldTrigger = false;
197
198
  return;
198
199
  }
199
200
  // Ignore bot messages if configured
200
201
  if (options.ignoreBotMessages && ((_a = activity.from) === null || _a === void 0 ? void 0 : _a.role) === 'bot') {
202
+ shouldTrigger = false;
201
203
  return;
202
204
  }
203
205
  shouldTrigger = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-msteams-botframework",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "n8n node for MS Teams Azure Bot Framework",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",