AutomationFlowsData & Sheets › Request Tutor with Chatwoot & Postgres

Request Tutor with Chatwoot & Postgres

Original n8n title: Mcp Tool: Request Tutor

MCP Tool: Request Tutor. Uses executeWorkflowTrigger, postgres, httpRequest. Event-driven trigger; 7 nodes.

Event trigger★★★★☆ complexity7 nodesExecute Workflow TriggerPostgresHTTP Request
Data & Sheets Trigger: Event Nodes: 7 Complexity: ★★★★☆ Added:

This workflow follows the Execute Workflow Trigger → 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": "MCP Tool: Request Tutor",
  "nodes": [
    {
      "id": "trigger",
      "name": "Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "id": "pg-pause-bot",
      "name": "Pausar bot e criar sess\u00e3o",
      "type": "n8n-nodes-base.postgres",
      "typeVersion": 2.6,
      "position": [
        460,
        300
      ],
      "parameters": {
        "operation": "executeQuery",
        "query": "WITH upserted AS (\n  INSERT INTO students (phone, attendance_status)\n  VALUES ('{{ $json.phone }}', 'human')\n  ON CONFLICT (phone) DO UPDATE\n    SET attendance_status = 'human', updated_at = NOW()\n  RETURNING id\n)\nINSERT INTO support_sessions (student_id, reason)\nSELECT id, '{{ ($json.reason ?? 'Solicita\u00e7\u00e3o via bot') | replace(\"'\", \"''\") }}'\nFROM upserted\nRETURNING id",
        "options": {}
      },
      "credentials": {
        "postgres": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "http-search-contact",
      "name": "Buscar Contato Chatwoot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "http://chatwoot-app:3000/api/v1/accounts/2/contacts/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "={{ $('Start').item.json.phone }}"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "hh5bHLwTRyKoqZzAvaPUUm5v"
            }
          ]
        }
      }
    },
    {
      "id": "code-contact-id",
      "name": "Extrair ID Contato",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        300
      ],
      "parameters": {
        "jsCode": "const payload = $input.item.json.payload;\nlet contactId = null;\nif (payload && payload.length > 0) {\n  contactId = payload[0].id;\n}\nreturn [{ json: { contactId } }];"
      }
    },
    {
      "id": "http-create-conv",
      "name": "Criar Conversa Inbox 2",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "http://chatwoot-app:3000/api/v1/accounts/2/conversations",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ source_id: $json.contactId, inbox_id: 2, status: 'open' }) }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api_access_token",
              "value": "hh5bHLwTRyKoqZzAvaPUUm5v"
            }
          ]
        },
        "options": {
          "ignoreResponseCode": true
        }
      }
    },
    {
      "id": "http-notify-evolution",
      "name": "Notificar Tutor (Evolution)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1340,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "http://kreativ_evolution:8080/message/sendText/europs",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "apikey",
              "value": "EXr5OuEE2sBMbRo94LtWQfofvEF1gHUM"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ number: '120363198506827018@g.us', text: '\ud83d\udea8 *SOLICITA\u00c7\u00c3O DE TUTORIA*\\n\\nAluno: ' + $('Start').item.json.phone + '\\nMotivo: ' + $('Start').item.json.reason + '\\nContexto: ' + $('Start').item.json.context }) }}"
      }
    },
    {
      "id": "response",
      "name": "Retorno Tool",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1560,
        300
      ],
      "parameters": {
        "jsCode": "return [{ json: { success: true, tutorName: 'Equipe Kreativ', estimatedWait: '5-10 min' } }];"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Pausar bot e criar sess\u00e3o",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pausar bot e criar sess\u00e3o": {
      "main": [
        [
          {
            "node": "Buscar Contato Chatwoot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Buscar Contato Chatwoot": {
      "main": [
        [
          {
            "node": "Extrair ID Contato",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extrair ID Contato": {
      "main": [
        [
          {
            "node": "Criar Conversa Inbox 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Criar Conversa Inbox 2": {
      "main": [
        [
          {
            "node": "Notificar Tutor (Evolution)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notificar Tutor (Evolution)": {
      "main": [
        [
          {
            "node": "Retorno Tool",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

MCP Tool: Request Tutor. Uses executeWorkflowTrigger, postgres, httpRequest. Event-driven trigger; 7 nodes.

Source: https://github.com/RAFAELUFT22/kreativ_bot_v2/blob/2e44f13e3eab55e41e825bf59bca063e04a97b1a/n8n-workflows/14-tool-request-tutor.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

Agendamiento_v2. Uses n8n-nodes-evolution-api, redis, httpRequest, executeWorkflowTrigger. Event-driven trigger; 59 nodes.

N8N Nodes Evolution Api, Redis, HTTP Request +3
Data & Sheets

Cancelacion_v2. Uses executeWorkflowTrigger, redis, httpRequest, n8n-nodes-evolution-api. Event-driven trigger; 46 nodes.

Execute Workflow Trigger, Redis, HTTP Request +3
Data & Sheets

Youtube Searcher. Uses splitInBatches, httpRequest, manualTrigger, executeWorkflowTrigger. Event-driven trigger; 21 nodes.

HTTP Request, Execute Workflow Trigger, Postgres +1
Data & Sheets

bronze. Uses httpRequest, postgres, executeWorkflowTrigger. Event-driven trigger; 10 nodes.

HTTP Request, Postgres, Execute Workflow Trigger
Data & Sheets

Feedback Collection and Training Data. Uses executeWorkflowTrigger, postgres, httpRequest. Event-driven trigger; 4 nodes.

Execute Workflow Trigger, Postgres, HTTP Request