Facturación automática

Intermedio

Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 9 nodos.Utiliza principalmente nodos como Gmail, Filter, GoogleDrive, HttpRequest, GoogleSheets. Automatización de la facturación y cobro a clientes con Stripe, Google Sheets, Drive y Gmail

Requisitos previos
  • Cuenta de Google y credenciales de API de Gmail
  • Credenciales de API de Google Drive
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Credenciales de API de Google Sheets
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "vJ0wZhatRHwADMcn",
  "meta": {
    "instanceId": "cbe443dad974471e0b4f8b19ab92782e168bbdef84a3d0b94f5f96a67e01c92c",
    "templateCredsSetupCompleted": true
  },
  "name": "AutoInvoicing",
  "tags": [],
  "nodes": [
    {
      "id": "1fc28d00-b93a-47d1-bc7e-9616f36128b2",
      "name": "Hojas de Google Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw/edit?usp=drivesdk",
          "cachedResultName": "ClientPayments"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "DJ7kiXarj7DIKQKE",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4c634c62-6e9e-4948-b2c7-69f278f861c3",
      "name": "Send Correo electrónico via Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        352,
        432
      ],
      "parameters": {
        "toList": [
          "={{ $('Filter').item.json[\"Client Email\"] }}"
        ],
        "message": "Invoice",
        "subject": "Invoice for Services",
        "resource": "message",
        "htmlMessage": "=<!DOCTYPE html> <html> <head>   <meta charset=\"UTF-8\">   <style>     body {       font-family: Arial, sans-serif;       background-color: #f8f9fa;       padding: 20px;     }     .container {       max-width: 600px;       margin: auto;       background: #ffffff;       border: 1px solid #ddd;       border-radius: 8px;       padding: 30px;     }     h2 {       color: #333333;     }     p {       font-size: 15px;       color: #555555;     }     .info {       background: #f1f1f1;       padding: 15px;       border-radius: 6px;       margin-bottom: 20px;     }     .btn {       background-color: #007bff;       color: #ffffff !important;       padding: 12px 20px;       text-decoration: none;       border-radius: 5px;       display: inline-block;       font-weight: bold;     }     .footer {       font-size: 12px;       color: #999999;       margin-top: 30px;       text-align: center;     }   </style> </head> <body>   <div class=\"container\">     <h2>Invoice: {{ $('Filter').item.json[\"Order ID\"] }}</h2>     <p>Dear {{ $('Filter').item.json[\"Client Name\"] }},</p>     <p>Thank you for your business! Please find your invoice details below:</p>      <div class=\"info\">       <p><strong>Invoice Date:</strong> {{ DateTime.now().format('yyyy-LL-dd') }}</p>       <p><strong>Due Date:</strong> {{ $('Filter').item.json[\"Due Date\"] }}</p>       <p><strong>Total Amount:</strong>{{ $('Filter').item.json.Amount }} {{ $('Filter').item.json.Currency }}</p>       <p><strong>Items:</strong><br>{{ $('Filter').item.json[\"Items Description\"] }}</p>     </div>      <p>You can view or download your invoice using the button below:</p>     <p><a class=\"btn\" href=\"https://drive.google.com/file/d/{{ $('Google Drive').item.json.id }}/view?usp=drive_link\" target=\"_blank\">View Invoice</a></p>      <p>To complete your payment, please click below:</p>     <p><a class=\"btn\" href=\"{{ $('Create Stripe Payment Link').item.json.url }}\" target=\"_blank\">Pay Now</a></p>      <p>If you have any questions or concerns, feel free to contact us.</p>      <div class=\"footer\">       © {{ DateTime.now().format('yyyy') }} Your Company Name. All rights reserved.     </div>   </div> </body> </html>",
        "includeHtml": true,
        "additionalFields": {}
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "RhbEB1PDPVVI9T4I",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7221a13f-9278-47e1-b99d-dd063b69b2ab",
      "name": "Filtrar",
      "type": "n8n-nodes-base.filter",
      "position": [
        224,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8b570f11-d7d3-412d-a637-a24fa07008ea",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json[\"Last Updated\"] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "85accbae-199e-4541-8e19-dbfc41339a2a",
      "name": "Create Stripe Product",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -96,
        208
      ],
      "parameters": {
        "url": "https://api.stripe.com/v1/products",
        "options": {
          "bodyContentCustomMimeType": "application/x-www-form-urlencoded"
        },
        "requestMethod": "POST",
        "authentication": "basicAuth",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "name",
              "value": "={{ $json[\"Items Description\"] }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "EPKbd3Ykc72IhBCw",
          "name": "Unnamed credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f69f2dd2-3446-4f83-aa82-e66e4010f233",
      "name": "Create Stripe Price",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        128,
        208
      ],
      "parameters": {
        "url": "https://api.stripe.com/v1/prices",
        "options": {
          "bodyContentCustomMimeType": "application/x-www-form-urlencoded"
        },
        "requestMethod": "POST",
        "authentication": "basicAuth",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "currency",
              "value": "={{ $('Filter').item.json.Currency }}"
            },
            {
              "name": "unit_amount",
              "value": "={{ $('Filter').item.json.Amount }}"
            },
            {
              "name": "product",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "EPKbd3Ykc72IhBCw",
          "name": "Unnamed credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2b785e52-0f4a-4583-ae9b-9df7f19b2ca0",
      "name": "Create Stripe Payment Link",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        352,
        208
      ],
      "parameters": {
        "url": "https://api.stripe.com/v1/payment_links",
        "options": {
          "bodyContentCustomMimeType": "application/x-www-form-urlencoded"
        },
        "requestMethod": "POST",
        "authentication": "basicAuth",
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "line_items[0][price]",
              "value": "={{ $json.id }}"
            },
            {
              "name": "line_items[0][quantity]",
              "value": "1"
            }
          ]
        }
      },
      "credentials": {
        "httpBasicAuth": {
          "id": "EPKbd3Ykc72IhBCw",
          "name": "Unnamed credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "983b3432-dd64-4ffa-9e15-5305840867dd",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -96,
        432
      ],
      "parameters": {
        "name": "=Invoice_{{ $('Filter').item.json[\"Order ID\"] }}",
        "content": "=INVOICE\nInvoice Number: {{ $('Filter').item.json[\"Order ID\"] }}\nDate: {{  DateTime.now().format('yyyy-MM-dd') }}\nDue Date: {{ $('Filter').item.json[\"Due Date\"] }}\nClient Name: {{ $('Filter').item.json[\"Client Name\"] }}\nClient Email: {{ $('Filter').item.json[\"Client Email\"] }}\n\n\n\nDescription:\n{{ $('Filter').item.json[\"Items Description\"] }}\n\nAmount:\n{{ $('Filter').item.json.Amount }}\n\n\n\n\nTotal Amount: {{ $('Filter').item.json.Amount }} {{ $('Filter').item.json.Currency }}\nPlease complete your payment using the link below:\n{{ $('Create Stripe Payment Link').item.json.url }}\n\nThank you for your business!\nIf you have any questions, feel free to contact us.\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1FfQW6DeAd0UPj-CFFEsXqgE43I2V6zDX",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1FfQW6DeAd0UPj-CFFEsXqgE43I2V6zDX",
          "cachedResultName": "Youtube"
        },
        "operation": "createFromText"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "LxrpvgkD31trhdub",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a43b8711-6c28-40e3-aa60-3883b6cdacca",
      "name": "Hojas de Google",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        128,
        432
      ],
      "parameters": {
        "columns": {
          "value": {
            "Order ID": "={{ $('Filter').item.json[\"Order ID\"] }}",
            "Invoice Link": "={{ $json.id }}",
            "Last Updated": "={{ DateTime.now() }}",
            "Stripe Payment Link": "={{ $('Create Stripe Payment Link').item.json.url }}"
          },
          "schema": [
            {
              "id": "Order ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Order ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Client Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Client Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Client Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Client Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Items Description",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Items Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Due Date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Due Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Currency",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Currency",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Invoice Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Invoice Link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Invoice Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Stripe Payment Link",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Stripe Payment Link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Payment Received On",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Payment Received On",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Updated",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Updated",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Order ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1xRWt65Mu7Lx_LAbCdf_FsZmO0MW2o61kMPM854_L4jw/edit?usp=drivesdk",
          "cachedResultName": "ClientPayments"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uqJcQ13LuCAaohLN",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "4dbe5318-59e7-4787-b397-64aabdc6a3e7",
      "name": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        -32
      ],
      "parameters": {
        "width": 560,
        "height": 848,
        "content": "## 🛠 Setup Guide  \n\n### Prerequisites  \n- **n8n account**  \n- **Google Sheets & Google Drive credentials**  \n- **Gmail API credentials**  \n- **Stripe API Key**  \n\n### Steps  \n1. **Clone/Import Workflow**  \n   - Import the workflow JSON file into your **n8n** instance.  \n\n2. **Configure Google Sheets**  \n   - Create a Google Sheet with columns:  \n     - `Order ID, Client Name, Client Email, Items Description, Due Date, Amount, Currency, Invoice Status, Invoice Link, Stripe Payment Link, Last Updated`  \n   - Connect your **Google Sheets node** to this sheet.  \n\n3. **Set Up Stripe**  \n   - Obtain your **Stripe Secret Key** from [Stripe Dashboard](https://dashboard.stripe.com/).  \n   - Add it in the Stripe nodes for **Product**, **Price**, and **Payment Link** creation.  \n\n4. **Google Drive**  \n   - Configure to store invoice backups (optional).  \n\n5. **Gmail**  \n   - Authorize Gmail and set up the **Send Email** node.  \n   - Customize the email template with client details and the Stripe link.  \n\n6. **Test the Workflow**  \n   - Add a sample row in Google Sheets.  \n   - Run the workflow manually or update the sheet to trigger automatically.  \n   - Verify that the Stripe link is created, updated in the sheet, and emailed to the client.  "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e166fc02-4473-4099-b669-e6898694feff",
  "connections": {
    "Filter": {
      "main": [
        [
          {
            "node": "85accbae-199e-4541-8e19-dbfc41339a2a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "983b3432-dd64-4ffa-9e15-5305840867dd": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Send Email via Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f69f2dd2-3446-4f83-aa82-e66e4010f233": {
      "main": [
        [
          {
            "node": "2b785e52-0f4a-4583-ae9b-9df7f19b2ca0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "85accbae-199e-4541-8e19-dbfc41339a2a": {
      "main": [
        [
          {
            "node": "f69f2dd2-3446-4f83-aa82-e66e4010f233",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2b785e52-0f4a-4583-ae9b-9df7f19b2ca0": {
      "main": [
        [
          {
            "node": "983b3432-dd64-4ffa-9e15-5305840867dd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿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 - Creación de contenido, 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

Generación automática de videos de productos utilizando Gemini, FAL y Google Workspace
Usar Gemini, FAL y Google Workspace para generar videos de productos automáticamente
Wait
Filter
Google Drive
+
Wait
Filter
Google Drive
16 NodosCong Nguyen
Creación de contenido
AI驱动decorreo electrónico分诊与automático回复系统,integraciónOpenAIagenteyGmail
AI驱动decorreo electrónico分诊与automático回复系统,integraciónOpenAIagenteyGmail
If
Set
Gmail
+
If
Set
Gmail
68 NodosAbdullahi Ahmed
Creación de contenido
💥 Automatización de la creación y publicación de videos de IA multiplataforma con Veo 3.1 y Blotato - Video
Usar GPT-4, Veo 3.1 y Blotato para automatizar la creación de videos de IA y su publicación en múltiples plataformas
Set
Code
Merge
+
Set
Code
Merge
25 NodosDr. Firas
Creación de contenido
Automatización de videos cortos sin rostro usando OpenAI, RunwayML y ElevenLabs
Automatización de videos cortos sin rostro usando OpenAI, RunwayML y ElevenLabs: del guion a las redes sociales
Set
Code
Wait
+
Set
Code
Wait
56 NodosLeeWei
Creación de contenido
Extracción de datos de Google Maps
Generación automatizada de leads de Google Maps con Perplexity AI y verificación de correo electrónico
If
Set
Code
+
If
Set
Code
18 NodosAntxon Pous
Creación de contenido
Creación automática de contenido de LinkedIn usando Gemini AI, generador de imágenes Flux y análisis de publicaciones populares
Creación automática de contenido de LinkedIn mediante análisis de publicaciones populares con Gemini AI y generación de imágenes Flux
Code
Wait
Filter
+
Code
Wait
Filter
20 NodosRoshan Ramani
Creación de contenido
Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos9
Categoría2
Tipos de nodos7
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Autor
Rohit Dabra

Rohit Dabra

@rohitdabra

As the CTO of QServices, I lead digital transformation for startups and SMBs by building scalable, AI-powered SaaS solutions that solve real-world business challenges.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34