@renatoascencio/n8n-nodes-chatwoot 0.1.2 → 0.2.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.
Files changed (149) hide show
  1. package/README.md +314 -80
  2. package/dist/nodes/Chatwoot/Chatwoot.node.d.ts +9 -0
  3. package/dist/nodes/Chatwoot/Chatwoot.node.js +383 -77
  4. package/dist/nodes/Chatwoot/Chatwoot.node.js.map +1 -1
  5. package/dist/nodes/Chatwoot/Chatwoot.node.json +22 -0
  6. package/dist/nodes/Chatwoot/ChatwootTrigger.node.d.ts +12 -0
  7. package/dist/nodes/Chatwoot/ChatwootTrigger.node.js +197 -0
  8. package/dist/nodes/Chatwoot/ChatwootTrigger.node.js.map +1 -0
  9. package/dist/nodes/Chatwoot/ChatwootTrigger.node.json +22 -0
  10. package/dist/nodes/Chatwoot/GenericFunctions.d.ts +5 -1
  11. package/dist/nodes/Chatwoot/GenericFunctions.js +71 -0
  12. package/dist/nodes/Chatwoot/GenericFunctions.js.map +1 -1
  13. package/dist/nodes/Chatwoot/chatwoot.svg +10 -6
  14. package/dist/nodes/Chatwoot/resources/account/get.operation.d.ts +2 -0
  15. package/dist/nodes/Chatwoot/resources/account/get.operation.js +5 -0
  16. package/dist/nodes/Chatwoot/resources/account/get.operation.js.map +1 -0
  17. package/dist/nodes/Chatwoot/resources/account/index.d.ts +3 -0
  18. package/dist/nodes/Chatwoot/resources/account/index.js +36 -0
  19. package/dist/nodes/Chatwoot/resources/account/index.js.map +1 -0
  20. package/dist/nodes/Chatwoot/resources/account/update.operation.d.ts +2 -0
  21. package/dist/nodes/Chatwoot/resources/account/update.operation.js +75 -0
  22. package/dist/nodes/Chatwoot/resources/account/update.operation.js.map +1 -0
  23. package/dist/nodes/Chatwoot/resources/agent/create.operation.d.ts +2 -0
  24. package/dist/nodes/Chatwoot/resources/agent/create.operation.js +95 -0
  25. package/dist/nodes/Chatwoot/resources/agent/create.operation.js.map +1 -0
  26. package/dist/nodes/Chatwoot/resources/agent/delete.operation.d.ts +2 -0
  27. package/dist/nodes/Chatwoot/resources/agent/delete.operation.js +23 -0
  28. package/dist/nodes/Chatwoot/resources/agent/delete.operation.js.map +1 -0
  29. package/dist/nodes/Chatwoot/resources/agent/getAll.operation.d.ts +2 -0
  30. package/dist/nodes/Chatwoot/resources/agent/getAll.operation.js +5 -0
  31. package/dist/nodes/Chatwoot/resources/agent/getAll.operation.js.map +1 -0
  32. package/dist/nodes/Chatwoot/resources/agent/index.d.ts +3 -0
  33. package/dist/nodes/Chatwoot/resources/agent/index.js +52 -0
  34. package/dist/nodes/Chatwoot/resources/agent/index.js.map +1 -0
  35. package/dist/nodes/Chatwoot/resources/agent/update.operation.d.ts +2 -0
  36. package/dist/nodes/Chatwoot/resources/agent/update.operation.js +75 -0
  37. package/dist/nodes/Chatwoot/resources/agent/update.operation.js.map +1 -0
  38. package/dist/nodes/Chatwoot/resources/cannedResponse/create.operation.d.ts +2 -0
  39. package/dist/nodes/Chatwoot/resources/cannedResponse/create.operation.js +38 -0
  40. package/dist/nodes/Chatwoot/resources/cannedResponse/create.operation.js.map +1 -0
  41. package/dist/nodes/Chatwoot/resources/cannedResponse/delete.operation.d.ts +2 -0
  42. package/dist/nodes/Chatwoot/resources/cannedResponse/delete.operation.js +20 -0
  43. package/dist/nodes/Chatwoot/resources/cannedResponse/delete.operation.js.map +1 -0
  44. package/dist/nodes/Chatwoot/resources/cannedResponse/getAll.operation.d.ts +2 -0
  45. package/dist/nodes/Chatwoot/resources/cannedResponse/getAll.operation.js +28 -0
  46. package/dist/nodes/Chatwoot/resources/cannedResponse/getAll.operation.js.map +1 -0
  47. package/dist/nodes/Chatwoot/resources/cannedResponse/index.d.ts +3 -0
  48. package/dist/nodes/Chatwoot/resources/cannedResponse/index.js +52 -0
  49. package/dist/nodes/Chatwoot/resources/cannedResponse/index.js.map +1 -0
  50. package/dist/nodes/Chatwoot/resources/cannedResponse/update.operation.d.ts +2 -0
  51. package/dist/nodes/Chatwoot/resources/cannedResponse/update.operation.js +52 -0
  52. package/dist/nodes/Chatwoot/resources/cannedResponse/update.operation.js.map +1 -0
  53. package/dist/nodes/Chatwoot/resources/contact/getConversations.operation.d.ts +2 -0
  54. package/dist/nodes/Chatwoot/resources/contact/getConversations.operation.js +20 -0
  55. package/dist/nodes/Chatwoot/resources/contact/getConversations.operation.js.map +1 -0
  56. package/dist/nodes/Chatwoot/resources/contact/index.js +16 -0
  57. package/dist/nodes/Chatwoot/resources/contact/index.js.map +1 -1
  58. package/dist/nodes/Chatwoot/resources/contact/merge.operation.d.ts +2 -0
  59. package/dist/nodes/Chatwoot/resources/contact/merge.operation.js +34 -0
  60. package/dist/nodes/Chatwoot/resources/contact/merge.operation.js.map +1 -0
  61. package/dist/nodes/Chatwoot/resources/conversation/addLabels.operation.d.ts +2 -0
  62. package/dist/nodes/Chatwoot/resources/conversation/addLabels.operation.js +37 -0
  63. package/dist/nodes/Chatwoot/resources/conversation/addLabels.operation.js.map +1 -0
  64. package/dist/nodes/Chatwoot/resources/conversation/assign.operation.d.ts +2 -0
  65. package/dist/nodes/Chatwoot/resources/conversation/assign.operation.js +87 -0
  66. package/dist/nodes/Chatwoot/resources/conversation/assign.operation.js.map +1 -0
  67. package/dist/nodes/Chatwoot/resources/conversation/index.js +16 -0
  68. package/dist/nodes/Chatwoot/resources/conversation/index.js.map +1 -1
  69. package/dist/nodes/Chatwoot/resources/customAttribute/create.operation.d.ts +2 -0
  70. package/dist/nodes/Chatwoot/resources/customAttribute/create.operation.js +122 -0
  71. package/dist/nodes/Chatwoot/resources/customAttribute/create.operation.js.map +1 -0
  72. package/dist/nodes/Chatwoot/resources/customAttribute/delete.operation.d.ts +2 -0
  73. package/dist/nodes/Chatwoot/resources/customAttribute/delete.operation.js +20 -0
  74. package/dist/nodes/Chatwoot/resources/customAttribute/delete.operation.js.map +1 -0
  75. package/dist/nodes/Chatwoot/resources/customAttribute/get.operation.d.ts +2 -0
  76. package/dist/nodes/Chatwoot/resources/customAttribute/get.operation.js +20 -0
  77. package/dist/nodes/Chatwoot/resources/customAttribute/get.operation.js.map +1 -0
  78. package/dist/nodes/Chatwoot/resources/customAttribute/getAll.operation.d.ts +2 -0
  79. package/dist/nodes/Chatwoot/resources/customAttribute/getAll.operation.js +32 -0
  80. package/dist/nodes/Chatwoot/resources/customAttribute/getAll.operation.js.map +1 -0
  81. package/dist/nodes/Chatwoot/resources/customAttribute/index.d.ts +3 -0
  82. package/dist/nodes/Chatwoot/resources/customAttribute/index.js +60 -0
  83. package/dist/nodes/Chatwoot/resources/customAttribute/index.js.map +1 -0
  84. package/dist/nodes/Chatwoot/resources/customAttribute/update.operation.d.ts +2 -0
  85. package/dist/nodes/Chatwoot/resources/customAttribute/update.operation.js +64 -0
  86. package/dist/nodes/Chatwoot/resources/customAttribute/update.operation.js.map +1 -0
  87. package/dist/nodes/Chatwoot/resources/inbox/get.operation.d.ts +2 -0
  88. package/dist/nodes/Chatwoot/resources/inbox/get.operation.js +23 -0
  89. package/dist/nodes/Chatwoot/resources/inbox/get.operation.js.map +1 -0
  90. package/dist/nodes/Chatwoot/resources/inbox/getAll.operation.d.ts +2 -0
  91. package/dist/nodes/Chatwoot/resources/inbox/getAll.operation.js +5 -0
  92. package/dist/nodes/Chatwoot/resources/inbox/getAll.operation.js.map +1 -0
  93. package/dist/nodes/Chatwoot/resources/inbox/index.d.ts +3 -0
  94. package/dist/nodes/Chatwoot/resources/inbox/index.js +44 -0
  95. package/dist/nodes/Chatwoot/resources/inbox/index.js.map +1 -0
  96. package/dist/nodes/Chatwoot/resources/inbox/update.operation.d.ts +2 -0
  97. package/dist/nodes/Chatwoot/resources/inbox/update.operation.js +143 -0
  98. package/dist/nodes/Chatwoot/resources/inbox/update.operation.js.map +1 -0
  99. package/dist/nodes/Chatwoot/resources/label/create.operation.d.ts +2 -0
  100. package/dist/nodes/Chatwoot/resources/label/create.operation.js +56 -0
  101. package/dist/nodes/Chatwoot/resources/label/create.operation.js.map +1 -0
  102. package/dist/nodes/Chatwoot/resources/label/delete.operation.d.ts +2 -0
  103. package/dist/nodes/Chatwoot/resources/label/delete.operation.js +23 -0
  104. package/dist/nodes/Chatwoot/resources/label/delete.operation.js.map +1 -0
  105. package/dist/nodes/Chatwoot/resources/label/getAll.operation.d.ts +2 -0
  106. package/dist/nodes/Chatwoot/resources/label/getAll.operation.js +5 -0
  107. package/dist/nodes/Chatwoot/resources/label/getAll.operation.js.map +1 -0
  108. package/dist/nodes/Chatwoot/resources/label/index.d.ts +3 -0
  109. package/dist/nodes/Chatwoot/resources/label/index.js +52 -0
  110. package/dist/nodes/Chatwoot/resources/label/index.js.map +1 -0
  111. package/dist/nodes/Chatwoot/resources/label/update.operation.d.ts +2 -0
  112. package/dist/nodes/Chatwoot/resources/label/update.operation.js +66 -0
  113. package/dist/nodes/Chatwoot/resources/label/update.operation.js.map +1 -0
  114. package/dist/nodes/Chatwoot/resources/team/create.operation.d.ts +2 -0
  115. package/dist/nodes/Chatwoot/resources/team/create.operation.js +49 -0
  116. package/dist/nodes/Chatwoot/resources/team/create.operation.js.map +1 -0
  117. package/dist/nodes/Chatwoot/resources/team/delete.operation.d.ts +2 -0
  118. package/dist/nodes/Chatwoot/resources/team/delete.operation.js +23 -0
  119. package/dist/nodes/Chatwoot/resources/team/delete.operation.js.map +1 -0
  120. package/dist/nodes/Chatwoot/resources/team/get.operation.d.ts +2 -0
  121. package/dist/nodes/Chatwoot/resources/team/get.operation.js +23 -0
  122. package/dist/nodes/Chatwoot/resources/team/get.operation.js.map +1 -0
  123. package/dist/nodes/Chatwoot/resources/team/getAll.operation.d.ts +2 -0
  124. package/dist/nodes/Chatwoot/resources/team/getAll.operation.js +5 -0
  125. package/dist/nodes/Chatwoot/resources/team/getAll.operation.js.map +1 -0
  126. package/dist/nodes/Chatwoot/resources/team/index.d.ts +3 -0
  127. package/dist/nodes/Chatwoot/resources/team/index.js +60 -0
  128. package/dist/nodes/Chatwoot/resources/team/index.js.map +1 -0
  129. package/dist/nodes/Chatwoot/resources/team/update.operation.d.ts +2 -0
  130. package/dist/nodes/Chatwoot/resources/team/update.operation.js +59 -0
  131. package/dist/nodes/Chatwoot/resources/team/update.operation.js.map +1 -0
  132. package/dist/nodes/Chatwoot/resources/webhook/create.operation.d.ts +2 -0
  133. package/dist/nodes/Chatwoot/resources/webhook/create.operation.js +77 -0
  134. package/dist/nodes/Chatwoot/resources/webhook/create.operation.js.map +1 -0
  135. package/dist/nodes/Chatwoot/resources/webhook/delete.operation.d.ts +2 -0
  136. package/dist/nodes/Chatwoot/resources/webhook/delete.operation.js +20 -0
  137. package/dist/nodes/Chatwoot/resources/webhook/delete.operation.js.map +1 -0
  138. package/dist/nodes/Chatwoot/resources/webhook/getAll.operation.d.ts +2 -0
  139. package/dist/nodes/Chatwoot/resources/webhook/getAll.operation.js +5 -0
  140. package/dist/nodes/Chatwoot/resources/webhook/getAll.operation.js.map +1 -0
  141. package/dist/nodes/Chatwoot/resources/webhook/index.d.ts +3 -0
  142. package/dist/nodes/Chatwoot/resources/webhook/index.js +52 -0
  143. package/dist/nodes/Chatwoot/resources/webhook/index.js.map +1 -0
  144. package/dist/nodes/Chatwoot/resources/webhook/update.operation.d.ts +2 -0
  145. package/dist/nodes/Chatwoot/resources/webhook/update.operation.js +59 -0
  146. package/dist/nodes/Chatwoot/resources/webhook/update.operation.js.map +1 -0
  147. package/dist/nodes/Chatwoot/types.d.ts +305 -8
  148. package/dist/tsconfig.tsbuildinfo +1 -1
  149. package/package.json +4 -3
package/README.md CHANGED
@@ -1,16 +1,45 @@
1
1
  # n8n-nodes-chatwoot
2
2
 
3
- This is an n8n community node for [Chatwoot](https://www.chatwoot.com/), the open-source customer engagement platform. It allows you to automate conversations, messages, and contacts in your n8n workflows.
3
+ [![npm version](https://img.shields.io/npm/v/@renatoascencio/n8n-nodes-chatwoot.svg)](https://www.npmjs.com/package/@renatoascencio/n8n-nodes-chatwoot)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@renatoascencio/n8n-nodes-chatwoot.svg)](https://www.npmjs.com/package/@renatoascencio/n8n-nodes-chatwoot)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![n8n community node](https://img.shields.io/badge/n8n-community%20node-orange)](https://docs.n8n.io/integrations/community-nodes/)
7
+
8
+ <p align="center">
9
+ <img src="https://www.chatwoot.com/images/logo/logo.svg" alt="Chatwoot Logo" width="200">
10
+ </p>
11
+
12
+ A comprehensive n8n community node for [Chatwoot](https://www.chatwoot.com/) - the open-source customer engagement platform. Automate your customer support workflows with full access to conversations, messages, contacts, agents, teams, and more.
4
13
 
5
14
  [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
6
15
 
7
- ## Features
16
+ ---
17
+
18
+ ## Highlights
19
+
20
+ - **11 Resources** - Full coverage of the Chatwoot API
21
+ - **45+ Operations** - Complete CRUD operations for all resources
22
+ - **Trigger Node** - Real-time webhook events from Chatwoot
23
+ - **Dynamic Dropdowns** - Auto-populated lists for agents, teams, inboxes, and labels
24
+ - **Smart Pagination** - Automatic handling with "Return All" option
25
+ - **Detailed Error Messages** - Clear feedback for troubleshooting
26
+
27
+ ---
28
+
29
+ ## Table of Contents
30
+
31
+ - [Installation](#installation)
32
+ - [Configuration](#configuration)
33
+ - [Nodes](#nodes)
34
+ - [Chatwoot Node](#chatwoot-node)
35
+ - [Chatwoot Trigger](#chatwoot-trigger)
36
+ - [Resources & Operations](#resources--operations)
37
+ - [Usage Examples](#usage-examples)
38
+ - [Troubleshooting](#troubleshooting)
39
+ - [Contributing](#contributing)
40
+ - [License](#license)
8
41
 
9
- - **Conversations**: List, get, and update conversation status (open, resolved, pending, snoozed)
10
- - **Messages**: Send messages and retrieve message history from conversations
11
- - **Contacts**: Full CRUD operations (create, read, update, delete) plus search functionality
12
- - **Pagination**: Automatic handling of paginated results with "Return All" option
13
- - **Error Handling**: Clear error messages for common issues (authentication, rate limits, not found)
42
+ ---
14
43
 
15
44
  ## Installation
16
45
 
@@ -18,122 +47,278 @@ This is an n8n community node for [Chatwoot](https://www.chatwoot.com/), the ope
18
47
 
19
48
  1. Go to **Settings > Community Nodes** in your n8n instance
20
49
  2. Select **Install**
21
- 3. Enter `@renatoascencio/n8n-nodes-chatwoot` in the input field
22
- 4. Agree to the risks and select **Install**
50
+ 3. Enter `@renatoascencio/n8n-nodes-chatwoot`
51
+ 4. Accept the risks and select **Install**
23
52
 
24
53
  ### Manual Installation
25
54
 
26
- To install this node manually in a self-hosted n8n instance:
27
-
28
55
  ```bash
56
+ # For self-hosted n8n
29
57
  cd ~/.n8n/nodes
30
58
  npm install @renatoascencio/n8n-nodes-chatwoot
59
+
60
+ # Restart n8n
31
61
  ```
32
62
 
33
- Then restart n8n.
63
+ ### Docker
34
64
 
35
- ### Local Development
65
+ Add to your `docker-compose.yml`:
36
66
 
37
- ```bash
38
- # Clone the repository
39
- git clone https://github.com/RenatoAscencio/n8n-nodes-chatwoot.git
40
- cd n8n-nodes-chatwoot
41
-
42
- # Install dependencies
43
- npm install
44
-
45
- # Build the node
46
- npm run build
67
+ ```yaml
68
+ environment:
69
+ - N8N_CUSTOM_EXTENSIONS=@renatoascencio/n8n-nodes-chatwoot
70
+ ```
47
71
 
48
- # Link for local development
49
- npm link
72
+ Or install in a running container:
50
73
 
51
- # In your n8n installation directory
52
- npm link @renatoascencio/n8n-nodes-chatwoot
74
+ ```bash
75
+ docker exec -it n8n npm install -g @renatoascencio/n8n-nodes-chatwoot
76
+ docker restart n8n
53
77
  ```
54
78
 
79
+ ---
80
+
55
81
  ## Configuration
56
82
 
57
- ### Setting Up Credentials
83
+ ### Creating Credentials
58
84
 
59
- 1. In n8n, go to **Credentials > Add Credential > Search for "Chatwoot API"**
60
- 2. Configure the following fields:
85
+ 1. In n8n, go to **Credentials > Add Credential**
86
+ 2. Search for **Chatwoot API**
87
+ 3. Fill in the required fields:
61
88
 
62
89
  | Field | Description | Example |
63
90
  |-------|-------------|---------|
64
- | **Base URL** | Your Chatwoot instance URL | `https://app.chatwoot.com` (cloud) or `https://chatwoot.yourdomain.com` (self-hosted) |
65
- | **Account ID** | Your Chatwoot account ID | Found in Settings → Account Settings or in URL (`/app/accounts/1/...`) |
66
- | **API Access Token** | Your API token | Found in Profile Settings → Access Token |
91
+ | **Base URL** | Your Chatwoot instance URL | `https://app.chatwoot.com` or `https://chatwoot.yourdomain.com` |
92
+ | **Account ID** | Your Chatwoot account ID | Found in URL: `/app/accounts/1/...` |
93
+ | **API Access Token** | Your personal API token | Found in Profile Settings |
67
94
 
68
95
  ### Getting Your API Access Token
69
96
 
70
- 1. Log in to your Chatwoot instance
71
- 2. Click on your profile icon (bottom left)
97
+ 1. Log in to Chatwoot
98
+ 2. Click your **profile icon** (bottom left)
72
99
  3. Go to **Profile Settings**
73
- 4. Find the **Access Token** section
74
- 5. Copy or generate your token
100
+ 4. Scroll to **Access Token**
101
+ 5. Copy or regenerate your token
102
+
103
+ > **Note**: Keep your API token secure. It provides full access to your Chatwoot account.
104
+
105
+ ---
106
+
107
+ ## Nodes
108
+
109
+ ### Chatwoot Node
110
+
111
+ The main node for interacting with the Chatwoot API. Supports 11 resources with full CRUD operations.
112
+
113
+ ### Chatwoot Trigger
114
+
115
+ Webhook-based trigger that starts workflows when events occur in Chatwoot. Automatically registers and manages webhooks in your Chatwoot account.
116
+
117
+ **Supported Events:**
118
+ - `conversation_created` - New conversation started
119
+ - `conversation_status_changed` - Status changed (open/resolved/pending/snoozed)
120
+ - `conversation_updated` - Conversation modified
121
+ - `message_created` - New message sent or received
122
+ - `message_updated` - Message edited
123
+ - `contact_created` - New contact added
124
+ - `contact_updated` - Contact information changed
125
+ - `webwidget_triggered` - Web widget interaction
126
+
127
+ ---
75
128
 
76
129
  ## Resources & Operations
77
130
 
131
+ ### Account
132
+
133
+ Manage your Chatwoot account settings.
134
+
135
+ | Operation | Description |
136
+ |-----------|-------------|
137
+ | **Get** | Get account information |
138
+ | **Update** | Update account settings (name, locale, support email, auto-resolve duration) |
139
+
140
+ ### Agent
141
+
142
+ Manage team members and their settings.
143
+
144
+ | Operation | Description |
145
+ |-----------|-------------|
146
+ | **Get Many** | List all agents in the account |
147
+ | **Create** | Add a new agent (requires email, name, role) |
148
+ | **Update** | Modify agent settings (role, availability, auto-offline) |
149
+ | **Delete** | Remove an agent from the account |
150
+
151
+ ### Canned Response
152
+
153
+ Manage pre-saved response templates.
154
+
155
+ | Operation | Description |
156
+ |-----------|-------------|
157
+ | **Get Many** | List all canned responses |
158
+ | **Create** | Create a new canned response (short code + content) |
159
+ | **Update** | Modify an existing canned response |
160
+ | **Delete** | Remove a canned response |
161
+
162
+ ### Contact
163
+
164
+ Full contact management with search and merge capabilities.
165
+
166
+ | Operation | Description |
167
+ |-----------|-------------|
168
+ | **Create** | Create a new contact (requires inbox_id) |
169
+ | **Get** | Retrieve a contact by ID |
170
+ | **Get Many** | List all contacts with pagination |
171
+ | **Update** | Modify contact details |
172
+ | **Delete** | Remove a contact |
173
+ | **Search** | Find contacts by name, email, phone, or identifier |
174
+ | **Get Conversations** | List all conversations for a contact |
175
+ | **Merge** | Merge two contacts into one |
176
+
78
177
  ### Conversation
79
178
 
179
+ Manage customer conversations with assignment and labeling.
180
+
80
181
  | Operation | Description |
81
182
  |-----------|-------------|
82
- | **Get** | Get a single conversation by ID |
183
+ | **Get** | Get a single conversation with full details |
83
184
  | **Get Many** | List conversations with filters (status, inbox, team, labels, search) |
84
- | **Update Status** | Change conversation status (open, resolved, pending, snoozed) |
185
+ | **Update Status** | Change status to open, resolved, pending, or snoozed |
186
+ | **Assign** | Assign to an agent or team (with dynamic dropdowns) |
187
+ | **Add Labels** | Set labels on a conversation |
188
+
189
+ ### Custom Attribute
190
+
191
+ Manage custom fields for contacts and conversations.
192
+
193
+ | Operation | Description |
194
+ |-----------|-------------|
195
+ | **Get Many** | List all custom attributes |
196
+ | **Get** | Get a specific attribute by key |
197
+ | **Create** | Create a new custom attribute |
198
+ | **Update** | Modify an existing attribute |
199
+ | **Delete** | Remove a custom attribute |
200
+
201
+ ### Inbox
202
+
203
+ Manage communication channels.
204
+
205
+ | Operation | Description |
206
+ |-----------|-------------|
207
+ | **Get Many** | List all inboxes |
208
+ | **Get** | Get inbox details |
209
+ | **Update** | Modify inbox settings (name, greeting, auto-assignment, etc.) |
210
+
211
+ ### Label
212
+
213
+ Organize conversations and contacts with labels.
214
+
215
+ | Operation | Description |
216
+ |-----------|-------------|
217
+ | **Get Many** | List all labels |
218
+ | **Create** | Create a new label (title, color, description) |
219
+ | **Update** | Modify label properties |
220
+ | **Delete** | Remove a label |
85
221
 
86
222
  ### Message
87
223
 
224
+ Send and retrieve messages in conversations.
225
+
88
226
  | Operation | Description |
89
227
  |-----------|-------------|
90
- | **Create** | Send a message to a conversation |
91
- | **Get Many** | Get all messages from a conversation |
228
+ | **Create** | Send a message (supports private notes) |
229
+ | **Get Many** | Retrieve message history with cursor-based pagination |
92
230
 
93
- ### Contact
231
+ ### Team
232
+
233
+ Manage agent teams for conversation routing.
94
234
 
95
235
  | Operation | Description |
96
236
  |-----------|-------------|
97
- | **Create** | Create a new contact |
98
- | **Get** | Get a single contact by ID |
99
- | **Get Many** | List all contacts with sorting options |
100
- | **Update** | Update contact information |
101
- | **Delete** | Delete a contact |
102
- | **Search** | Search contacts by name, email, phone, or identifier |
237
+ | **Get Many** | List all teams |
238
+ | **Get** | Get team details |
239
+ | **Create** | Create a new team |
240
+ | **Update** | Modify team settings |
241
+ | **Delete** | Remove a team |
242
+
243
+ ### Webhook
244
+
245
+ Manage webhook subscriptions programmatically.
246
+
247
+ | Operation | Description |
248
+ |-----------|-------------|
249
+ | **Get Many** | List all webhooks |
250
+ | **Create** | Register a new webhook URL with event subscriptions |
251
+ | **Update** | Modify webhook URL or subscriptions |
252
+ | **Delete** | Remove a webhook |
253
+
254
+ ---
103
255
 
104
256
  ## Usage Examples
105
257
 
106
- ### Example 1: Auto-reply to New Conversations
258
+ ### Auto-Reply to New Conversations
107
259
 
108
260
  ```
109
- Webhook Chatwoot (Create Message)
261
+ Chatwoot Trigger (conversation_created)
262
+ → Chatwoot (Create Message)
110
263
  ```
111
264
 
112
- When a new conversation is created in Chatwoot (via webhook), automatically send a welcome message.
265
+ Automatically send a welcome message when a new conversation is created.
113
266
 
114
- ### Example 2: Sync Contacts from CRM
267
+ ### Sync Contacts from Your CRM
115
268
 
116
269
  ```
117
- CRM Trigger → Chatwoot (Create Contact)
270
+ CRM Trigger (new lead)
271
+ → Chatwoot (Create Contact)
118
272
  ```
119
273
 
120
- When a new lead is created in your CRM, automatically create a contact in Chatwoot.
274
+ Keep your Chatwoot contacts in sync with your CRM.
121
275
 
122
- ### Example 3: Close Old Conversations
276
+ ### Close Stale Conversations
123
277
 
124
278
  ```
125
- Schedule Trigger → Chatwoot (Get Many) → Filter → Chatwoot (Update Status)
279
+ Schedule Trigger (daily)
280
+ → Chatwoot (Get Many Conversations: status=pending)
281
+ → Filter (older than 7 days)
282
+ → Chatwoot (Update Status: resolved)
126
283
  ```
127
284
 
128
- Run daily to find conversations older than 7 days and mark them as resolved.
285
+ Automatically resolve conversations that have been inactive.
129
286
 
130
- ### Example 4: Search and Update Customer Data
287
+ ### Route Conversations by Label
131
288
 
132
289
  ```
133
- HTTP Request → Chatwoot (Search Contact) → IF → Chatwoot (Update Contact)
290
+ Chatwoot Trigger (conversation_updated)
291
+ → IF (label = "urgent")
292
+ → Chatwoot (Assign to specific team)
293
+ → ELSE
294
+ → Chatwoot (Assign to general team)
134
295
  ```
135
296
 
136
- Search for a customer by email and update their information.
297
+ Auto-assign conversations based on labels.
298
+
299
+ ### Daily Agent Performance Report
300
+
301
+ ```
302
+ Schedule Trigger (daily)
303
+ → Chatwoot (Get Many Conversations: resolved today)
304
+ → Aggregate by agent
305
+ → Email (send report)
306
+ ```
307
+
308
+ Generate daily performance metrics.
309
+
310
+ ### Contact Merge Deduplication
311
+
312
+ ```
313
+ Webhook (CRM update)
314
+ → Chatwoot (Search Contact by email)
315
+ → IF (multiple found)
316
+ → Chatwoot (Merge Contacts)
317
+ ```
318
+
319
+ Automatically merge duplicate contacts.
320
+
321
+ ---
137
322
 
138
323
  ## Troubleshooting
139
324
 
@@ -141,46 +326,95 @@ Search for a customer by email and update their information.
141
326
 
142
327
  | Error | Cause | Solution |
143
328
  |-------|-------|----------|
144
- | **401 Unauthorized** | Invalid API token | Verify your API Access Token is correct |
145
- | **403 Forbidden** | Insufficient permissions | Check your user role (Administrator vs Agent) |
146
- | **404 Not Found** | Resource doesn't exist | Verify the ID exists in Chatwoot |
147
- | **429 Rate Limited** | Too many requests | Wait before retrying (limit: 60 requests/minute) |
329
+ | **401 Unauthorized** | Invalid API token | Regenerate your API Access Token |
330
+ | **403 Forbidden** | Insufficient permissions | Use an Administrator account or check inbox access |
331
+ | **404 Not Found** | Resource doesn't exist | Verify the ID is correct |
332
+ | **422 Unprocessable Entity** | Invalid data format | Check required fields and data types |
333
+ | **429 Rate Limited** | Too many requests | Wait 60 seconds (limit: 60 req/min) |
334
+
335
+ ### Base URL Configuration
336
+
337
+ | Instance Type | Base URL |
338
+ |--------------|----------|
339
+ | Chatwoot Cloud | `https://app.chatwoot.com` |
340
+ | Self-hosted | `https://your-domain.com` |
148
341
 
149
- ### Base URL Issues
342
+ > **Important**: Do not include `/api/v1` or trailing slashes.
150
343
 
151
- - **Cloud users**: Use `https://app.chatwoot.com`
152
- - **Self-hosted**: Use your custom domain (e.g., `https://chatwoot.yourdomain.com`)
153
- - **Don't** include trailing slashes or `/api/v1`
344
+ ### Permission Levels
154
345
 
155
- ### Agent vs Administrator Permissions
346
+ | Role | Access |
347
+ |------|--------|
348
+ | **Administrator** | All resources, all inboxes |
349
+ | **Agent** | Only assigned inboxes, limited operations |
156
350
 
157
- - **Administrators**: Can access all conversations and contacts
158
- - **Agents**: Can only access conversations in their assigned inboxes
351
+ ### Webhook Issues
352
+
353
+ If the Chatwoot Trigger isn't receiving events:
354
+
355
+ 1. Check that your n8n instance is publicly accessible
356
+ 2. Verify the webhook was created in Chatwoot (Settings > Integrations > Webhooks)
357
+ 3. Ensure the selected events match what Chatwoot is sending
358
+ 4. Check n8n's execution log for incoming requests
359
+
360
+ ---
159
361
 
160
362
  ## API Reference
161
363
 
162
364
  This node uses the [Chatwoot Application API v1](https://www.chatwoot.com/developers/api/).
163
365
 
366
+ ### API Documentation
367
+
368
+ - [Chatwoot API Reference](https://www.chatwoot.com/developers/api/)
369
+ - [Webhooks Documentation](https://www.chatwoot.com/docs/product/features/webhooks)
370
+ - [API Authentication](https://www.chatwoot.com/hc/user-guide/articles/1684764-api-access)
371
+
372
+ ---
373
+
164
374
  ## Contributing
165
375
 
166
- Contributions are welcome! Please read the [CLAUDE.md](./CLAUDE.md) file for development guidelines.
376
+ Contributions are welcome! See [CLAUDE.md](./CLAUDE.md) for development guidelines.
167
377
 
168
378
  ```bash
169
- # Development workflow
170
- npm install # Install dependencies
171
- npm run build # Build the node
172
- npm run lint # Run ESLint
173
- npm run lint:fix # Fix ESLint issues
379
+ # Clone and setup
380
+ git clone https://github.com/RenatoAscencio/n8n-nodes-chatwoot.git
381
+ cd n8n-nodes-chatwoot
382
+ npm install
383
+
384
+ # Development
385
+ npm run build # Compile TypeScript
386
+ npm run lint # Check code style
387
+ npm run lint:fix # Auto-fix issues
174
388
  npm test # Run tests
175
- npm run format # Format code with Prettier
389
+ npm run format # Format with Prettier
390
+
391
+ # Link for local testing
392
+ npm link
393
+ cd ~/.n8n/nodes && npm link @renatoascencio/n8n-nodes-chatwoot
176
394
  ```
177
395
 
396
+ ---
397
+
398
+ ## Changelog
399
+
400
+ See [CHANGELOG.md](./CHANGELOG.md) for release history.
401
+
402
+ ---
403
+
178
404
  ## License
179
405
 
180
- [MIT](./LICENSE)
406
+ [MIT](./LICENSE) - See LICENSE file for details.
407
+
408
+ ---
181
409
 
182
410
  ## Support
183
411
 
184
412
  - **Issues**: [GitHub Issues](https://github.com/RenatoAscencio/n8n-nodes-chatwoot/issues)
185
- - **Chatwoot Docs**: [developers.chatwoot.com](https://developers.chatwoot.com/)
413
+ - **Chatwoot Docs**: [chatwoot.com/developers](https://www.chatwoot.com/developers/api/)
186
414
  - **n8n Community**: [community.n8n.io](https://community.n8n.io/)
415
+
416
+ ---
417
+
418
+ <p align="center">
419
+ Made with care for the n8n and Chatwoot communities
420
+ </p>
@@ -1,5 +1,14 @@
1
1
  import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ import { getAgents, getTeams, getInboxes, getLabels } from './GenericFunctions';
2
3
  export declare class Chatwoot implements INodeType {
3
4
  description: INodeTypeDescription;
5
+ methods: {
6
+ loadOptions: {
7
+ getAgents: typeof getAgents;
8
+ getTeams: typeof getTeams;
9
+ getInboxes: typeof getInboxes;
10
+ getLabels: typeof getLabels;
11
+ };
12
+ };
4
13
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
14
  }