AutomationFlowsData & Sheets › Criador De Empresa Geral

Criador De Empresa Geral

Criador de Empresa Geral. Uses httpRequest, emailSend, postgres. Webhook trigger; 15 nodes.

Webhook trigger★★★★☆ complexity15 nodesHTTP RequestEmail SendPostgres
Data & Sheets Trigger: Webhook Nodes: 15 Complexity: ★★★★☆ Added:

This workflow follows the Emailsend → HTTP Request 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": "Criador de Empresa Geral",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/platform/api/v1/accounts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Info Base1').item.json[\"api_access_token\"] }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $json.NomeEmpresa }}"
            },
            {
              "name": "locale",
              "value": "pt_BR"
            }
          ]
        },
        "options": {}
      },
      "id": "aceeafb5-43db-474d-9e6c-41872ec8b54b",
      "name": "Cria Conta1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1000,
        460
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/platform/api/v1/users",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Info Base1').item.json[\"api_access_token\"] }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $('Info Base1').item.json.nomeAdministrador }}"
            },
            {
              "name": "email",
              "value": "={{ $('Info Base1').item.json[\"email\"] }}"
            },
            {
              "name": "password",
              "value": "={{ $('Info Base1').item.json[\"password\"] }}"
            }
          ]
        },
        "options": {}
      },
      "id": "8e25bc5a-25da-46a7-9c41-533aee1f1935",
      "name": "Cria Usuario1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1180,
        460
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/platform/api/v1/accounts/{{ $node[\"Cria Conta1\"].json[\"id\"] }}/account_users",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Info Base1').item.json[\"api_access_token\"] }}"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "user_id",
              "value": "={{ $node[\"Cria Usuario1\"].json[\"id\"] }}"
            },
            {
              "name": "role",
              "value": "administrator"
            }
          ]
        },
        "options": {}
      },
      "id": "64c4ab3d-b7f0-49ae-865c-21d9c717963a",
      "name": "Add Usuario a Conta1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1360,
        460
      ]
    },
    {
      "parameters": {
        "fromEmail": "machineteste24@gmail.com",
        "toEmail": "={{ $('LimpaDados1').item.json.email }}",
        "subject": "Bem vindo ao Astra Online",
        "text": "=Ol\u00e1 seja bem vindo:\n\nAbaixo segue seus dados de acesso iniciais ao Chatwoot:\n\nURL: {{ $('Info Base1').item.json[\"UrlChatwoot\"] }}\n\nLoging: {{ $('LimpaDados1').item.json[\"email\"] }}\n\nSenha: {{ $('LimpaDados1').item.json[\"senha\"] }}\n\n\n",
        "options": {}
      },
      "id": "10bc8112-8144-4f15-b321-cd43508d87e4",
      "name": "Send Email1",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        1720,
        660
      ],
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "UrlChatwoot",
              "value": "url do seu chatwoot"
            },
            {
              "name": "api_access_token",
              "value": "api key de super admin do chatwoot"
            },
            {
              "name": "UrlEvolution",
              "value": "url da evolution api"
            },
            {
              "name": "apievolution",
              "value": "api key da evolution"
            },
            {
              "name": "nome",
              "value": "={{ $json.NomeEmpresa }}"
            },
            {
              "name": "email",
              "value": "={{ $json.email }}"
            },
            {
              "name": "password",
              "value": "={{ $json.senha }}"
            },
            {
              "name": "NomeEmpresa",
              "value": "={{ $json.NomeEmpresa }}"
            },
            {
              "name": "UrlStatusAPI",
              "value": "https://n8nwebhookdocker.trecofantastico.com.br/webhook/statusapi"
            }
          ]
        },
        "options": {}
      },
      "id": "8386bfff-9bfb-4bb9-ae8b-6917f4b139e5",
      "name": "Info Base1",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        820,
        460
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "nomeAdministrador",
              "value": "={{$node[\"Webhook1\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome Usuario Administrador: ([^\\s]+)/)[1];}}"
            },
            {
              "name": "NomeEmpresa",
              "value": "={{$node[\"Webhook1\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Nome da Empresa: ([^\\s]+)/)[1];}}"
            },
            {
              "name": "email",
              "value": "={{$node[\"Webhook1\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Email: ([^\\s]+)/)[1];}}"
            },
            {
              "name": "senha",
              "value": "={{$node[\"Webhook1\"].json[\"body\"][\"messages\"][0][\"content\"].match(/Senha: ([^\\s]+)/)[1];}}"
            }
          ]
        },
        "options": {}
      },
      "id": "c2080b6d-6021-4751-b458-451cd2255217",
      "name": "LimpaDados1",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        640,
        460
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/api/v1/accounts/{{ $('Cria Conta1').item.json[\"id\"] }}/automation_rules",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Cria Usuario1').item.json[\"access_token\"] }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"name\": \"ComandosAPI-(N\u00e3o-Desativar)\",\n  \"description\": \"N\u00e3o-Desativar\",\n  \"event_name\": \"message_created\",\n  \"active\": true,\n  \"conditions\": [\n    {\n      \"attribute_key\": \"phone_number\",\n      \"filter_operator\": \"equal_to\",\n      \"values\": [\n        \"+123456\"\n      ],\n      \"query_operator\": \"and\",\n      \"custom_attribute_type\": \"\"\n    },\n    {\n      \"attribute_key\": \"content\",\n      \"filter_operator\": \"contains\",\n      \"values\": [\n        \"#\"\n      ],\n      \"custom_attribute_type\": \"\"\n    }\n  ],\n  \"actions\": [\n    {\n      \"action_name\": \"send_webhook_event\",\n      \"action_params\": [\n        \"{{ $('Info Base1').item.json[\"UrlStatusAPI\"] }}\"\n      ]\n    }\n  ]\n}\n",
        "options": {}
      },
      "id": "e6a6bd64-6a47-4de7-812d-461882baa6ec",
      "name": "Adiciona Automa\u00e7\u00e3o Status API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1560,
        460
      ]
    },
    {
      "parameters": {
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "notes",
          "mode": "list",
          "cachedResultName": "notes"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "content": "Lista de Comandos API:   \n   \nExecuta o comando no contato Gerador de QR, abra um ticket novo na Caixa que deseja executar as a\u00e7\u00f5es:\n\n#reiniciar\n\n#deslogar\n\n----------------------------------\n\nModelo para criar uma nova caixa:\n\n#Criador de Caixa:\nNome da caixa: Nome-da-Caixa\nImportar contatos: true\nImportar mensagens: true\nDias de importa\u00e7\u00e3o: 30",
            "account_id": "={{ $('Cria Conta1').item.json[\"id\"] }}",
            "contact_id": "={{ $('Busca Contato Gerador de QR').item.json[\"payload\"][0][\"id\"] }}",
            "user_id": "={{ $('Cria Usuario1').item.json[\"id\"] }}",
            "created_at": "={{ $now }}",
            "updated_at": "={{ $now }}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "content",
              "displayName": "content",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "account_id",
              "displayName": "account_id",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "contact_id",
              "displayName": "contact_id",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "user_id",
              "displayName": "user_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "number",
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "displayName": "created_at",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            },
            {
              "id": "updated_at",
              "displayName": "updated_at",
              "required": true,
              "defaultMatch": false,
              "display": true,
              "type": "dateTime",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "id": "1b654d37-60f4-4500-a51e-b97dde2d0ad0",
      "name": "Adiciona Lista Comandos",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        1180,
        660
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const length = 25;  // Voc\u00ea pode ajustar isso conforme necess\u00e1rio\nconst charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\nlet result = \"\";\n\nfor (let i = 0; i < length; i++) {\n    result += charset.charAt(Math.floor(Math.random() * charset.length));\n}\n\nreturn [\n    {\n        json: {\n            idsessao: result\n        }\n    }\n];\n"
      },
      "id": "ddede5b9-c3c7-4eff-ae0c-6f8f6f13184d",
      "name": "Gerador de ID Sess\u00e3o",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        460,
        660
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlEvolution\"] }}/instance/create",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "apikey",
              "value": "={{ $('Info Base1').item.json[\"apievolution\"] }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"instanceName\": \"{{ $('Gerador de ID Sess\u00e3o').item.json[\"idsessao\"] }}_Whatsapp_IdCW_{{ $('Cria Conta1').item.json[\"id\"] }}\",\n    \"token\": \"\",\n    \"qrcode\": true,\n    \"integration\": \"WHATSAPP-BAILEYS\",\n    \"rejectCall\": true,\n    \"msgCall\": \"Infelizmente n\u00e3o aceitamos liga\u00e7\u00f5es\",\n    \"groupsIgnore\": false,\n    \"alwaysOnline\": false,\n    \"readMessages\": true,\n    \"readStatus\": true,\n    \"syncFullHistory\": false,\n    \"chatwootAccountId\": \"{{ $('Cria Conta1').item.json[\"id\"] }}\",\n    \"chatwootToken\": \"{{ $('Cria Usuario1').item.json[\"access_token\"] }}\",\n    \"chatwootUrl\": \"{{ $('Info Base1').item.json[\"UrlChatwoot\"] }}\",\n    \"chatwootSignMsg\": true,\n    \"chatwootReopenConversation\": false,\n    \"chatwootConversationPending\": false,\n    \"chatwootImportContacts\": true,\n    \"chatwootNameInbox\": \"WhatsApp\",\n    \"chatwootMergeBrazilContacts\": true,\n    \"chatwootImportMessages\": true,\n    \"chatwootDaysLimitImportMessages\": 30,\n    \"chatwootOrganization\": \"Gerador de QR\",\n    \"chatwootLogo\": \"https://astraonline.com.br/wp-content/uploads/2024/08/qr.png\"\n}",
        "options": {}
      },
      "id": "01fc362c-ad53-49cf-a031-31be408ad5ab",
      "name": "Cria API Whatsapp",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        640,
        660
      ]
    },
    {
      "parameters": {
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/api/v1/accounts/{{ $node[\"Cria Conta1\"].json[\"id\"] }}/contacts/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "+123456"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Cria Usuario1').item.json[\"access_token\"] }}"
            }
          ]
        },
        "options": {}
      },
      "id": "317e35f5-90e9-458a-87ff-601fb53b2a2d",
      "name": "Busca Contato Gerador de QR",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1000,
        660
      ]
    },
    {
      "parameters": {
        "amount": 5,
        "unit": "seconds"
      },
      "id": "ecbece15-afe4-48b7-b36e-a5c63aaad08e",
      "name": "5s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        820,
        660
      ]
    },
    {
      "parameters": {
        "operation": "select",
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "table": {
          "__rl": true,
          "value": "access_tokens",
          "mode": "list",
          "cachedResultName": "access_tokens"
        },
        "returnAll": true,
        "where": {
          "values": [
            {
              "column": "owner_id",
              "value": "={{ $('Webhook1').item.json[\"body\"][\"messages\"][0][\"sender\"][\"id\"] }}"
            },
            {
              "column": "owner_type",
              "value": "User"
            }
          ]
        },
        "options": {}
      },
      "id": "11d96e8a-940d-4d25-953a-d0735d1564d3",
      "name": "Pega Token Usuario",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.4,
      "position": [
        1360,
        660
      ],
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Info Base1').item.json[\"UrlChatwoot\"] }}/api/v1/accounts/{{ $('Webhook1').item.json[\"body\"][\"messages\"][0][\"account_id\"] }}/conversations/{{ $('Webhook1').item.json[\"body\"][\"messages\"][0][\"conversation_id\"] }}/messages",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "={{ $('Pega Token Usuario').item.json[\"token\"] }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n\"content\": \"\u2705Empresa Criada\u2705\\nEmpresa criada com sucesso\",\n\"message_type\": \"outgoing\",\n\"private\": true\n}",
        "options": {}
      },
      "id": "7a3bef68-9c6f-4045-92f2-d4fda2020366",
      "name": "Notifica a Cria\u00e7\u00e3o",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1540,
        660
      ],
      "executeOnce": true
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "criarempresaplus",
        "options": {}
      },
      "id": "d8780fd9-cb3c-4fa9-bb03-52d3b0fdcc93",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        460,
        460
      ]
    }
  ],
  "connections": {
    "Cria Conta1": {
      "main": [
        [
          {
            "node": "Cria Usuario1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cria Usuario1": {
      "main": [
        [
          {
            "node": "Add Usuario a Conta1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Usuario a Conta1": {
      "main": [
        [
          {
            "node": "Adiciona Automa\u00e7\u00e3o Status API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Info Base1": {
      "main": [
        [
          {
            "node": "Cria Conta1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LimpaDados1": {
      "main": [
        [
          {
            "node": "Info Base1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adiciona Automa\u00e7\u00e3o Status API": {
      "main": [
        [
          {
            "node": "Gerador de ID Sess\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adiciona Lista Comandos": {
      "main": [
        [
          {
            "node": "Pega Token Usuario",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gerador de ID Sess\u00e3o": {
      "main": [
        [
          {
            "node": "Cria API Whatsapp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cria API Whatsapp": {
      "main": [
        [
          {
            "node": "5s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Busca Contato Gerador de QR": {
      "main": [
        [
          {
            "node": "Adiciona Lista Comandos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5s": {
      "main": [
        [
          {
            "node": "Busca Contato Gerador de QR",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pega Token Usuario": {
      "main": [
        [
          {
            "node": "Notifica a Cria\u00e7\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notifica a Cria\u00e7\u00e3o": {
      "main": [
        [
          {
            "node": "Send Email1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "LimpaDados1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f688c811-07d7-47de-8d69-dbbc45172fc5",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "WwQK2fAo6df3suE9",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Criador de Empresa Geral. Uses httpRequest, emailSend, postgres. Webhook trigger; 15 nodes.

Source: https://github.com/gustavodesousalima/config-docker-chatwoot/blob/feee33a7c99ac64cd65f2785b117f4a22e14c370/Fluxos/Criador_de_Empresa_Geral.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

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

Data & Sheets

LogSentinel Workflow. Uses postgres, emailSend, httpRequest. Webhook trigger; 44 nodes.

Postgres, Email Send, HTTP Request
Data & Sheets

This n8n workflow automates the transformation of raw text ideas into structured visual diagrams and content assets using NapkinAI.

HTTP Request, Email Send, Postgres
Data & Sheets

Receive request via webhook with customer question Analyze sentiment and detect urgency using JavaScript Send urgent alerts to Slack for critical cases Search knowledge base and fetch conversation his

HTTP Request, Postgres, Email Send +1
Data & Sheets

Send OTP Verification. Uses postgres, emailSend, httpRequest. Webhook trigger; 7 nodes.

Postgres, Email Send, HTTP Request
Data & Sheets

Send Invoice on Project Validated. Uses httpRequest, emailSend, postgres. Webhook trigger; 5 nodes.

HTTP Request, Email Send, Postgres