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