This workflow follows the Agent → Gmail Tool 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": "assistente",
"nodes": [
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $('Receber Mensagem Telegram').item.json.message.voice }}",
"rightValue": "",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"id": "48feeb05-d1a0-45a7-9e6b-04faef4b5175"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "\u00c1udio"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "8cf1a12e-bd0a-4ac6-a33c-6748438c9c8a",
"leftValue": "={{ $('Receber Mensagem Telegram').item.json.message.text }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Texto"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
1940,
-120
],
"id": "9a6092b1-8976-47d4-a859-353f072735d9",
"name": "Tipo de mensagem"
},
{
"parameters": {
"resource": "audio",
"operation": "transcribe",
"options": {
"language": "pt"
}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
2440,
-220
],
"id": "52736cf1-784d-4332-989a-5fed587184d3",
"name": "Transcrever \u00e1udio",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "45efc554-3f74-4922-a2cf-f64d2ea084c0",
"name": "mensagem",
"value": "={{ $('Receber Mensagem Telegram').item.json.message.text }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2220,
0
],
"id": "7499d6c5-f4d7-43b2-989f-d9b13163dbce",
"name": "Set mensagem texto"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "0e95db55-1b2e-4762-a547-9481029291e9",
"name": "mensagem",
"value": "={{ $json.text }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
2660,
-220
],
"id": "7a6a6118-cb28-4f7b-8a01-9ff3f9577f94",
"name": "Set mensagem \u00e1udio"
},
{
"parameters": {
"content": "## Assistente interno\n",
"height": 560,
"width": 2460,
"color": 5
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1300,
-280
],
"id": "b7fcbd35-98e1-4a5c-92b4-68ef672293e6",
"name": "Sticky Note5"
},
{
"parameters": {
"content": "[](https://fazer.ai?utm_source=n8n&utm_campaign=sec-ep2&utm_medium=evo-5)\n\n## Esse \u00e9 um template fa\u00e7a voc\u00ea mesmo do canal\n## Lucas Moreira\n\n### Inscreva-se no nosso canal no YouTube\n[](https://youtube.com/@eulucassmoreira?si=0lH7hwX9pukjhmPQ)\n\n### Siga nosso GitHub\n[](https://github.com/fazer-ai)\n",
"height": 440,
"width": 550,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1240,
-760
],
"id": "663b88a7-8bf3-4149-8ab2-67873f9bf6e3",
"name": "Sticky Note11"
},
{
"parameters": {
"content": "## Quer entender como funciona?\n\n\n### Assista o v\u00eddeo, deixe um like, e se inscreva no canal para ter acesso a mais workflows como esse!\n\n[](https://www.youtube.com/watch?v=cvTWGNJGAu4)",
"height": 440,
"width": 500,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1820,
-740
],
"id": "d9fe9efc-316e-4331-8f7a-ee50990a0b6e",
"name": "Sticky Note15"
},
{
"parameters": {
"content": "",
"height": 100,
"width": 280,
"color": 7
},
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1480,
-440
],
"id": "aa3d20d1-c07c-4ef0-8531-581ff508bdba",
"name": "Sticky Note20"
},
{
"parameters": {
"resource": "file",
"fileId": "={{ $('Receber Mensagem Telegram').item.json.message.voice.file_id }}"
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
2220,
-220
],
"id": "b9a3332e-9d82-4ad9-b6bf-079bc121bf2f",
"name": "Download \u00e1udio",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.2,
"position": [
1460,
-120
],
"id": "4c555d40-05a6-4c1b-af08-bf2b52a46d6e",
"name": "Receber Mensagem Telegram",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "0a3fa735-aced-46e9-b9de-1734f9f2b537",
"name": "id_conta",
"value": "={{ $json.account_id }}",
"type": "string"
},
{
"id": "2c4f57f2-8175-43e9-8d59-2796b2ebf488",
"name": "telegram_chat_id",
"value": "={{ $('Receber Mensagem Telegram').item.json.message.chat.id }}",
"type": "string"
},
{
"id": "d41112ee-b773-4706-81c7-96c5bc8b4ff0",
"name": "url_evolution",
"value": "<insira sua url do evolution>",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1720,
-120
],
"id": "77d249b2-598f-4c45-b332-b05cf9c77608",
"name": "Info"
},
{
"parameters": {
"promptType": "define",
"text": "={{ $json.mensagem }}",
"options": {
"systemMessage": "=Agora s\u00e3o {{ $now.format('FFFF') }}.\n\n## PAPEL\n\nVoc\u00ea \u00e9 um assistente interno de reagendamento no escrit\u00f3rio, acionado diretamente por um profissional via mensagem para gerenciar situa\u00e7\u00f5es de remarca\u00e7\u00e3o de consultas, incluir lembretes na lista de compras ou agendar tarefas.\n\n## OBJETIVO GERAL\n\n1. Reagendar consultas a pedido do profissional. \n2. Adicionar lembretes na lista de compras quando solicitado. \n3. Agendar tarefas a pedido do profissional\n\n\n## RESUMO DE RESPONSABILIDADES\n\n1. Reagendamento de leads \n - Acesse o Google Calendar por meio das ferramentas de evento para identificar as consultas afetadas.\n - Extraia o n\u00famero de telefone e o ID da conversa na descri\u00e7\u00e3o do evento.\n - Use a ferramenta \"Enviar_reagendamento\" para enviar mensagens de reagendamento aos pacientes.\n - Envie a pergunta de prefer\u00eancia de nova data e hor\u00e1rio.\n2. Lista de compras do escrit\u00f3rio \n - Se o profissional solicitar a inclus\u00e3o de um item na lista de compras, utilize a ferramenta \"Criar_tarefa\" para adicionar o lembrete.\n3. Agendamento de tarefas do escrit\u00f3rio\n - Se o profissional solicitar o agendamento de uma tarefa na agenda do Google Calendar, utilize a ferramenta \"Criar_tarefa\" para adicionar o lembrete.\n4. Ler e resumir lista de emails\n - Se o profissional solicitar informa\u00e7\u00e3o sobre os emails recebidos, use a ferramenta \"Ler_emails\" e resuma as informa\u00e7\u00f5es\n\n## ORIENTA\u00c7\u00d5ES DE LINGUAGEM E PROCEDIMENTO\n\n- Use uma abordagem emp\u00e1tica, profissional e acolhedora.\n- Nunca envie mensagens para pacientes sem autoriza\u00e7\u00e3o expl\u00edcita do profissional.\n- Quando listar eventos ou tarefas, seja objetivo e organizado.\n- Mantenha clareza e concis\u00e3o em todas as intera\u00e7\u00f5es.\n\n## PROFISSIONAIS E ESPECIALIDADES\n\nSegue o nome dos profissionais, suas especialidades, e o ID da agenda que deve ser usado nas ferramentas Google Calendar\n\n**MUITO IMPORTANTE!! O ID DA AGENDA INCLUI O \"@group.calendar.google.com\". N\u00c3O OMITA AO UTILIZAR AS FERRAMENTAS**\n\n- Dr. Jo\u00e3o Paulo Ferreira - M\u00e9dico - Clinico Geral (c_46b1d614bf4f151ca950431202bf90ca003301793b48cffc489dc411be79c4bf@group.calendar.google.com)\n- Dr. Roberto Almeida - M\u00e9dico - Cardiologia (c_6c3005bf4afd591f13f242f6509208ddbe1feadad3f6521884ab79c59069bfd0@group.calendar.google.com)\n- Dra. Ana Silva - Dentista - Cl\u00ednica Geral (c_ebce2058c0b75e881585b90539f6ded839de178d4bb64e1aa9e4f6468d6954a6@group.calendar.google.com)\n- Dra. Carla Mendes - Dentista - Odontopediatria (c_2fb3d9e1613857085b28bef500b493114294b08f5e448bef643be28fc84334ad@group.calendar.google.com)\n\n## IMPORTANTE\n\n- Use a ferramenta \"Refletir\" antes e depois de realizar opera\u00e7\u00f5es complexas, para ter certeza de que deu tudo certo.\n- SEMPRE QUE ENVIAR UMA MENSAGEM PARA O PACIENTE, **USE A FERRAMENTA \"Salvar_memoria\"**. ISSO \u00c9 MUITO IMPORTANTE, N\u00c3O FA\u00c7A ERRADO POR FAVOR.\n\n## INSTRU\u00c7\u00d5ES FINAIS\n\n- Atenda exclusivamente \u00e0s solicita\u00e7\u00f5es de reagendamento e inclus\u00e3o de lembretes.\n- A remarca\u00e7\u00e3o de consultas ocorre somente quando o profissional pede, utilizando as ferramentas de evento para identificar os pacientes e a ferramenta \"Enviar_reagendamento\" para enviar a mensagem.\n- Para a lista de compras e lembretes, sempre use \"Criar_tarefa\".\n- Para a sua resposta que ser\u00e1 enviada para o profissional que fez a solitica\u00e7\u00e3o, **N\u00c3O UTILIZE FORMATA\u00c7\u00c3O MARKDOWN**.\n"
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.8,
"position": [
2940,
-120
],
"id": "93801b98-f039-49b2-900e-9c44268e7164",
"name": "Assistente do escrit\u00f3rio interno"
},
{
"parameters": {
"chatId": "={{ $('Info').item.json.telegram_chat_id }}",
"text": "={{ $json.output }}",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
3300,
-120
],
"id": "846d7af0-0083-4804-947d-62d281b7e623",
"name": "Responder Telegram",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"modelName": "models/gemini-2.5-pro-preview-03-25",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
2420,
140
],
"id": "434e559e-2dff-4a83-a3cb-9f3fb6055806",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "assistente_interno",
"tableName": "n8n_historico_mensagens",
"contextWindowLength": 10
},
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"typeVersion": 1.3,
"position": [
2560,
140
],
"id": "8ac34afe-e472-4893-b775-ef6e125a372e",
"name": "Postgres Chat Memory",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"descriptionType": "manual",
"toolDescription": "Salva a informa\u00e7\u00e3o de agendamento enviada, para que a secret\u00e1ria saiba que foi enviada.",
"schema": {
"__rl": true,
"mode": "list",
"value": "public"
},
"table": {
"__rl": true,
"value": "n8n_historico_mensagens",
"mode": "list"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"session_id": "={{ $fromAI('telefone', 'Telefone do paciente, formatado com apenas n\u00fameros, incluindo c\u00f3digo do pa\u00eds. Ex.: \"551112345678\"', 'string') }}",
"message": "={ \"type\": \"ai\", \"content\": \"{{ $fromAI('message', 'A mesma mensagem enviada para o paciente.', 'string') }}\" }"
},
"matchingColumns": [
"id"
],
"schema": [
{
"id": "id",
"displayName": "id",
"required": false,
"defaultMatch": true,
"display": true,
"type": "number",
"canBeUsedToMatch": true,
"removed": true
},
{
"id": "session_id",
"displayName": "session_id",
"required": true,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "message",
"displayName": "message",
"required": true,
"defaultMatch": false,
"display": true,
"type": "object",
"canBeUsedToMatch": true
},
{
"id": "created_at",
"displayName": "created_at",
"required": false,
"defaultMatch": false,
"display": true,
"type": "dateTime",
"canBeUsedToMatch": true,
"removed": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.postgresTool",
"typeVersion": 2.6,
"position": [
2700,
140
],
"id": "6af9f4ae-068c-4f39-82f7-1ca0e409876d",
"name": "Salvar memoria",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"sseEndpoint": "https://n8n.fazer.ai/mcp/a2b7a3ee-767c-4689-a8fa-765080bea169/sse"
},
"type": "@n8n/n8n-nodes-langchain.mcpClientTool",
"typeVersion": 1,
"position": [
2820,
140
],
"id": "aa8c08ec-babc-444d-b0d5-6e130f26cfd3",
"name": "MCP Google Calendar"
},
{
"parameters": {
"task": "YXdwUHJaRVoxWDdudFNGNg",
"title": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Title', ``, 'string') }}",
"additionalFields": {
"dueDate": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Due_Date', ``, 'string') }}",
"notes": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Notes', ``, 'string') }}",
"status": "needsAction"
}
},
"type": "n8n-nodes-base.googleTasksTool",
"typeVersion": 1,
"position": [
3100,
140
],
"id": "d97ce350-afea-4853-914d-9fb032094fa8",
"name": "Criar tarefa",
"credentials": {
"googleTasksOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "getAll",
"limit": 5,
"filters": {}
},
"type": "n8n-nodes-base.gmailTool",
"typeVersion": 2.1,
"position": [
3240,
140
],
"id": "8a0c4b04-c7b8-48e6-9678-51354cb9f331",
"name": "Ler emails",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.toolThink",
"typeVersion": 1,
"position": [
3380,
140
],
"id": "563b98a9-bdd0-4823-93c9-d613cc68cb12",
"name": "Refletir"
},
{
"parameters": {
"toolDescription": "Use essa ferramenta para enviar as informa\u00e7\u00f5es de agendamento no WhatsApp.\n\nO telefone deve ser formatado com apenas n\u00fameros, incluindo o c\u00f3digo do pa\u00eds.\n\nExemplo: \"551112345678\"",
"method": "POST",
"url": "={{ $('Info').item.json.url_evolution }}/message/sendText/{{ $('Info').item.json.instancia }}",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "evolutionApi",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"number\": \"{telefone}\",\n \"text\": \"{mensagem}\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"typeVersion": 1.1,
"position": [
2960,
140
],
"id": "a29fe148-3222-4a42-9d9c-abb160dc3c01",
"name": "Enviar reagendamento",
"credentials": {
"evolutionApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Tipo de mensagem": {
"main": [
[
{
"node": "Download \u00e1udio",
"type": "main",
"index": 0
}
],
[
{
"node": "Set mensagem texto",
"type": "main",
"index": 0
}
]
]
},
"Transcrever \u00e1udio": {
"main": [
[
{
"node": "Set mensagem \u00e1udio",
"type": "main",
"index": 0
}
]
]
},
"Set mensagem texto": {
"main": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "main",
"index": 0
}
]
]
},
"Set mensagem \u00e1udio": {
"main": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "main",
"index": 0
}
]
]
},
"Download \u00e1udio": {
"main": [
[
{
"node": "Transcrever \u00e1udio",
"type": "main",
"index": 0
}
]
]
},
"Receber Mensagem Telegram": {
"main": [
[
{
"node": "Info",
"type": "main",
"index": 0
}
]
]
},
"Info": {
"main": [
[
{
"node": "Tipo de mensagem",
"type": "main",
"index": 0
}
]
]
},
"Assistente do escrit\u00f3rio interno": {
"main": [
[
{
"node": "Responder Telegram",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Postgres Chat Memory": {
"ai_memory": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_memory",
"index": 0
}
]
]
},
"Salvar memoria": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
},
"MCP Google Calendar": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
},
"Criar tarefa": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
},
"Ler emails": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
},
"Refletir": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
},
"Enviar reagendamento": {
"ai_tool": [
[
{
"node": "Assistente do escrit\u00f3rio interno",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "12cefd7d-7857-444d-ad52-673520781a69",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "f8qK3TzaLd24p6Hs",
"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.
evolutionApigmailOAuth2googlePalmApigoogleTasksOAuth2ApiopenAiApipostgrestelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
assistente. Uses openAi, telegram, telegramTrigger, agent. Event-driven trigger; 21 nodes.
Source: https://github.com/senaiapy/IA/blob/dee2e863a92473b40c171ee414b750d4a652f9ce/Templates/N8N/assistente.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.
Transform your salon/service business with this streamlined Telegram automation system featuring Claude integration, zero-setup database management, and intelligent conversation handling. Claude MCP I
Jarvis is a powerful multi-agent productivity assistant built in n8n. It works directly from Telegram and can understand both text messages and voice notes.
This template is designed for anyone who wants to use Telegram as a personal AI assistant hub. If you often juggle tasks, emails, calendars, and expenses across multiple tools, this workflow consolida
Multi Agent System Benefits. Uses gmailTool, lmChatOpenAi, agent, googleCalendarTool. Event-driven trigger; 46 nodes.
AI marketing Team Agent. Uses toolWorkflow, telegram, memoryBufferWindow, openAi. Event-driven trigger; 46 nodes.