AutomationFlowsAI & RAG › Quebrar E Enviar Mensagens - Neo Vertex

Quebrar E Enviar Mensagens - Neo Vertex

03. Quebrar e enviar mensagens - Neo Vertex. Uses executeWorkflowTrigger, agent, lmChatOpenAi, toolThink. Event-driven trigger; 13 nodes.

Event trigger★★★★☆ complexityAI-powered13 nodesExecute Workflow TriggerAgentOpenAI ChatTool ThinkOutput Parser StructuredHTTP Request
AI & RAG Trigger: Event Nodes: 13 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Execute Workflow Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "03. Quebrar e enviar mensagens - Neo Vertex",
  "nodes": [
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "mensagem"
            },
            {
              "name": "url_chatwoot"
            },
            {
              "name": "id_conta"
            },
            {
              "name": "id_conversa"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        260,
        540
      ],
      "id": "30000000-0001-4001-8001-000000000001",
      "name": "Gatilho"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.mensagem }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=## PAPEL\n\nVoc\u00ea \u00e9 um agente que simula o comportamento humano ao enviar mensagens em um aplicativo de mensagens como o WhatsApp. Seu objetivo \u00e9 pegar uma mensagem longa recebida como entrada e dividi-la em m\u00faltiplas mensagens menores \u2014 sem alterar nenhuma palavra do conte\u00fado original \u2014 apenas separando em partes naturais, como um humano faria ao digitar e enviar aos poucos.\n\n## OBJETIVO\n\nTransformar uma \u00fanica mensagem em um **json** com o campo \"mensagens\" que \u00e9 um **array de strings**, simulando o envio humano em blocos de texto menores.\n\n## EXEMPLOS\n\n### Exemplo 1: Mensagem simples\n\n**Entrada:**\n\nOl\u00e1! Aqui \u00e9 a Neo Vertex. Vimos que voc\u00ea tem interesse em automa\u00e7\u00e3o. Pra entender melhor seu caso, podemos marcar uma conversa r\u00e1pida com nossa equipe?\n\n**Sa\u00edda esperada:**\n```json\n{\n  \"mensagens\": [\n    \"Ol\u00e1! Aqui \u00e9 a Neo Vertex\",\n    \"Vimos que voc\u00ea tem interesse em automa\u00e7\u00e3o\",\n    \"Pra entender melhor seu caso, podemos marcar uma conversa r\u00e1pida com nossa equipe?\"\n  ]\n}\n```\n\n### Exemplo 2: Mensagem com lista (N\u00c3O QUEBRAR)\n\n**Entrada:**\n\nTemos esses hor\u00e1rios dispon\u00edveis:\n1. Amanh\u00e3 \u00e0s 10h\n2. Quinta \u00e0s 15h\n3. Sexta \u00e0s 11h\nQual fica melhor pra voc\u00ea?\n\n**Sa\u00edda esperada:**\n```json\n{\n  \"mensagens\": [\n    \"Temos esses hor\u00e1rios dispon\u00edveis:\",\n    \"1. Amanh\u00e3 \u00e0s 10h\\n2. Quinta \u00e0s 15h\\n3. Sexta \u00e0s 11h\",\n    \"Qual fica melhor pra voc\u00ea?\"\n  ]\n}\n```\n\n## FERRAMENTA\n\n- **Refletir**: Use sempre que precisar pensar antes de quebrar mensagens complexas.\n\n## REGRAS\n\n- N\u00e3o reescreva o conte\u00fado. Apenas separe em mensagens menores respeitando a pontua\u00e7\u00e3o e pausas naturais.\n- As divis\u00f5es devem parecer naturais \u2014 pense como uma pessoa que est\u00e1 digitando e envia aos poucos.\n- Evite cortar frases no meio sem necessidade.\n- Sempre retorne como um array de strings com a mesma ordem do texto original.\n- Remova v\u00edrgulas e pontos nos finais das mensagens, quando necess\u00e1rio.\n- Tente manter cada mensagem entre 1 a 4 frases no m\u00e1ximo.\n- **NUNCA QUEBRE A MENSAGEM EM MAIS DE 5 PARTES**\n- Mantenha itens de lista na mesma mensagem. **NUNCA QUEBRE LISTAS EM M\u00daLTIPLAS MENSAGENS**\n\n## FORMATO DE RESPOSTA\n\nVoc\u00ea deve responder apenas com um json com o campo \"mensagens\" que \u00e9 um array de strings, sem introdu\u00e7\u00f5es, explica\u00e7\u00f5es ou textos adicionais."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        460,
        540
      ],
      "id": "30000000-0002-4002-8002-000000000002",
      "name": "Agente divisor de mensagens",
      "retryOnFail": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        380,
        760
      ],
      "id": "30000000-0003-4003-8003-000000000003",
      "name": "OpenAI Chat Model"
    },
    {
      "parameters": {
        "description": "Use essa ferramenta para refletir sobre algo. Ela n\u00e3o obter\u00e1 novas informa\u00e7\u00f5es nem alterar\u00e1 o banco de dados, apenas adicionar\u00e1 o pensamento ao registro. Use-a quando for necess\u00e1rio um racioc\u00ednio complexo para dividir a mensagem."
      },
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "typeVersion": 1.1,
      "position": [
        520,
        760
      ],
      "id": "30000000-0004-4004-8004-000000000004",
      "name": "Refletir"
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"mensagens\": [\"mensagem_1\", \"mensagem_2\", \"mensagem_3\"]\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        660,
        760
      ],
      "id": "30000000-0005-4005-8005-000000000005",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.mensagens",
        "options": {
          "destinationFieldName": "mensagem"
        }
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        760,
        540
      ],
      "id": "30000000-0006-4006-8006-000000000006",
      "name": "Split"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        980,
        540
      ],
      "id": "30000000-0007-4007-8007-000000000007",
      "name": "Para cada mensagem"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "30000000-0a01-4a01-8a01-000000000001",
              "name": "palavras_por_minuto",
              "value": "=150",
              "type": "string"
            },
            {
              "id": "30000000-0a02-4a02-8a02-000000000002",
              "name": "tamanho_mensagem_palavras",
              "value": "={{ $('Para cada mensagem').item.json.mensagem.length/4.5 }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1260,
        560
      ],
      "id": "30000000-0008-4008-8008-000000000008",
      "name": "Velocidade digita\u00e7\u00e3o"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Gatilho').item.json.url_chatwoot }}/api/v1/accounts/{{ $('Gatilho').item.json.id_conta }}/conversations/{{ $('Gatilho').item.json.id_conversa }}/messages",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "chatwootApi",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"content\": \"{{ $('Para cada mensagem').item.json.mensagem.replaceAll('\\n', '\\\\n').replaceAll('\"', '\\\\\"') }}\",\n  \"content_attributes\": {\n    \"zapi_args\": {\n      \"delayTyping\": {{ Math.min(60*$('Velocidade digita\u00e7\u00e3o').item.json.tamanho_mensagem_palavras/$('Velocidade digita\u00e7\u00e3o').item.json.palavras_por_minuto, 15) }}\n    }\n  }\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1460,
        560
      ],
      "id": "30000000-0009-4009-8009-000000000009",
      "name": "Enviar texto"
    },
    {
      "parameters": {
        "amount": "={{ Math.min(60*$('Velocidade digita\u00e7\u00e3o').item.json.tamanho_mensagem_palavras/$('Velocidade digita\u00e7\u00e3o').item.json.palavras_por_minuto, 15) }}"
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1660,
        560
      ],
      "id": "30000000-000a-400a-800a-00000000000a",
      "name": "Espera"
    },
    {
      "parameters": {
        "content": "## 03. Quebrar e enviar mensagens (Neo Vertex)\n\nSub-workflow que recebe uma mensagem longa da Neo Vertex, divide em peda\u00e7os naturais (gpt-4.1-mini + Structured Output) e envia cada peda\u00e7o pra conversa do Chatwoot.\n\nUsa `content_attributes.zapi_args.delayTyping` (padr\u00e3o Baileys/Z-API) para simular tempo de digita\u00e7\u00e3o humano calculado a partir de 150 palavras por minuto (~4,5 caracteres por palavra).",
        "height": 260,
        "width": 720,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        200,
        180
      ],
      "id": "30000000-000b-400b-800b-00000000000b",
      "name": "Sticky Note Header"
    },
    {
      "parameters": {
        "content": "## Quebrar mensagens",
        "height": 460,
        "width": 720,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        220,
        480
      ],
      "id": "30000000-000c-400c-800c-00000000000c",
      "name": "Sticky Note Quebrar"
    },
    {
      "parameters": {
        "content": "## Simular digita\u00e7\u00e3o e enviar",
        "height": 360,
        "width": 580,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1220,
        480
      ],
      "id": "30000000-000d-400d-800d-00000000000d",
      "name": "Sticky Note Enviar"
    }
  ],
  "connections": {
    "Gatilho": {
      "main": [
        [
          {
            "node": "Agente divisor de mensagens",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agente divisor de mensagens": {
      "main": [
        [
          {
            "node": "Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Agente divisor de mensagens",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Refletir": {
      "ai_tool": [
        [
          {
            "node": "Agente divisor de mensagens",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Agente divisor de mensagens",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Split": {
      "main": [
        [
          {
            "node": "Para cada mensagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Para cada mensagem": {
      "main": [
        [],
        [
          {
            "node": "Velocidade digita\u00e7\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Velocidade digita\u00e7\u00e3o": {
      "main": [
        [
          {
            "node": "Enviar texto",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enviar texto": {
      "main": [
        [
          {
            "node": "Espera",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Espera": {
      "main": [
        [
          {
            "node": "Para cada mensagem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "00000000-0000-4000-8000-000000000003",
  "id": "NV03QuebrarEnviarId",
  "tags": []
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

03. Quebrar e enviar mensagens - Neo Vertex. Uses executeWorkflowTrigger, agent, lmChatOpenAi, toolThink. Event-driven trigger; 13 nodes.

Source: https://github.com/Neo-Vertex/NeoVertex/blob/0ecc264ffa67b27d2f6bdf747f6fd03878a5bec8/n8n/03_quebrar_e_enviar_mensagens.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14
AI & RAG

Code Schedule. Uses memoryBufferWindow, agent, stickyNote, outputParserStructured. Event-driven trigger; 45 nodes.

Memory Buffer Window, Agent, Output Parser Structured +8
AI & RAG

3790. Uses memoryBufferWindow, agent, outputParserStructured, lmChatOpenAi. Event-driven trigger; 45 nodes.

Memory Buffer Window, Agent, Output Parser Structured +8
AI & RAG

Stock Analysis Agent (Hebrew, RTL, GPT-4o)

Memory Buffer Window, Agent, Output Parser Structured +8
AI & RAG

This n8n workflow automates the process of: Scraping real-time data from the web using GPT-4o with browsing capability Converting markdown tables into Chart.js-compatible JSON Rendering the chart usin

Execute Workflow Trigger, Output Parser Structured, OpenAI Chat +4