Agente de seguimiento de facturas
Este es unInvoice Processing, Multimodal AIflujo de automatización del dominio deautomatización que contiene 8 nodos.Utiliza principalmente nodos como Cron, Function, EmailSend, GoogleSheets. Seguimiento automático de facturas mediante Google Sheets y correo electrónico, con tono de respuesta inteligente
- •Credenciales de API de Google Sheets
Nodos utilizados (8)
{
"id": "RdYMo0ozk6r4oyLm",
"meta": {
"instanceId": "a287613f1596da776459594685fbf4e2b4a12124f80ab8c8772f5e37bff103ae",
"templateCredsSetupCompleted": true
},
"name": "Invoice Follow Up Agent",
"tags": [],
"nodes": [
{
"id": "bf973089-06fa-4da5-a823-9cc6e0823387",
"name": "Disparador Diario",
"type": "n8n-nodes-base.cron",
"position": [
-980,
80
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 6
}
]
}
},
"typeVersion": 1
},
{
"id": "8c35f2a2-8bb3-4608-b95d-ffa8292fa813",
"name": "Cargar Facturas",
"type": "n8n-nodes-base.googleSheets",
"position": [
-780,
80
],
"parameters": {
"range": "Invoices!A1:G1000",
"options": {},
"sheetId": "YOUR_SHEET_ID",
"operation": "lookup",
"authentication": "oAuth2"
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "4Y2ksdr35dFDo0rB",
"name": "maranata"
}
},
"typeVersion": 1
},
{
"id": "0874c817-026c-4d88-80e8-e92aa2b51bca",
"name": "Filtrar Facturas Vencidas",
"type": "n8n-nodes-base.function",
"position": [
-580,
80
],
"parameters": {
"functionCode": "\nreturn items.filter(item => {\n const dueDate = new Date(item.json.due_date);\n const today = new Date();\n return item.json.status.toLowerCase() === \"unpaid\" && dueDate < today;\n});\n"
},
"typeVersion": 1
},
{
"id": "b296c45e-755c-436f-9791-c2015e7ed0e6",
"name": "Calcular DPD",
"type": "n8n-nodes-base.function",
"position": [
-380,
80
],
"parameters": {
"functionCode": "\nreturn items.map(item => {\n const dueDate = new Date(item.json.due_date);\n const today = new Date();\n const dpd = Math.floor((today - dueDate) / (1000 * 60 * 60 * 24));\n item.json.dpd = dpd;\n return item;\n});\n"
},
"typeVersion": 1
},
{
"id": "303f0f3b-6fd4-4546-83ba-20158ceb0a8a",
"name": "Generar Mensaje",
"type": "n8n-nodes-base.function",
"position": [
-180,
80
],
"parameters": {
"functionCode": "\nreturn items.map(item => {\n const dpd = item.json.dpd;\n let tone = \"\";\n if (dpd <= 7) {\n tone = `Hi ${item.json.client_name}, just a quick reminder about your invoice #${item.json.invoice_number} due on ${item.json.due_date}. Let us know if you need anything!`;\n } else if (dpd <= 14) {\n tone = `Hi ${item.json.client_name}, your invoice #${item.json.invoice_number} is now ${dpd} days overdue. Please arrange the payment soon.`;\n } else {\n tone = `Final Reminder: Invoice #${item.json.invoice_number} is ${dpd} days overdue. Immediate payment is required to avoid further action.`;\n }\n item.json.message = tone;\n return item;\n});\n"
},
"typeVersion": 1
},
{
"id": "d636929c-5cc3-4eeb-87cf-c417ee5bc439",
"name": "Enviar Correo",
"type": "n8n-nodes-base.emailSend",
"position": [
20,
80
],
"parameters": {
"text": "={{$json.message}}",
"options": {},
"subject": "Invoice Reminder"
},
"typeVersion": 1
},
{
"id": "22c96891-4f97-42f4-94fc-670639fde6e2",
"name": "Nota Adhesiva",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
20
],
"parameters": {
"color": 3,
"width": 1300,
"height": 240,
"content": "## Flow\n"
},
"typeVersion": 1
},
{
"id": "ec179bef-03c4-4a02-8f80-97eb4c6290b5",
"name": "Nota Adhesiva1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1040,
280
],
"parameters": {
"color": 4,
"width": 960,
"height": 900,
"content": "# AI Invoice & Payment Follow-Up Agent\n\n## 🧨 Problem\nFreelancers, agencies, and businesses often deal with late payments from clients. Manually tracking unpaid invoices, calculating how overdue they are, and following up takes time and often leads to inconsistent communication or missed revenue.\n\n## ✅ Solution\nThis AI Agent automates the entire invoice follow-up process. It scans unpaid invoices daily, calculates how many days they are overdue (Days Past Due / DPD), and sends personalized reminder emails with different tones depending on how long the invoice has been unpaid.\n\n## 👤 This AI Agent Is For:\n- Freelancers and consultants\n- Digital agencies\n- Finance and billing teams\n- Subscription-based services\n- Anyone managing invoice collections\n\n## 📦 Scope\n- Daily scan of unpaid invoices (via Google Sheets)\n- Filters invoices that are overdue\n- Calculates Days Past Due (DPD)\n- Generates personalized reminder messages with varying tone based on DPD\n- Sends follow-up via Email (can be extended to WhatsApp or Slack)\n- Logs all follow-ups for accountability\n\n## ⚙️ How to Set Up\n1. Replace `YOUR_SHEET_ID` with your actual Google Sheet ID that contains invoice data (columns like `client_name`, `email`, `due_date`, `invoice_number`, `status`)\n2. Customize the reminder messages if needed (in the “Generate Message” node)\n3. Set your email credentials in the Email node (SMTP or Gmail)\n4. Optionally connect to WhatsApp API, Notion, or Slack for multichannel reminders\n5. Activate the Cron Trigger to run daily\n\n> Optional: Expand the workflow with penalty logic, automated PDF resend, or Google Calendar reminders for internal finance tracking.\n\n"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "47470742-6e89-46dd-a951-a7a3c9c6b7da",
"connections": {
"b296c45e-755c-436f-9791-c2015e7ed0e6": {
"main": [
[
{
"node": "303f0f3b-6fd4-4546-83ba-20158ceb0a8a",
"type": "main",
"index": 0
}
]
]
},
"bf973089-06fa-4da5-a823-9cc6e0823387": {
"main": [
[
{
"node": "8c35f2a2-8bb3-4608-b95d-ffa8292fa813",
"type": "main",
"index": 0
}
]
]
},
"8c35f2a2-8bb3-4608-b95d-ffa8292fa813": {
"main": [
[
{
"node": "0874c817-026c-4d88-80e8-e92aa2b51bca",
"type": "main",
"index": 0
}
]
]
},
"303f0f3b-6fd4-4546-83ba-20158ceb0a8a": {
"main": [
[
{
"node": "d636929c-5cc3-4eeb-87cf-c417ee5bc439",
"type": "main",
"index": 0
}
]
]
},
"0874c817-026c-4d88-80e8-e92aa2b51bca": {
"main": [
[
{
"node": "b296c45e-755c-436f-9791-c2015e7ed0e6",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - Procesamiento de facturas, IA Multimodal
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Bheta Maranatha
@marthCompartir este flujo de trabajo