Skip to content

Commit

Permalink
added skip contact parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
nocodeleaks committed May 21, 2024
1 parent 9416f69 commit ab194dc
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 77 deletions.
26 changes: 13 additions & 13 deletions extra/n8n+chatwoot/GetChatwootContacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"conditions": {
"string": [
{
"value1": "={{$json.payload?.id}}",
"value1": "={{$json.chat?.chatwoot?.id}}",
"operation": "isNotEmpty"
}
]
Expand Down Expand Up @@ -248,20 +248,12 @@
"name": "chat.chatwoot.source_id",
"value": "={{$json.chat.hex}}"
},
{
"name": "chat.chatwoot.skipgreetings",
"value": "={{ $json.payload.custom_attributes?.skipgreetings ?? false }}"
},
{
"name": "payload",
"value": "={{ undefined }}"
}
],
"number": [
{
"name": "chat.chatwoot.id",
"value": "={{$json.payload.id}}"
},
{
"name": "attempts",
"value": "={{ undefined }}"
Expand Down Expand Up @@ -370,14 +362,22 @@
"values": {
"number": [
{
"name": "payload.id",
"name": "chat.chatwoot.id",
"value": "={{ $json.ctid }}"
}
],
"boolean": [
{
"name": "payload.custom_attributes.skipgreetings",
"name": "chat.chatwoot.skipgreetings",
"value": "={{ $json.ctatts?.skipgreetings ?? false }}"
},
{
"name": "chat.chatwoot.skipcontact",
"value": "={{ $json.ctatts?.skipcontact ?? false }}"
},
{
"name": "chat.chatwoot.skipevaluation",
"value": "={{ $json.ctatts?.skipevaluation ?? false }}"
}
],
"string": [
Expand All @@ -404,7 +404,7 @@
},
{
"parameters": {
"content": "## (1.0.11) Updates\n* missing edited parameter\n\n## Recommendations \n* Remember set timeout to 20 seconds",
"content": "## (1.0.12) Updates\n* added skipcontact option\n\n## Recommendations \n* Remember set timeout to 20 seconds",
"height": 201.45401153644474,
"width": 467.54452018877896
},
Expand Down Expand Up @@ -1027,7 +1027,7 @@
"callerPolicy": "workflowsFromSameOwner",
"executionTimeout": 30
},
"versionId": "d59193ff-903a-4de3-8570-0460bc110e27",
"versionId": "dd463eed-80c4-4c31-b52f-e89e7bf0a4a4",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "2b4ab318d4f8eba20155e50db9998481bc305e3588e42ee69176091736c9d07e"
Expand Down
91 changes: 77 additions & 14 deletions extra/n8n+chatwoot/QuepasaAutomatic.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"typeVersion": 1,
"position": [
480,
1500
1700
],
"alwaysOutputData": false,
"credentials": {
Expand All @@ -238,7 +238,7 @@
"typeVersion": 1,
"position": [
720,
1500
1700
],
"alwaysOutputData": false,
"credentials": {
Expand All @@ -251,16 +251,16 @@
},
{
"parameters": {
"content": "## (1.0.4) Recommendations \n* exec data position\n",
"content": "## (1.0.5) Recommendations \n* added skip contact\n",
"width": 425.48157586978226
},
"id": "d7872589-290c-4614-868f-fabe6b64ca52",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-800,
840
-320,
700
]
},
{
Expand Down Expand Up @@ -448,7 +448,7 @@
"typeVersion": 1,
"position": [
-180,
1840
1960
],
"credentials": {
"postgres": {
Expand Down Expand Up @@ -477,9 +477,10 @@
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
720,
1860
]
740,
1980
],
"alwaysOutputData": false
},
{
"parameters": {
Expand All @@ -491,8 +492,8 @@
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1,
"position": [
320,
1920
300,
2040
]
},
{
Expand All @@ -507,7 +508,7 @@
"typeVersion": 2.1,
"position": [
480,
1860
1980
]
},
{
Expand All @@ -531,8 +532,54 @@
"typeVersion": 3.3,
"position": [
120,
1840
1960
]
},
{
"parameters": {
"operation": "executeQuery",
"query": "=SELECT DISTINCT \"accounts\".\"id\" AS \"account\" FROM \"accounts\" WHERE NOT EXISTS (SELECT NULL FROM \"custom_attribute_definitions\" WHERE \"account_id\" = \"accounts\".\"id\" AND \"attribute_key\" = 'skipcontact' AND \"attribute_model\" = 1);",
"additionalFields": {}
},
"id": "a4ea12de-2217-4ab0-82fb-cb25c3fba14c",
"name": "Missing Skip For Contact",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
480,
1500
],
"alwaysOutputData": false,
"credentials": {
"postgres": {
"id": "1",
"name": "Postgres account"
}
},
"notes": "Sucesso"
},
{
"parameters": {
"operation": "executeQuery",
"query": "=INSERT INTO \"custom_attribute_definitions\" (\"attribute_display_name\", \"attribute_key\", \"attribute_display_type\", \"attribute_model\", \"account_id\", \"attribute_description\", \"attribute_values\", \"updated_at\", \"created_at\") VALUES ('Skip Contact', 'skipcontact', 7, 1, {{ $json.account }}, 'Não utilizar este contato ! Ignora a criação de novas conversas.', '[]', NOW(), NOW());",
"additionalFields": {}
},
"id": "f49e4ca4-96ab-4093-96cf-9ded94bb1454",
"name": "Insert Skip For Contact",
"type": "n8n-nodes-base.postgres",
"typeVersion": 1,
"position": [
720,
1500
],
"alwaysOutputData": false,
"credentials": {
"postgres": {
"id": "1",
"name": "Postgres account"
}
},
"notes": "Sucesso"
}
],
"pinData": {},
Expand Down Expand Up @@ -675,6 +722,11 @@
"node": "Missing Automations",
"type": "main",
"index": 0
},
{
"node": "Missing Skip For Contact",
"type": "main",
"index": 0
}
]
]
Expand Down Expand Up @@ -749,11 +801,22 @@
}
]
]
},
"Missing Skip For Contact": {
"main": [
[
{
"node": "Insert Skip For Contact",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {},
"versionId": "379e9bde-df63-45fd-957d-f218d06048c3",
"versionId": "9fd6c619-3f7d-4cdf-8fbe-16c3977fb9db",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "2b4ab318d4f8eba20155e50db9998481bc305e3588e42ee69176091736c9d07e"
Expand Down
Loading

0 comments on commit ab194dc

Please sign in to comment.