Skip to main content

Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion

Workflow preview

Workflow preview
100%
Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion preview
Open on n8n.io

1. Workflow Overview

How it works This workflow triggers when a HubSpot deal stage changes to Closed Won and automatically generates an invoice. It collects deal and contact data, builds a styled invoice, converts it i...

Best for

  • Invoice Processing automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.hubspottrigger, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.notion, n8n-nodes-base.gmail, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Avkash Kakdiya.

Original n8n.io source

1.1 Workflow description

Title
Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion
Workflow name
Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion

How it works

This workflow triggers when a HubSpot deal stage changes to Closed Won and automatically generates an invoice. It collects deal and contact data, builds a styled invoice, converts it into a PDF, and sends it to the client. The system logs all invoices and alerts the team, then monitors payment status with automated reminders. If payment is delayed, it escalates the issue and handles errors separately.

Step-by-step

  • Trigger and data collection

  • HubSpot - Deal Trigger – Starts workflow on deal stage change.

  • IF - Is Deal Closed Won? – Filters only Closed Won deals.

  • HTTP - Get Deal Details – Fetches deal information.

  • HTTP - Get Deal Associations – Retrieves linked contacts.

  • Code - Extract Contact ID – Extracts and formats data.

  • HTTP - Get Contact Details – Gets customer details.

  • Invoice generation

  • Code - Build Invoice + HTML – Creates invoice data and HTML layout.

  • Send and store invoice

  • HTTP - Generate PDF – Converts HTML into PDF.

  • Google Sheets - Log Invoice – Stores invoice records.

  • Notion - Create Invoice Record – Tracks invoice internally.

  • Gmail - Send Invoice Email – Sends invoice to client.

  • Slack - Invoice Sent Alert – Notifies team.

  • Payment tracking and follow-up

  • Wait - 7 Day Payment Window – Waits before checking payment.

  • HTTP - Recheck Deal Stage – Checks payment status.

  • IF - Payment Received? – Branches based on payment.

  • Gmail - Follow-up Email #1 – Sends reminder if unpaid.

  • Wait - 5 More Days – Adds extra delay.

  • HTTP - Final Payment Check – Verifies final status.

  • Slack - Payment Confirmed – Confirms successful payment.

  • Escalation handling

  • IF - Still Unpaid? (Escalate) – Detects overdue invoices.

  • Slack - Escalation Alert – Alerts team for action.

  • Notion - Flag as Overdue – Updates record status.

  • Slack - Late Payment Confirmed – Handles delayed payments.

  • Error handling (separate flow)

  • Error Trigger – Captures workflow failures.

  • Slack - Workflow Error Alert – Sends error notification.

Why use this?

  • Fully automates invoicing from deal closure to payment tracking
  • Reduces manual billing work and human errors
  • Improves payment collection with automated reminders
  • Provides clear visibility with logs and team alerts
  • Ensures reliability with built-in error monitoring

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - 🎯 HubSpot - Deal Trigger

Type / Role
n8n-nodes-base.hubspotTrigger - hubspotTrigger
Config choices
Version 1

Block 2 - 🔀 IF - Is Deal Closed Won?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 3 - 🏷️ HTTP - Get Deal Details

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 4 - 🔗 HTTP - Get Deal Associations

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 5 - ⚙️ Code - Extract Contact ID

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - 👤 HTTP - Get Contact Details

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 7 - 📄 Code - Build Invoice + HTML

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - 🖨️ HTTP - Generate PDF

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 9 - 📊 Google Sheets - Log Invoice

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 10 - 📓 Notion - Create Invoice Record

Type / Role
n8n-nodes-base.notion - notion
Config choices
Version 2

Block 11 - 📧 Gmail - Send Invoice Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2

Block 12 - 💬 Slack - Invoice Sent Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 13 - ⏳ Wait - 7 Day Payment Window

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 14 - 🔍 HTTP - Recheck Deal Stage

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 15 - 🔀 IF - Payment Received?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 16 - ✅ Slack - Payment Confirmed

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 17 - 📧 Gmail - Follow-up Email #1

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2

Block 18 - ⏳ Wait - 5 More Days

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1

Block 19 - 🔍 HTTP - Final Payment Check

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4

Block 20 - 🔀 IF - Still Unpaid? (Escalate)

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 21 - 🚨 Slack - Escalation Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 22 - 📓 Notion - Flag as Overdue

Type / Role
n8n-nodes-base.notion - notion
Config choices
Version 2

Block 23 - ✅ Slack - Late Payment Confirmed

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2

Block 24 - ⚡ Error Trigger

Type / Role
n8n-nodes-base.errorTrigger - errorTrigger
Config choices
Version 1

Showing the first 24 of 32 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion
Complexity advanced
Nodes 32
Categories Invoice Processing
Author Avkash Kakdiya
Published 24 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14289/14289.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate and track invoices with HubSpot, Gmail, Slack, Sheets, and Notion do?

How it works This workflow triggers when a HubSpot deal stage changes to Closed Won and automatically generates an invoice. It collects deal and contact data, builds a styled invoice, converts it i...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing use case.