Skip to main content

Automate medical billing with Google Sheets and Gmail

Workflow preview

Workflow preview
100%
Automate medical billing with Google Sheets and Gmail preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automate Medical Billing with Google Sheets and Gmail Note : This template is designed for self hosted n8n instances. The workflow image above shows the complete automation flow. This n8n workflow ...

Best for

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

Tools used

n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.formtrigger, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.gmail, n8n-nodes-base.googlesheets

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate medical billing with Google Sheets and Gmail
Workflow name
Automate medical billing with Google Sheets and Gmail

Automate Medical Billing with Google Sheets and Gmail

Note: This template is designed for self-hosted n8n instances. The workflow image above shows the complete automation flow.

This n8n workflow automates the patient billing process—from form submission to invoice generation, email delivery, and Google Sheets logging.


🏥 Who is this for?

This workflow is ideal for:

  • Private medical clinics
  • Health service providers
  • Medical office administrators
  • Telehealth services
  • Billing departments

💡 What problem does this workflow solve?

Medical billing often involves repetitive data entry, invoice calculation, and communication. This workflow:

  • Eliminates manual invoice generation
  • Ensures accurate and consistent pricing for treatments
  • Sends automated, personalized invoices to patients
  • Logs all billing details in a Google Sheet for recordkeeping
  • Alerts staff when patient data is missing

⚙️ What this workflow does

This automation builds a streamlined billing system that:

  1. Captures patient info via an embedded n8n form
  2. Formats visit dates for professional presentation
  3. Calculates invoice totals based on treatment selection
  4. Sends email invoices to patients using Gmail
  5. Logs billing data into Google Sheets
  6. Notifies admin via Slack if submission is incomplete

✅ Setup Instructions

🔑 Prerequisites

Before starting, ensure you have:

  • A self-hosted n8n instance

  • A Google account with access to:

    • Gmail
    • Google Sheets
  • A Slack Webhook URL (optional but included)

  • A designated Google Sheet to store invoices


📋 Step 1: Google Sheet Setup

Create a new Google Sheet and add the following columns in the first row (must match exactly):

Invoice No | Patient Name | Email | Date | Total Cost | Line Items | Payment Status

> ✅ Customizable: You can add columns like “Insurance Provider” or “Payment Status” if needed—just update the mapping in the Google Sheets node.


🗂️ Step 2: Configure Google Credentials in n8n

In n8n:

  • Go to Settings → Credentials

  • Add:

    • Google Sheets OAuth2
    • Gmail OAuth2
  • Ensure proper scopes are granted:

    • .../auth/spreadsheets
    • .../auth/gmail.send

🧾 Step 3: Configure Treatment Pricing

In the Calculate prices code node:

const treatmentPrices = {
  "General Consultation": 60,
  "Blood Test - Basic Panel": 45,
  "Blood Test - Comprehensive": 120,
  "X-Ray - Single": 80,
  "Physical Therapy Session": 75,
  "Vaccination - Standard": 40,
  "Specialist Consultation": 120,
  "Minor Procedure": 150
};

> ✏️ Customizable: Add, remove, or change treatment names and prices.


🌐 Step 4: Embed the Patient Billing Form

In the On form submission node:

  • The form collects:

    • Patient Name
    • Email Address
    • Visit Date
    • Selected Treatments (multi-select dropdown)

> ✏️ Customizable: Modify the form fields to include phone number, insurance info, etc.


📬 Step 5: Customize the Email Template

Open the Send Patient Invoice Email node:

Example message:

Hi {{ $json.patientName }},

Thank you for visiting MediSure Clinic on {{ $json.formattedDate }}.
Here is a summary of your treatments:
{{ $json.lineItems }}

Total Due: **${{ $json.totalCost }}**

Best regards,  
MediSure Billing Department

> ✏️ Customizable: Adjust the message, branding, and subject line to match your practice.


🧠 Step 6: Handle Errors

The Error Check and Generate Error Message nodes ensure:

  • No invoice is sent without an email
  • Admins are alerted via Slack if critical info is missing

> ✏️ Customizable: Replace Slack with email, webhook, or CRM notification if preferred.


🧾 Step 7: Log to Google Sheets

The Log Invoice to Googlesheets node appends each record:

  • Invoice number
  • Patient name
  • Email
  • Date
  • Total cost
  • Line items

> ✏️ Customizable: You can change the target spreadsheet or sheet name.


🔄 Testing

Once configured:

  1. Toggle the workflow Active

  2. Submit a test form

  3. Check:

    • Email receipt is accurate
    • Data is correctly appended in Google Sheets
    • No errors are logged

✨ How to Customize This Workflow

Component How to Customize
Treatment Prices Edit Calculate prices node code
Form Fields Modify the On form submission node
Email Body Change message in Send Patient Invoice Email
Slack Alerts Replace Slack node with email or CRM action
Google Sheet Fields Add/remove columns and update mappings

🧩 Integrate with Your Stack

Add downstream automations easily:

  • Push to QuickBooks or Stripe for payment processing
  • Create a calendar invite for follow-ups
  • Sync with a CRM like HubSpot

🛠️ Troubleshooting

Issue Fix
Email not sent Check Gmail credentials & quotas
Spreadsheet not updating Confirm sheet ID and column names
Pricing not accurate Review Calculate prices logic
Slack alert not sent Check webhook URL format

🤝 Need Help?

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 - Data Structure1

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

Block 2 - Error Check1

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

Block 3 - Admin Notification1

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

Block 4 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 5 - Calculate prices

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

Block 6 - Format Date

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

Block 7 - Sticky Note

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

Block 8 - Generate Error Message1

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

Block 9 - Send Patient Invoice Email

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

Block 10 - Log Invoice to Googlesheets

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

Block 11 - Sticky Note1

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

3. Summary Table

Workflow Automate medical billing with Google Sheets and Gmail
Complexity intermediate
Nodes 11
Categories Invoice Processing
Author David Olusola
Published 12 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3998/3998.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 Automate medical billing with Google Sheets and Gmail do?

Automate Medical Billing with Google Sheets and Gmail Note : This template is designed for self hosted n8n instances. The workflow image above shows the complete automation flow. This n8n workflow ...

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.