feat(n8n): monta resposta com fallback de erro e envia via sub-workflow Z-PRO
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,8 @@
|
|||||||
"responseMode": "onReceived",
|
"responseMode": "onReceived",
|
||||||
"options": {}
|
"options": {}
|
||||||
},
|
},
|
||||||
"webhookId": "5ea5f89e-7351-4d45-a881-0055009423a0"
|
"webhookId": "5ea5f89e-7351-4d45-a881-0055009423a0",
|
||||||
|
"onError": "continueRegularOutput"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "extrair-campos",
|
"id": "extrair-campos",
|
||||||
@@ -176,6 +177,115 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"onError": "continueErrorOutput"
|
"onError": "continueErrorOutput"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "montar-corpo-resposta",
|
||||||
|
"name": "Montar corpo da resposta",
|
||||||
|
"type": "n8n-nodes-base.set",
|
||||||
|
"typeVersion": 3.4,
|
||||||
|
"position": [
|
||||||
|
640,
|
||||||
|
-120
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"assignments": {
|
||||||
|
"assignments": [
|
||||||
|
{
|
||||||
|
"id": "resp-number",
|
||||||
|
"name": "number",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $('Extrair campos do webhook').item.json.telefone }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "resp-body",
|
||||||
|
"name": "body",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ $json.output ? $json.output : 'Recebemos sua solicitação de exames! Nossa equipe vai confirmar os valores e te retornar em breve.' }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "resp-externalkey",
|
||||||
|
"name": "externalKey",
|
||||||
|
"type": "string",
|
||||||
|
"value": "={{ 'orcamento-' + $execution.id }}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "resp-isclosed",
|
||||||
|
"name": "isClosed",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"options": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "enviar-orcamento-zpro",
|
||||||
|
"name": "Enviar orçamento (Z-PRO)",
|
||||||
|
"type": "n8n-nodes-base.executeWorkflow",
|
||||||
|
"typeVersion": 1.3,
|
||||||
|
"position": [
|
||||||
|
900,
|
||||||
|
-120
|
||||||
|
],
|
||||||
|
"parameters": {
|
||||||
|
"workflowId": {
|
||||||
|
"__rl": true,
|
||||||
|
"mode": "id",
|
||||||
|
"value": "Y4ndG7GuIUrmVRxV",
|
||||||
|
"cachedResultName": "MCP Server - Mensageria ZPRO - enviar_texto"
|
||||||
|
},
|
||||||
|
"workflowInputs": {
|
||||||
|
"mappingMode": "defineBelow",
|
||||||
|
"value": {
|
||||||
|
"number": "={{ $json.number }}",
|
||||||
|
"body": "={{ $json.body }}",
|
||||||
|
"externalKey": "={{ $json.externalKey }}",
|
||||||
|
"isClosed": "={{ $json.isClosed }}"
|
||||||
|
},
|
||||||
|
"matchingColumns": [],
|
||||||
|
"schema": [
|
||||||
|
{
|
||||||
|
"id": "number",
|
||||||
|
"displayName": "number",
|
||||||
|
"required": false,
|
||||||
|
"defaultMatch": false,
|
||||||
|
"display": true,
|
||||||
|
"canBeUsedToMatch": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "body",
|
||||||
|
"displayName": "body",
|
||||||
|
"required": false,
|
||||||
|
"defaultMatch": false,
|
||||||
|
"display": true,
|
||||||
|
"canBeUsedToMatch": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "externalKey",
|
||||||
|
"displayName": "externalKey",
|
||||||
|
"required": false,
|
||||||
|
"defaultMatch": false,
|
||||||
|
"display": true,
|
||||||
|
"canBeUsedToMatch": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "isClosed",
|
||||||
|
"displayName": "isClosed",
|
||||||
|
"required": false,
|
||||||
|
"defaultMatch": false,
|
||||||
|
"display": true,
|
||||||
|
"canBeUsedToMatch": true,
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attemptToConvertTypes": false,
|
||||||
|
"convertFieldsToString": false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"connections": {
|
"connections": {
|
||||||
@@ -227,6 +337,13 @@
|
|||||||
"type": "main",
|
"type": "main",
|
||||||
"index": 0
|
"index": 0
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Montar corpo da resposta",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -240,6 +357,35 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"AI Agent - Orçamento": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Montar corpo da resposta",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Montar corpo da resposta",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Montar corpo da resposta": {
|
||||||
|
"main": [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"node": "Enviar orçamento (Z-PRO)",
|
||||||
|
"type": "main",
|
||||||
|
"index": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
Reference in New Issue
Block a user