@lixiongwei/n8n-nodes-feishu 1.0.1 → 2.0.0
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/README.md +103 -37
- package/credentials/FeishuApi.credentials.js +23 -5
- package/nodes/Feishu/Feishu.node.js +619 -192
- package/nodes/Feishu/FeishuTrigger.node.js +65 -42
- package/nodes/Feishu/errors.d.ts +4 -0
- package/nodes/Feishu/errors.js +42 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,72 +1,138 @@
|
|
|
1
|
-
# n8n-nodes-feishu
|
|
1
|
+
# @lixiongwei/n8n-nodes-feishu
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Feishu / Lark** integration nodes for n8n — messaging, Bitable CRUD, approvals, calendar & contacts.
|
|
4
|
+
> Free tier + Pro License. Includes workflow templates.
|
|
4
5
|
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## 📦 Install
|
|
8
9
|
|
|
9
10
|
```bash
|
|
10
11
|
npm install @lixiongwei/n8n-nodes-feishu
|
|
11
12
|
```
|
|
12
13
|
|
|
13
|
-
n8n
|
|
14
|
+
Requires: n8n self-hosted. (n8n Cloud does not support community nodes.)
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## 🎮 Capabilities
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
20
|
+
### 🆓 Free
|
|
21
|
+
|
|
22
|
+
| Category | Operation | Description |
|
|
23
|
+
|----------|-----------|-------------|
|
|
24
|
+
| **Messaging** | Send Text Message | Send plain text to users or groups |
|
|
25
|
+
| **Trigger** | Message Received | Webhook — fires when the bot receives a message |
|
|
26
|
+
|
|
27
|
+
### ⭐ Pro — $49 one-time ([get a key](https://1717465779306.gumroad.com/l/feishu-pro))
|
|
28
|
+
|
|
29
|
+
| Category | Operations |
|
|
30
|
+
|----------|------------|
|
|
31
|
+
| **Messaging** | Send Card Message (with Markdown & color), Send Image, Send File, Batch Send to multiple recipients |
|
|
32
|
+
| **Bitable** | Read Records, Create Record, Update Record, Delete Record, Search Records, List Tables |
|
|
33
|
+
| **Approvals** | List Pending, Get Detail, Approve, Reject |
|
|
34
|
+
| **Calendar** | List Events, Create Event |
|
|
35
|
+
| **Contacts** | Get User Info (by Open ID / Email / Mobile), Search Users |
|
|
23
36
|
|
|
24
37
|
---
|
|
25
38
|
|
|
26
|
-
##
|
|
39
|
+
## 🚀 Quick Start (3 steps)
|
|
40
|
+
|
|
41
|
+
### 1. Create a Feishu/Lark app
|
|
42
|
+
|
|
43
|
+
1. Go to [Feishu Dev Console](https://open.feishu.cn/) (or [Lark Dev Console](https://open.larksuite.com/))
|
|
44
|
+
2. Create an **Enterprise Internal App**
|
|
45
|
+
3. Enable **Bot** capability (App Capabilities → Bot → Enable)
|
|
46
|
+
4. Go to **Permissions** → add at minimum:
|
|
47
|
+
- `im:message:send_as_bot` (send messages)
|
|
48
|
+
- `contact:contact.base:readonly` (for Contacts operations)
|
|
49
|
+
5. Go to **Version Management** → Create version → **Publish**
|
|
50
|
+
6. Copy your **App ID** and **App Secret** from Credentials & Basic Info
|
|
27
51
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
52
|
+
### 2. Configure n8n
|
|
53
|
+
|
|
54
|
+
1. n8n → **Credentials** → New → search `Feishu` → select **Feishu / Lark API**
|
|
55
|
+
2. Choose your platform (Feishu for China, Lark for International)
|
|
56
|
+
3. Enter App ID + App Secret
|
|
57
|
+
4. (Optional) Enter License Key for Pro features
|
|
58
|
+
|
|
59
|
+
### 3. Start building
|
|
60
|
+
|
|
61
|
+
Drag the **Feishu / Lark** node onto your canvas → select a Resource → select an Operation → configure → test.
|
|
34
62
|
|
|
35
63
|
---
|
|
36
64
|
|
|
37
|
-
##
|
|
65
|
+
## 📋 Included Workflow Templates
|
|
38
66
|
|
|
39
|
-
|
|
67
|
+
Import these from `node_modules/@lixiongwei/n8n-nodes-feishu/workflows/` or from the [GitHub repo](https://github.com/lixiongwei/n8n-nodes-feishu):
|
|
40
68
|
|
|
41
|
-
|
|
69
|
+
| # | File | What it does |
|
|
70
|
+
|---|------|-------------|
|
|
71
|
+
| 1 | `template-01-send-message.json` | External Webhook → Feishu text message (CI/CD alerts, form notifications) |
|
|
72
|
+
| 2 | `template-02-cron-reminder.json` | Scheduled → Feishu reminder (daily standup, deadline alerts) |
|
|
73
|
+
| 3 | `template-03-website-monitor.json` | Monitor website health → Feishu alert on downtime |
|
|
74
|
+
| 4 | `template-04-form-notify.json` | Form submission → Feishu card notification |
|
|
75
|
+
| 5 | `template-05-api-to-feishu.json` | Pull external API data → format → push to Feishu |
|
|
42
76
|
|
|
43
77
|
---
|
|
44
78
|
|
|
45
|
-
##
|
|
79
|
+
## 🔧 Common Patterns
|
|
46
80
|
|
|
47
|
-
|
|
81
|
+
| I want to... | Use this setup |
|
|
82
|
+
|-------------|---------------|
|
|
83
|
+
| Get alerts when my site goes down | Template 03 — Cron + HTTP Check + If + Feishu Message |
|
|
84
|
+
| Send a daily report to my team | Template 02 — Cron + Feishu Card Message |
|
|
85
|
+
| Track form submissions in Bitable | Webhook → Feishu Bitable Create Record → Feishu Card to notify team |
|
|
86
|
+
| Auto-approve simple requests | Feishu Trigger (Approval) → If (conditions) → Approve Instance |
|
|
87
|
+
| Search users for open_ids | Contacts → Search Users → use output in subsequent Message node |
|
|
88
|
+
| Build a bot that replies to messages | Feishu Trigger (Message) → AI/Logic → Feishu Send Text Message |
|
|
89
|
+
|
|
90
|
+
---
|
|
48
91
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
|
52
|
-
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
92
|
+
## ⚠️ Troubleshooting
|
|
93
|
+
|
|
94
|
+
| Error | Cause | Fix |
|
|
95
|
+
|-------|-------|-----|
|
|
96
|
+
| `Bot ability not activated (230006)` | Bot not enabled in app | App Capabilities → Enable Bot → Republish |
|
|
97
|
+
| `Permission denied (99991672)` | Missing API scope | Permissions → Add required scope → Republish |
|
|
98
|
+
| `Recipient ID not found (99992351)` | Wrong ID type or not in app scope | Use Contacts → Get User Info to find the correct ID |
|
|
99
|
+
| `Invalid tenant access token` | Wrong App ID or Secret | Double-check from Developer Console → Credentials |
|
|
100
|
+
| `This is a Pro feature` | No license key | Get one at the Gumroad link, or use a Free operation |
|
|
101
|
+
| Workflow stuck spinning | Method is GET instead of POST | Check the node configuration — content-sending operations need POST |
|
|
102
|
+
| Webhook URL not receiving events | App not configured for events | Add Request URL in Feishu Dev Console → Event Subscriptions |
|
|
56
103
|
|
|
57
104
|
---
|
|
58
105
|
|
|
59
|
-
##
|
|
106
|
+
## 🌍 Feishu vs Lark
|
|
107
|
+
|
|
108
|
+
Feishu (飞书) and Lark share the same API but use **different domains**:
|
|
109
|
+
|
|
110
|
+
| Platform | API Base | Used in |
|
|
111
|
+
|----------|----------|---------|
|
|
112
|
+
| Feishu | `open.feishu.cn` | China |
|
|
113
|
+
| Lark | `open.larksuite.com` | International (Singapore, US, etc.) |
|
|
60
114
|
|
|
61
|
-
|
|
62
|
-
2. 开启 **机器人** 能力
|
|
63
|
-
3. 权限管理开通:`im:message:send_as_bot`
|
|
64
|
-
4. 发布应用
|
|
65
|
-
5. 在 n8n 凭证中填入 App ID + App Secret + License Key
|
|
115
|
+
Choose the correct platform in your n8n credentials. If you get `99991663` errors, you likely have the wrong platform selected.
|
|
66
116
|
|
|
67
117
|
---
|
|
68
118
|
|
|
69
|
-
##
|
|
119
|
+
## 💰 License
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
npm install → FREE features work immediately
|
|
123
|
+
↓
|
|
124
|
+
Try Pro operation → prompted for License Key
|
|
125
|
+
↓
|
|
126
|
+
Get Key: https://1717465779306.gumroad.com/l/feishu-pro
|
|
127
|
+
↓
|
|
128
|
+
Enter Key in credentials → ALL features unlocked forever
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
One-time payment. No subscription. Lifetime access.
|
|
132
|
+
|
|
133
|
+
---
|
|
70
134
|
|
|
71
|
-
- n8n
|
|
72
|
-
-
|
|
135
|
+
- **n8n version**: 1.x+ (v2 recommended)
|
|
136
|
+
- **Feishu API**: v3
|
|
137
|
+
- **License**: MIT
|
|
138
|
+
- **Support**: Reply on [n8n Community Forum](https://community.n8n.io/c/community-nodes/11)
|
|
@@ -4,15 +4,34 @@ exports.FeishuApi = void 0;
|
|
|
4
4
|
class FeishuApi {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.name = 'feishuApi';
|
|
7
|
-
this.displayName = '
|
|
7
|
+
this.displayName = 'Feishu / Lark API';
|
|
8
8
|
this.documentationUrl = 'https://open.feishu.cn/document/home/getting-started';
|
|
9
9
|
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Platform',
|
|
12
|
+
name: 'platform',
|
|
13
|
+
type: 'options',
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Feishu (飞书) — China',
|
|
17
|
+
value: 'feishu',
|
|
18
|
+
description: 'API domain: open.feishu.cn',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Lark — International',
|
|
22
|
+
value: 'lark',
|
|
23
|
+
description: 'API domain: open.larksuite.com',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
default: 'feishu',
|
|
27
|
+
description: 'Choose Feishu for China, Lark for international users',
|
|
28
|
+
},
|
|
10
29
|
{
|
|
11
30
|
displayName: 'App ID',
|
|
12
31
|
name: 'appId',
|
|
13
32
|
type: 'string',
|
|
14
33
|
default: '',
|
|
15
|
-
description: '
|
|
34
|
+
description: 'From Developer Console → Credentials & Basic Info',
|
|
16
35
|
required: true,
|
|
17
36
|
},
|
|
18
37
|
{
|
|
@@ -21,15 +40,14 @@ class FeishuApi {
|
|
|
21
40
|
type: 'string',
|
|
22
41
|
typeOptions: { password: true },
|
|
23
42
|
default: '',
|
|
24
|
-
description: '飞书应用的 App Secret',
|
|
25
43
|
required: true,
|
|
26
44
|
},
|
|
27
45
|
{
|
|
28
|
-
displayName: 'License Key',
|
|
46
|
+
displayName: 'License Key (optional)',
|
|
29
47
|
name: 'licenseKey',
|
|
30
48
|
type: 'string',
|
|
31
49
|
default: '',
|
|
32
|
-
description: 'Pro License Key
|
|
50
|
+
description: 'Pro License Key → Unlock all features. Leave empty for free features. Get one: https://1717465779306.gumroad.com/l/feishu-pro',
|
|
33
51
|
required: false,
|
|
34
52
|
},
|
|
35
53
|
];
|