1+ {
2+ "name" : " [Evolution] Configurar Admin" ,
3+ "nodes" : [
4+ {
5+ "parameters" : {
6+ "values" : {
7+ "string" : [
8+ {
9+ "name" : " api_access_token" ,
10+ "value" : " CHATWOOT_ADMIN_USER_TOKEN"
11+ },
12+ {
13+ "name" : " chatwoot_url" ,
14+ "value" : " https://CHATWOOT_URL"
15+ },
16+ {
17+ "name" : " n8n_url" ,
18+ "value" : " https://N8N_URL"
19+ },
20+ {
21+ "name" : " organization" ,
22+ "value" : " ORGANIZATION_NAME"
23+ },
24+ {
25+ "name" : " logo" ,
26+ "value" : " ORGANIZATION_LOGO"
27+ }
28+ ]
29+ },
30+ "options" : {}
31+ },
32+ "id" : " 7a89a538-2cae-4032-8896-09627c07bc68" ,
33+ "name" : " Info Base" ,
34+ "type" : " n8n-nodes-base.set" ,
35+ "typeVersion" : 2 ,
36+ "position" : [
37+ 620 ,
38+ 480
39+ ]
40+ },
41+ {
42+ "parameters" : {
43+ "method" : " POST" ,
44+ "url" : " ={{ $('Info Base').item.json[\" chatwoot_url\" ] }}/api/v1/accounts/1/contacts/" ,
45+ "sendHeaders" : true ,
46+ "headerParameters" : {
47+ "parameters" : [
48+ {
49+ "name" : " api_access_token" ,
50+ "value" : " ={{ $('Info Base').item.json[\" api_access_token\" ] }}"
51+ }
52+ ]
53+ },
54+ "sendBody" : true ,
55+ "specifyBody" : " json" ,
56+ "jsonBody" : " ={\n \" inbox_id\" : {{ $('Cria Inbox Start').item.json[\" id\" ] }},\n \" name\" : \" Bot {{ $('Info Base').item.json[\" organization\" ] }}\" ,\n \" phone_number\" : \" +123456\" ,\n \" avatar_url\" : \" {{ $('Info Base').item.json[\" logo\" ] }}\"\n }" ,
57+ "options" : {}
58+ },
59+ "id" : " 12a39df3-6b95-4f83-a0bc-50b25adaca7f" ,
60+ "name" : " Cria Contato Bot" ,
61+ "type" : " n8n-nodes-base.httpRequest" ,
62+ "typeVersion" : 3 ,
63+ "position" : [
64+ 1020 ,
65+ 480
66+ ]
67+ },
68+ {
69+ "parameters" : {
70+ "method" : " POST" ,
71+ "url" : " ={{ $('Info Base').item.json[\" chatwoot_url\" ] }}/api/v1/accounts/1/inboxes/" ,
72+ "sendHeaders" : true ,
73+ "headerParameters" : {
74+ "parameters" : [
75+ {
76+ "name" : " api_access_token" ,
77+ "value" : " ={{ $('Info Base').item.json[\" api_access_token\" ] }}"
78+ }
79+ ]
80+ },
81+ "sendBody" : true ,
82+ "specifyBody" : " json" ,
83+ "jsonBody" : " ={\n \" name\" : \" Start {{ $('Info Base').item.json[\" organization\" ] }}\" ,\n \" channel\" : {\n \" type\" : \" api\" ,\n \" website_url\" : \"\"\n }\n }" ,
84+ "options" : {}
85+ },
86+ "id" : " bed7c54d-e232-4fe4-9584-0515e9679868" ,
87+ "name" : " Cria Inbox Start" ,
88+ "type" : " n8n-nodes-base.httpRequest" ,
89+ "typeVersion" : 3 ,
90+ "position" : [
91+ 820 ,
92+ 480
93+ ]
94+ },
95+ {
96+ "parameters" : {},
97+ "id" : " 36ada769-a757-4193-989b-0cc4ea504b80" ,
98+ "name" : " When clicking \" Execute Workflow\" " ,
99+ "type" : " n8n-nodes-base.manualTrigger" ,
100+ "typeVersion" : 1 ,
101+ "position" : [
102+ 420 ,
103+ 480
104+ ]
105+ },
106+ {
107+ "parameters" : {
108+ "method" : " POST" ,
109+ "url" : " ={{ $('Info Base').item.json[\" chatwoot_url\" ] }}/api/v1/accounts/1/automation_rules/" ,
110+ "sendHeaders" : true ,
111+ "headerParameters" : {
112+ "parameters" : [
113+ {
114+ "name" : " api_access_token" ,
115+ "value" : " ={{ $('Info Base').item.json[\" api_access_token\" ] }}"
116+ }
117+ ]
118+ },
119+ "sendBody" : true ,
120+ "specifyBody" : " json" ,
121+ "jsonBody" : " ={\n \" name\" : \" Create Company Chatwoot\" ,\n \" description\" : \" Create Company Chatwoot\" ,\n \" event_name\" : \" message_created\" ,\n \" active\" : true,\n \" actions\" : \n [\n {\n \" action_name\" : \" send_webhook_event\" ,\n \" action_params\" : [\" {{ $('Info Base').item.json[\" n8n_url\" ] }}/webhook/criadorchatwoot\" ]\n }\n ],\n \" conditions\" : \n [\n {\n \" attribute_key\" : \" content\" ,\n \" filter_operator\" : \" contains\" ,\n \" query_operator\" : \" and\" ,\n \" values\" : [\" Tema Criador de Empresa:\" ]\n },\n {\n \" attribute_key\" : \" phone_number\" ,\n \" filter_operator\" : \" equal_to\" ,\n \" values\" : [\" +123456\" ]\n }\n ]\n }" ,
122+ "options" : {}
123+ },
124+ "id" : " f5bbb285-71a8-4c58-a4d7-e56002d697f0" ,
125+ "name" : " Cria Automação Empresas" ,
126+ "type" : " n8n-nodes-base.httpRequest" ,
127+ "typeVersion" : 3 ,
128+ "position" : [
129+ 1220 ,
130+ 480
131+ ]
132+ },
133+ {
134+ "parameters" : {
135+ "method" : " POST" ,
136+ "url" : " ={{ $('Info Base').item.json[\" chatwoot_url\" ] }}/api/v1/accounts/1/automation_rules/" ,
137+ "sendHeaders" : true ,
138+ "headerParameters" : {
139+ "parameters" : [
140+ {
141+ "name" : " api_access_token" ,
142+ "value" : " ={{ $('Info Base').item.json[\" api_access_token\" ] }}"
143+ }
144+ ]
145+ },
146+ "sendBody" : true ,
147+ "specifyBody" : " json" ,
148+ "jsonBody": "={\n \"name\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"description\": \"Create Inbox {{ $('Info Base').item.json[\"organization\"] }}\",\n \"event_name\": \"message_created\",\n \"active\": true,\n \"actions\": \n [\n {\n \"action_name\": \"send_webhook_event\",\n \"action_params\": [\"{{ $('Info Base').item.json[\"n8n_url\"] }}/webhook/inbox_whatsapp?utoken={{ $('Info Base').item.json[\"api_access_token\"] }}&organization={{ $('Info Base').item.json[\"organization\"] }}\"]\n }\n ],\n \"conditions\": \n [\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"start:\"]\n },\n \n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"query_operator\": \"or\",\n \"values\": [\"+123456\"]\n },\n\n\n {\n \"attribute_key\": \"content\",\n \"filter_operator\": \"contains\",\n \"query_operator\": \"and\",\n \"values\": [\"new_instance:\"]\n },\n {\n \"attribute_key\": \"phone_number\",\n \"filter_operator\": \"equal_to\",\n \"values\": [\"+123456\"]\n }\n ]\n}",
149+ "options" : {}
150+ },
151+ "id" : " a36bebdc-a318-40a2-8532-c7f476f8adb7" ,
152+ "name" : " Cria Automação Inboxes" ,
153+ "type" : " n8n-nodes-base.httpRequest" ,
154+ "typeVersion" : 3 ,
155+ "position" : [
156+ 1420 ,
157+ 480
158+ ]
159+ },
160+ {
161+ "parameters" : {
162+ "content" : " ## Workflow Para Configurar admin\n **Aqui você prepara o Chatwoot Principal com um usuário (Superadmin) que poderá criar empresas e caixas de entrada**\n **Instruções**\n **No node Info Base, configure as variáveis de seu Chatwoot e N8N**\n **Obs: A variável api_access_token é o token do usuário que irá poder criar as empresas**" ,
163+ "width" : 894.6435495898575
164+ },
165+ "id" : " db66e867-e9f4-452d-b521-725eeac652c8" ,
166+ "name" : " Sticky Note" ,
167+ "type" : " n8n-nodes-base.stickyNote" ,
168+ "typeVersion" : 1 ,
169+ "position" : [
170+ 420 ,
171+ 280
172+ ]
173+ }
174+ ],
175+ "pinData" : {},
176+ "connections" : {
177+ "Info Base" : {
178+ "main" : [
179+ [
180+ {
181+ "node" : " Cria Inbox Start" ,
182+ "type" : " main" ,
183+ "index" : 0
184+ }
185+ ]
186+ ]
187+ },
188+ "Cria Contato Bot" : {
189+ "main" : [
190+ [
191+ {
192+ "node" : " Cria Automação Empresas" ,
193+ "type" : " main" ,
194+ "index" : 0
195+ }
196+ ]
197+ ]
198+ },
199+ "Cria Inbox Start" : {
200+ "main" : [
201+ [
202+ {
203+ "node" : " Cria Contato Bot" ,
204+ "type" : " main" ,
205+ "index" : 0
206+ }
207+ ]
208+ ]
209+ },
210+ "When clicking \" Execute Workflow\" " : {
211+ "main" : [
212+ [
213+ {
214+ "node" : " Info Base" ,
215+ "type" : " main" ,
216+ "index" : 0
217+ }
218+ ]
219+ ]
220+ },
221+ "Cria Automação Empresas" : {
222+ "main" : [
223+ [
224+ {
225+ "node" : " Cria Automação Inboxes" ,
226+ "type" : " main" ,
227+ "index" : 0
228+ }
229+ ]
230+ ]
231+ }
232+ },
233+ "active" : false ,
234+ "settings" : {},
235+ "versionId" : " 78f155dc-7809-4bfc-9282-63f49b07fc4d" ,
236+ "id" : " BSATyGpGWLR4ZwNm" ,
237+ "meta" : {
238+ "instanceId" : " 4ff16e963c7f5197d7e99e6239192860914312fea0ce2a9a7fd14d74a0a0e906"
239+ },
240+ "tags" : []
241+ }
0 commit comments