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 +21 -0
- package/README.md +176 -168
- package/dist/nodes/MsTeamsBotFramework/MsTeamsBotFrameworkTrigger.node.js +2 -0
- package/package.json +1 -1
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
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/n8n-nodes-msteams-botframework)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
29
|
+
## Installation
|
|
32
30
|
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
45
|
-
npm install
|
|
59
|
+
### 2. Send a Message
|
|
46
60
|
|
|
47
|
-
|
|
48
|
-
npm run build
|
|
61
|
+
Add **MS Teams Bot Framework** node to your workflow:
|
|
49
62
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
70
|
+
### 3. Receive Messages (Webhook)
|
|
57
71
|
|
|
58
|
-
|
|
72
|
+
Add **MS Teams Bot Trigger** node:
|
|
59
73
|
|
|
60
|
-
1.
|
|
61
|
-
2.
|
|
62
|
-
3.
|
|
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
|
-
###
|
|
78
|
+
### 4. Build AI Chatbot
|
|
68
79
|
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
92
|
+
## Available Nodes
|
|
81
93
|
|
|
82
|
-
###
|
|
94
|
+
### MS Teams Bot Framework (Action Node)
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
###
|
|
103
|
+
### MS Teams Bot Trigger (Trigger Node)
|
|
91
104
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
###
|
|
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/
|
|
107
|
-
"conversationId": "19:meeting_xxx
|
|
108
|
-
"
|
|
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
|
-
###
|
|
171
|
+
### AI Chatbot with Memory
|
|
137
172
|
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
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
|
-
|
|
186
|
+
## Credentials
|
|
167
187
|
|
|
168
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
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
|
-
##
|
|
217
|
+
## Contributing
|
|
207
218
|
|
|
208
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
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
|
-
|
|
229
|
+
For issues, questions, or feature requests:
|
|
224
230
|
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
-
|
|
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
|
-
##
|
|
235
|
+
## License
|
|
231
236
|
|
|
232
|
-
|
|
237
|
+
[MIT](LICENSE)
|
|
233
238
|
|
|
234
|
-
##
|
|
239
|
+
## Credits
|
|
235
240
|
|
|
236
|
-
|
|
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
|
-
|
|
246
|
+
---
|
|
239
247
|
|
|
240
|
-
|
|
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;
|