This workflow follows the Agent → Google Gemini Chat 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 →
{
"name": "n8n_Futmatch",
"nodes": [
{
"parameters": {
"guildIds": [
"1471099290414878902"
],
"channelIds": [
"1471099291257929965"
],
"value": "!futmatch",
"additionalFields": {
"externalBotTrigger": false,
"attachmentsRequired": false
}
},
"type": "n8n-nodes-discord-trigger.discordTrigger",
"typeVersion": 1,
"position": [
-912,
-592
],
"id": "bf40ac33-59ec-4c5e-bbe9-5d45c9edee54",
"name": "Discord Trigger",
"credentials": {
"discordBotTriggerApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.content }}\n",
"options": {
"systemMessage": "Rol: Eres el Gestor de Partidos de FutMatch. Tu objetivo es gestionar consultas e inscripciones en partidos interactuando con MongoDB de forma t\u00e9cnica y precisa.\n\nProcedimiento de Trabajo Obligatorio:\n\n1. Identificaci\u00f3n de Usuario:\n\nAntes de inscribir, dar de baja o buscar partidos de un jugador, usa SIEMPRE la herramienta find_user.\n\nRegla de Identidad: NUNCA uses el authorId de Discord ni IDs de la memoria. El \u00fanico ID v\u00e1lido es el _id que devuelva find_user.\n\nSi no hay resultados: Informa educadamente que el usuario no existe y debe registrarse en la web.\n\n2. Consulta de Partidos (matches):\n\nPara buscar partidos por estadio, usa el filtro: {\"field.name\": \"Nombre\"}.\n\nPara buscar partidos en los que un jugador ya est\u00e1 inscrito: Primero obt\u00e9n su _id y luego busca en matches usando: {\"players\": {\"$oid\": \"ID_RECUPERADO\"}}.\n\n3. Inscripci\u00f3n y Baja (Herramientas de Update):\n\nSolo procede si ya has obtenido el _id del usuario y el _id del partido.\n\nPROHIBIDO USAR COMANDOS DE CONSOLA (como db.matches.updateOne...). Usa SOLO JSON PURO.\n\nMongoDB requiere formato de objeto estricto. Cuando uses las herramientas para inscribir o borrar, rellena los campos EXACTAMENTE as\u00ed:\n\nEn el campo Value (para apuntar al partido): Env\u00eda SOLO el ID del partido como objeto. Ej: {\"$oid\": \"ID_DEL_PARTIDO\"}\n\nEn el campo Fields (para INSCRIBIR): Env\u00eda SOLO la operaci\u00f3n de a\u00f1adir. Ej: {\"$addToSet\": {\"players\": {\"$oid\": \"ID_DEL_USUARIO\"}}}\n\nEn el campo Fields (para BORRARSE): Env\u00eda SOLO la operaci\u00f3n de quitar. Ej: {\"$pull\": {\"players\": {\"$oid\": \"ID_DEL_USUARIO\"}}}\n\nReglas de Ejecuci\u00f3n Cr\u00edticas:\n\nEjecuci\u00f3n en Cadena: Si el usuario pide inscribirse o borrarse, ejecuta las herramientas en orden continuo (1. find_user -> 2. find_match -> 3. herramienta de Update). NUNCA te detengas a pedir confirmaci\u00f3n ni respondas a medias si ya tienes los datos.\n\nPrivacidad de IDs: NUNCA muestres los IDs t\u00e9cnicos de la base de datos (como 699da...) en tus respuestas al usuario. \u00dasalos EXCLUSIVAMENTE de forma interna para tus herramientas. Al usuario devu\u00e9lvele solo la fecha, hora, lugar y plazas libres en un formato limpio.\nREGLA DE LONGITUD (DISCORD): Tienes un l\u00edmite estricto de texto. Cuando listes partidos disponibles, muestra SOLO los pr\u00f3ximos 3 o 4 partidos. Si hay m\u00e1s disponibles, a\u00f1ade al final: 'Hay m\u00e1s partidos disponibles, preg\u00fantame por fechas concretas\n\nTono: S\u00e9 breve, claro y futbolero. Ejemplo: \"\u00a1Golazo! Ya est\u00e1s en la lista para el partido de Bala\u00eddos\".",
"maxIterations": 15
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"position": [
-720,
-416
],
"id": "e805a313-3074-484e-a2ec-41267edf22f8",
"name": "AI Agent"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
-1168,
-80
],
"id": "4cc7bfd0-6dd4-4c96-a9dc-0d815f9cad5f",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $json.authorId.toString() }}_v93\n\n"
},
"type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
"typeVersion": 1.5,
"position": [
-848,
272
],
"id": "cf5b2776-4ea8-468e-84d3-67e6070d3c5a",
"name": "Redis Chat Memory",
"credentials": {
"redis": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "1471099290414878902",
"mode": "list",
"cachedResultName": "Futmatch",
"cachedResultUrl": "https://discord.com/channels/1471099290414878902"
},
"channelId": {
"__rl": true,
"value": "1471099291257929965",
"mode": "list",
"cachedResultName": "general",
"cachedResultUrl": "https://discord.com/channels/1471099290414878902/1471099291257929965"
},
"content": "={{ $json.output }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
-176,
-352
],
"id": "3939d164-78c5-41d8-ba1b-140ca26b5475",
"name": "Send a message",
"credentials": {
"discordBotApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Name:find_match\n\nUsa esta herramienta siempre que el usuario pregunte por los partidos, cu\u00e1les hay activos, o pida una lista de los encuentros. Esta herramienta devuelve la lista completa de todos los partidos en la base de datos. No requiere par\u00e1metros de entrada.",
"collection": "=matches",
"options": {
"limit": 20,
"projection": "{ \"_class\": 0 }"
},
"query": "={}"
},
"type": "n8n-nodes-base.mongoDbTool",
"typeVersion": 1.2,
"position": [
-432,
0
],
"id": "a089f2df-79de-409c-a005-db39d4f662e2",
"name": "Find documents in MongoDB",
"credentials": {
"mongoDb": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"model": "llama-3.3-70b-versatile",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"typeVersion": 1,
"position": [
-944,
-64
],
"id": "47c1ceb0-f768-45f1-8510-f89516b883ec",
"name": "Groq Chat Model",
"credentials": {
"groqApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "\"Herramienta para buscar un usuario en la base de datos. Debes generar el JSON de b\u00fasqueda para MongoDB. Rellena el campo Query seg\u00fan lo que te diga el usuario: Si te da su nombre, env\u00eda {\"username\": \"su_nombre\"}. Si te da su correo, env\u00eda {\"email\": \"su_correo\"}. Si te da su ID, env\u00eda {\"_id\": \"su_id\"}.\"",
"collection": "users",
"options": {
"limit": 5,
"projection": "{ \"_class\": 0, \"creator\": 0 }"
},
"query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query__JSON_Format_', ``, 'json') }}"
},
"type": "n8n-nodes-base.mongoDbTool",
"typeVersion": 1.2,
"position": [
-624,
0
],
"id": "061b323f-6b76-4a31-97a3-094d79532739",
"name": "Find documents in MongoDB1",
"credentials": {
"mongoDb": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Usa esta herramienta para inscribir a un jugador.\nIMPORTANTE: El par\u00e1metro 'Fields' DEBE ser un objeto JSON real, NO un string. NO escapes las comillas.\nGenera el par\u00e1metro 'Fields' exactamente con esta estructura:\n\nJSON\n\n{\n \"_id\": \"AQUI_PONES_EL_ID_DEL_PARTIDO\",\n \"$addToSet\": {\n \"players\": {\n \"$oid\": \"AQUI_PONES_EL_ID_DEL_USUARIO\"\n }\n }\n}\nREGLA: El valor de \"_id\" debe ser SOLO el texto de 24 caracteres (sin el formato $oid).",
"operation": "update",
"collection": "=matches",
"updateKey": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Update_Key', ``, 'string') }}",
"fields": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Fields', ``, 'string') }}",
"options": {}
},
"type": "n8n-nodes-base.mongoDbTool",
"typeVersion": 1.2,
"position": [
-192,
240
],
"id": "4ecab53c-8d7b-423e-a165-4ad4e8a4a631",
"name": "Update documents in MongoDB",
"credentials": {
"mongoDb": {
"name": "<your credential>"
}
},
"notes": "Always Output Data"
}
],
"connections": {
"Discord Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Redis Chat Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Find documents in MongoDB": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Groq Chat Model": {
"ai_languageModel": [
[]
]
},
"Find documents in MongoDB1": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[]
]
},
"Update documents in MongoDB": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate",
"availableInMCP": false
},
"versionId": "f6e4e9c4-faa5-4de4-99af-dcbfecb4fc70",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "jXGkecK5SQJbGnTv",
"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.
discordBotApidiscordBotTriggerApigooglePalmApigroqApimongoDbredis
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
n8n_Futmatch. Uses n8n-nodes-discord-trigger, agent, lmChatGoogleGemini, memoryRedisChat. Event-driven trigger; 9 nodes.
Source: https://github.com/Desteveco/UD_3_n8n/blob/a35f79c4e925616e40a0ce84d3eccf8a8ab39ed2/n8n/n8n_Futmatch.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.
> ⚠️ Disclaimer: This template uses the n8n-nodes-discord-trigger community node, which means it works only in self-hosted n8n instances.(works for both cloud and localhost)
When we text or chat casually, it's not uncommon to break our sentences over multiple messages or when it comes to voice, break our speech with the odd pause or umms and ahhs. If an agent replies to e
This workflow delivers real-time crypto news alerts to X, Discord and Telegram, providing instant updates to help you stay ahead in the fast-moving world of cryptocurrency. Designed specifically for c
Stop manually proofreading markdown files. This workflow uses two AI agents to review your blog posts, generate precise line-by-line fixes, and commit the edits back to GitHub automatically. You write
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.