AutomationFlowsAI & RAG › Tutor De Lengua (con Anonimización)

Tutor De Lengua (con Anonimización)

Tutor de Lengua (con Anonimización). Uses httpRequest, openAiChat. Webhook trigger; 8 nodes.

Webhook trigger★★★★☆ complexityAI-powered8 nodesHTTP RequestOpen Ai Chat
AI & RAG Trigger: Webhook Nodes: 8 Complexity: ★★★★☆ AI nodes: yes Added:

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": "Tutor de Lengua (con Anonimizaci\u00f3n)",
  "nodes": [
    {
      "parameters": {
        "path": "tutor-language",
        "httpMethod": "POST"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        700
      ]
    },
    {
      "parameters": {
        "url": "={{'http://backend:8000/api/students/' + $json.body.student_id}}",
        "options": {}
      },
      "name": "Obtener Datos Estudiante",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        450,
        700
      ]
    },
    {
      "parameters": {
        "url": "={{'http://backend:8000/api/conversations/' + $json.body.student_id}}",
        "options": {
          "ignoreStatusCodes": [
            404
          ]
        }
      },
      "name": "Obtener Historial",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        650,
        700
      ]
    },
    {
      "parameters": {
        "javascriptCode": "const student = $getNode('Obtener Datos Estudiante').json;\nconst history = $getNode('Obtener Historial').json[0] ? $getNode('Obtener Historial').json[0].messages : [];\nconst newMessage = { role: 'user', content: $json.body.message };\n\nconst studentName = `${student.first_name} ${student.last_name}`;\nconst placeholder = '[ESTUDIANTE]';\n\nconst anonymize = (text) => text.replace(new RegExp(studentName, 'gi'), placeholder);\n\nconst anonymizedHistory = history.map(msg => ({ ...msg, content: anonymize(msg.content) }));\nconst anonymizedNewMessage = { ...newMessage, content: anonymize(newMessage.content) };\n\nreturn {\n  anonymizedHistory,\n  anonymizedNewMessage,\n  studentName,\n  placeholder\n};"
      },
      "name": "Anonimizar Conversaci\u00f3n",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        850,
        700
      ]
    },
    {
      "parameters": {
        "model": "gpt-4-turbo",
        "messages": {
          "json": "={{[{ 'role': 'system', 'content': 'Eres un tutor de Lengua y Literatura amigable... Tu placeholder para el nombre del estudiante es [ESTUDIANTE].' }, ...$node['Anonimizar Conversaci\u00f3n'].json.anonymizedHistory, $node['Anonimizar Conversaci\u00f3n'].json.anonymizedNewMessage]}}"
        }
      },
      "name": "OpenAI Chat",
      "type": "n8n-nodes-base.openAiChat",
      "typeVersion": 1,
      "position": [
        1050,
        700
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "javascriptCode": "const assistantResponse = $getNode('OpenAI Chat').json.choices[0].message.content;\nconst { studentName, placeholder } = $getNode('Anonimizar Conversaci\u00f3n').json;\n\nconst deanonymizedResponse = assistantResponse.replace(new RegExp(placeholder.replace(/[\\[\\]]/g, '\\\\$&'), 'gi'), studentName);\n\nreturn {\n  role: 'assistant',\n  content: deanonymizedResponse\n};"
      },
      "name": "De-anonimizar Respuesta",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        1250,
        700
      ]
    },
    {
      "parameters": {
        "url": "={{$node['Obtener Historial'].json[0] ? 'http://backend:8000/api/conversations/' + $node['Obtener Historial'].json[0].id : 'http://backend:8000/api/conversations/'}}",
        "method": "={{$node['Obtener Historial'].json[0] ? 'PUT' : 'POST'}}",
        "bodyParameters": {
          "json": "={{$node['Obtener Historial'].json[0] ? [ ...$node['Obtener Historial'].json[0].messages, { role: 'user', content: $json.body.message }, $node['De-anonimizar Respuesta'].json ] : { 'student_id': $json.body.student_id, 'tutor_type': 'Lengua', 'messages': [ { role: 'user', content: $json.body.message }, $node['De-anonimizar Respuesta'].json ] } }}"
        },
        "options": {}
      },
      "name": "Guardar Conversaci\u00f3n",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1450,
        700
      ]
    },
    {
      "parameters": {
        "body": "={{$node['De-anonimizar Respuesta'].json.content}}",
        "options": {}
      },
      "name": "Responder al Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        1650,
        700
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Obtener Datos Estudiante",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Obtener Datos Estudiante": {
      "main": [
        [
          {
            "node": "Obtener Historial",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Obtener Historial": {
      "main": [
        [
          {
            "node": "Anonimizar Conversaci\u00f3n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anonimizar Conversaci\u00f3n": {
      "main": [
        [
          {
            "node": "OpenAI Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat": {
      "main": [
        [
          {
            "node": "De-anonimizar Respuesta",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "De-anonimizar Respuesta": {
      "main": [
        [
          {
            "node": "Guardar Conversaci\u00f3n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Guardar Conversaci\u00f3n": {
      "main": [
        [
          {
            "node": "Responder al Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "3"
}

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

Tutor de Lengua (con Anonimización). Uses httpRequest, openAiChat. Webhook trigger; 8 nodes.

Source: https://github.com/dretureta/POC_Tutor_Virtual/blob/9afb8d480df5b0b8b143329cfde5838e495f13dc/n8n-workflows/tutor-lengua.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

Tutor de Matemáticas (con Anonimización). Uses httpRequest, openAiChat. Webhook trigger; 8 nodes.

HTTP Request, Open Ai Chat
AI & RAG

BaseLinker Product Automation - Full Sanitized Workflow. Uses googleGemini, editImage, httpRequest, discord. Webhook trigger; 89 nodes.

Google Gemini, Edit Image, HTTP Request +1
AI & RAG

This workflow captures new leads via webhook, enriches and scores them with Apollo and Google Gemini, logs everything in Google Sheets, and automates outreach, reply handling, follow-ups, meeting prep

HTTP Request, Google Gemini, Google Sheets +3
AI & RAG

This powerful n8n automation workflow is designed to execute advanced B2B lead enrichment and hyper-personalization for cold email outreach. By orchestrating a complex chain of data scraping, AI analy

OpenAI, HTTP Request, Airtable
AI & RAG

Propulsar — Content Engine v3. Uses openAi, httpRequest, googleSheets. Webhook trigger; 73 nodes.

OpenAI, HTTP Request, Google Sheets