Skip to main content

Export PDF invoices from SmartBill to Google Drive

Workflow preview

Workflow preview
100%
Export PDF invoices from SmartBill to Google Drive preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This workflow automates the retrieval of invoice PDFs from the Smartbill API and saves them to Google Drive in a dynamically created folder based on last month’s date. It also generates a range of ...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.stickynote, n8n-nodes-base.googledrive, n8n-nodes-base.if, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Codez & AI.

Original n8n.io source

1.1 Workflow description

Title
Export PDF invoices from SmartBill to Google Drive
Workflow name
Export PDF invoices from SmartBill to Google Drive

This workflow automates the retrieval of invoice PDFs from the Smartbill API and saves them to Google Drive in a dynamically created folder based on last month’s date. It also generates a range of invoice numbers, ensuring proper formatting, and uploads each PDF with a structured filename.

Overview

  1. Trigger and Data Setup:
    The workflow is manually triggered. It sets the invoice range (start and end numbers), invoice series, the parent Google Drive folder ID and the folder where to save the PDF files.

  2. Folder Handling:

    • Folder Name Calculation: Calculates a default folder name based on last month’s date (formatted as YYYY-MM).
  3. Invoice Generation:
    A code node generates invoice items by iterating over a specified range of numbers. Each invoice number is padded to custom number of digits (e.g., 0013), and the invoice series and folder ID are attached to each item.

  4. Retrieving Invoice PDFs:
    For each generated invoice, the Smartbill API is called (using an HTTP Request node) to retrieve the corresponding invoice PDF.

How to Use

  • Credentials:
    Ensure you have configured the Smartbill API (HTTP Basic Auth) and Google API credentials correctly.

  • Parameter Adjustment:
    Modify the SetData node if you need to change the invoice range, series, or target parent folder.

  • Execution:
    Click Execute Workflow to run the workflow manually.

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 - When clicking "Execute Workflow"

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

Block 2 - Smartbill get invoice pdf

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

Block 3 - SetData

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

Block 4 - Set mime

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

Block 5 - Sticky Note

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

Block 6 - Sticky Note1

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

Block 7 - Set Default Folder Name

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

Block 8 - Search Drive Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 9 - If exists

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

Block 10 - Create Drive Folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 11 - Set the loop

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

Block 12 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 13 - Upload file to Google Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 14 - Wait a sec

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

Block 15 - Set Folder ID

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

3. Summary Table

Workflow Export PDF invoices from SmartBill to Google Drive
Complexity advanced
Nodes 15
Categories Invoice Processing
Author Codez & AI
Published 12 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2887/2887.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 Export PDF invoices from SmartBill to Google Drive do?

This workflow automates the retrieval of invoice PDFs from the Smartbill API and saves them to Google Drive in a dynamically created folder based on last month’s date. It also generates a range of ...

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.