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 →
{
"name": "omnisim-chat",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "omnisim-chat",
"responseMode": "responseNode",
"options": {}
},
"id": "wh-chat-01",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
240,
304
]
},
{
"parameters": {
"jsCode": "const body = $input.first().json.body;\n\nconst perfil = body.perfil || {};\nconst historial = body.historial || [];\nconst mensaje = body.mensaje || '';\n\nconst dificultad = {\n facil: 'Eres cooperativo y compartes informaci\u00f3n con facilidad. Revelas informaci\u00f3n latente con preguntas b\u00e1sicas.',\n medio: 'Eres natural y algo reservado. Solo revelas informaci\u00f3n latente ante buenas preguntas de seguimiento.',\n dificil: 'Eres evasivo y tus respuestas son vagas. Solo revelas informaci\u00f3n sensible ante preguntas muy espec\u00edficas y directas.'\n};\n\nconst infoExplicita = (perfil.informacion_explicita || []).map(i => `- ${i}`).join('\\n');\nconst infoLatente = (perfil.informacion_latente || []).map(i => `- ${i}`).join('\\n');\nconst restricciones = (perfil.restricciones || []).map(r => `- ${r}`).join('\\n');\nconst nivelTexto = dificultad[perfil.nivel_dificultad] || dificultad.medio;\n\nconst systemPrompt = `Eres un personaje de simulaci\u00f3n para una pr\u00e1ctica acad\u00e9mica. Responde SIEMPRE en primera persona como el personaje. NUNCA salgas del rol.\n\n## Tu identidad\n${perfil.rol_identidad || 'Personaje sin definir'}\n\n## Tu historia\n${perfil.trasfondo || ''}\n\n## Lo que sabes\n${perfil.conocimientos || ''}\n\n## Lo que puedes decir abiertamente\n${infoExplicita}\n\n## Lo que ocultas o cuesta revelar\n${infoLatente}\n\n## C\u00f3mo te comunicas\n${perfil.comportamiento || ''}\n\n## Nivel de dificultad\n${nivelTexto}\n\n## Restricciones adicionales\n${restricciones}\n\nResponde de forma natural y conversacional. M\u00e1ximo 3-4 frases. No rompas el personaje bajo ninguna circunstancia.`;\n\nconst messages = [{ role: 'system', content: systemPrompt }];\n\nfor (const m of historial) {\n messages.push({\n role: m.emisor === 'alumno' ? 'user' : 'assistant',\n content: m.contenido\n });\n}\nmessages.push({ role: 'user', content: mensaje });\n\nreturn [{ json: { messages } }];"
},
"id": "code-chat-01",
"name": "Construir Prompt",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
464,
304
]
},
{
"parameters": {
"method": "POST",
"url": "http://host.docker.internal:11434/api/chat",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"model\": \"llama3.2:3b\",\n \"messages\": {{ JSON.stringify($json.messages) }},\n \"stream\": false,\n \"options\": { \"temperature\": 0.7, \"num_predict\": 256 }\n}",
"options": {
"timeout": 60000
}
},
"id": "http-chat-01",
"name": "Llamar Ollama",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
688,
304
]
},
{
"parameters": {
"jsCode": "const response = $input.first().json;\nconst respuesta = response.message?.content || 'Lo siento, no pude procesar tu mensaje.';\nreturn [{ json: { respuesta: respuesta.trim() } }];"
},
"id": "code-chat-02",
"name": "Extraer Respuesta",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
912,
304
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify($input.first().json) }}",
"options": {}
},
"id": "resp-chat-01",
"name": "Responder",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1,
"position": [
1120,
304
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Construir Prompt",
"type": "main",
"index": 0
}
]
]
},
"Construir Prompt": {
"main": [
[
{
"node": "Llamar Ollama",
"type": "main",
"index": 0
}
]
]
},
"Llamar Ollama": {
"main": [
[
{
"node": "Extraer Respuesta",
"type": "main",
"index": 0
}
]
]
},
"Extraer Respuesta": {
"main": [
[
{
"node": "Responder",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
},
"versionId": "f7520685-4045-443f-a0c1-64f5a9d6dcc9",
"nodeGroups": [],
"id": "kzIQKvESjavI1JG1",
"tags": []
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
omnisim-chat. Uses httpRequest. Webhook trigger; 5 nodes.
Source: https://github.com/JLRG806/omni-sim-tfg/blob/44f1d27839af899e4212c75194a937a9f3dc7302/n8n/omnisim-chat.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di
This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .
eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.
This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia
This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c