This workflow follows the Agent → Chat Trigger 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": "Agente de NF-3",
"nodes": [
{
"parameters": {
"public": true,
"initialMessages": "Ol\u00e1, sou ProcessIA.\nEnviei seu arqzip par atualizar meus dados, caso n\u00e3o queira pode fazer as perguntas que tenho alguns dados aqui.",
"options": {
"allowFileUploads": true
}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.1,
"position": [
-2580,
-780
],
"id": "d2e72790-d762-499a-a90f-8bf0c1e8249c",
"name": "When chat message received"
},
{
"parameters": {
"binaryPropertyName": "=data0",
"outputPrefix": "=file_"
},
"type": "n8n-nodes-base.compression",
"typeVersion": 1.1,
"position": [
-1570,
-840
],
"id": "3a35c9ea-f3a2-4a7c-ad8a-efbb1422f2fd",
"name": "Compression"
},
{
"parameters": {
"binaryPropertyName": "file_0",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
-1240,
-940
],
"id": "4d6951d3-a76b-41db-a435-4992558dfb22",
"name": "Extract from File"
},
{
"parameters": {
"options": {
"systemMessage": "Atue como ProcessIA, um agente de intelig\u00eancia financeira especializado em an\u00e1lise de notas fiscais e relat\u00f3rios tribut\u00e1rios, com 15 anos de experi\u00eancia atendendo empresas de m\u00e9dio e grande porte.\n\nSeu objetivo \u00e9 atender com precis\u00e3o e cordialidade as solicita\u00e7\u00f5es dos usu\u00e1rios via chat, utilizando exclusivamente a ferramenta Banco_dados, que busca informa\u00e7\u00f5es de notas fiscais (NF) em uma planilha do Google Sheets.\nNunca alucine informa\u00e7\u00f5es ou forne\u00e7a respostas gen\u00e9ricas sem consultar a ferramenta. Sempre consulte a ferramenta antes de qualquer resposta relacionada a dados fiscais.\n\n\ud83c\udfaf Diretrizes de Resposta:\nSempre se apresente para novos usu\u00e1rios, de forma breve, cordial e profissional.\nExemplo:\n\"Ol\u00e1! Sou o ProcessIA, seu assistente financeiro especializado em an\u00e1lise de notas fiscais. Em que posso ajudar voc\u00ea hoje?\"\n\nObrigatoriamente consulte a ferramenta Banco_dados antes de formular qualquer resposta.\n\u279d Se a ferramenta apresentar erro ou n\u00e3o retornar dados, informe isso de forma educada ao usu\u00e1rio, sem inventar informa\u00e7\u00f5es.\n\nNunca informe ao usu\u00e1rio que n\u00e3o tem acesso ao banco de dados enquanto a ferramenta estiver dispon\u00edvel.\n\nResponda de forma objetiva, em portugu\u00eas, utilizando os dados encontrados na consulta.\n\nApresente listas de forma organizada em bullet points, com nome da empresa e valor na frente.\n\nSeja positivo e mantenha uma linguagem profissional, sem uso excessivo de jarg\u00f5es t\u00e9cnicos.\n\n\ud83d\udcca Ferramenta Dispon\u00edvel:\nBanco_dados: Fun\u00e7\u00e3o que realiza busca de informa\u00e7\u00f5es de notas fiscais (NF) para responder perguntas e consultas do usu\u00e1rio.\nCalculadora: Para auxiliar nas solicita\u00e7\u00f5es de calculos (somas, multiplica\u00e7\u00f5es, divis\u00f5es, subtra\u00e7\u00f5es e percentuais, por exemplo)\n\n\ud83d\udcda Exemplos de Resposta:\nPergunta:\nQual \u00e9 o maior valor de compra ou nota que temos?\n\nResposta:\n\u2705 O maior valor de compra registrado \u00e9 de R$ 58.720,00 da empresa Comercial Santana Ltda.\n\nPergunta:\nListe as 10 maiores NF.\n\nResposta:\n\u2705 Aqui est\u00e1 a lista das 10 maiores notas fiscais:\n* Comercial Santana Ltda: R$ 58.720,00\n* Ind\u00fastria XPTO SA: R$ 53.200,00\n* Log\u00edstica Alfa Ltda: R$ 50.500,00\n(e assim por diante...)\n",
"returnIntermediateSteps": false
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.9,
"position": [
-1868,
-540
],
"id": "b1b8e161-b274-4207-9653-a6fefb1bc36b",
"name": "AI Agent",
"onError": "continueRegularOutput"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $('Switch').item.json.chatInput }}",
"contextWindowLength": 10
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-1780,
-320
],
"id": "42f5742e-f6a0-43f7-8877-79bc823cf8b4",
"name": "Simple Memory"
},
{
"parameters": {
"binaryPropertyName": "file_1",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
-1240,
-740
],
"id": "2d4be509-c02e-4bfb-8824-83e96e6fa2af",
"name": "Extract from File1"
},
{
"parameters": {
"modelName": "models/gemini-2.0-flash-lite",
"options": {
"maxOutputTokens": 2048,
"temperature": 0.4,
"topK": 32,
"topP": 1
}
},
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"typeVersion": 1,
"position": [
-1900,
-320
],
"id": "0ee346e4-2aed-4582-95e0-654038483d55",
"name": "Google Gemini Chat Model",
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "combine",
"fieldsToMatchString": "['CHAVE DE ACESSO']",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.1,
"position": [
-1020,
-840
],
"id": "0d6eb47e-4c6f-4ca9-a29b-ef6d5fcbc219",
"name": "Merge"
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": {
"__rl": true,
"value": "1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw",
"mode": "list",
"cachedResultName": "i2a2",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "P\u00e1gina1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw/edit#gid=0"
},
"columns": {
"mappingMode": "autoMapInputData",
"value": {},
"matchingColumns": [
"CHAVE DE ACESSO"
],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
-800,
-840
],
"id": "72c0dcbb-d51f-406a-a196-200d769521ad",
"name": "Google Sheets",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "38fe7579-41ce-4b99-b33c-c82e71f5c315",
"leftValue": "={{ $json.files[0] }}",
"rightValue": "",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
}
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Anexo"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.chatInput }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"id": "0befcd8f-5048-4c19-ae12-ef31697283bf"
}
],
"combinator": "and"
},
"renameOutput": true,
"outputKey": "Texto"
}
]
},
"options": {
"allMatchingOutputs": true
}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
-2360,
-780
],
"id": "e74654fe-625b-4246-b662-77fe65ce4526",
"name": "Switch"
},
{
"parameters": {
"documentId": {
"__rl": true,
"value": "1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw",
"mode": "list",
"cachedResultName": "i2a2",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "P\u00e1gina1",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1YWW9ExUC992aKEzHcu4tAGY4cKA_THNzsx9b5n_5Smw/edit#gid=0"
},
"options": {
"dataLocationOnSheet": {
"values": {
"rangeDefinition": "detectAutomatically",
"readRowsUntil": "firstEmptyRow"
}
},
"outputFormatting": {
"values": {
"general": "FORMATTED_VALUE",
"date": "FORMATTED_STRING"
}
}
}
},
"type": "n8n-nodes-base.googleSheetsTool",
"typeVersion": 4.5,
"position": [
-1660,
-320
],
"id": "03e66227-83ba-427f-a69d-fd9f4a47577e",
"name": "Banco_Dados",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
"typeVersion": 1,
"position": [
-1520,
-320
],
"id": "30450c62-6e76-4ecb-8e0c-0d02ce83bdfe",
"name": "Calculator"
}
],
"connections": {
"When chat message received": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Compression": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
},
{
"node": "Extract from File1",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Extract from File1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Compression",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Banco_Dados": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Google Sheets": {
"main": [
[]
]
},
"Calculator": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "5f6456d8-ef7e-45dc-97a6-fdf6dc569240",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "Uh8TyFjjA7MHmodt",
"tags": [
{
"createdAt": "2025-06-21T15:06:18.854Z",
"updatedAt": "2025-06-21T15:06:18.854Z",
"id": "QtBnpscUmzI7i8ao",
"name": "i2a2"
}
]
}
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.
googlePalmApigoogleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Agente de NF-3. Uses chatTrigger, compression, agent, memoryBufferWindow. Chat trigger; 12 nodes.
Source: https://github.com/Kiemberly-ProcessIA/Grupo-de-estudos-/blob/29de04f38e371bcdb2fc2eaff589f93221cde026/json/agent.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.
teste. Uses chatTrigger, agent, lmChatGroq, memoryBufferWindow. Chat trigger; 24 nodes.
pix-zap. Uses chatTrigger, agent, toolCalculator, toolWikipedia. Chat trigger; 21 nodes.
This workflow provides a chat-based CRM assistant powered by Google Gemini that can append new leads to a Google Sheets “Leads” tab, answer pipeline questions by reading the sheet, and log each conver
This workflow provides a chat-based research assistant powered by Google Gemini that can look up facts on Wikipedia, do calculations, and remember context, while also tagging each user question and lo
Who is this workflow for? This workflow is designed for SEO analysts, content creators, marketing agencies, and developers who need to index a website and then interact with its content as if it were