Automated PDF Invoice Export from SmartBill to Google Drive - n8n Workflow

Automate exporting SmartBill PDF invoices to Google Drive using this reusable n8n workflow. Includes folder creation, file fetching via HTTP Request, and robust looping.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Accountants needing reliable automated backup of monthly invoices.

  • Small business owners who use SmartBill and Google Drive for critical document management.

  • Users looking for practical n8n templates demonstrating conditional logic and looping (Split In Batches n8n node) with file operations.

  • Developers needing an n8n workflow example for handling external API file downloads and cloud storage interactions.

Overview

Managing financial records manually can be time-consuming and prone to errors. This powerful n8n workflow solves the problem of manually downloading invoices from SmartBill and uploading them to cloud storage. By leveraging the flexibility of the n8n platform, this automation template ensures that all your SmartBill PDF invoices are systematically fetched via an HTTP Request n8n node and securely stored in a designated Google Drive folder. If the required destination folder doesn't exist, the n8n workflow automatically creates it, providing a robust and hands-free solution for critical document backup and organization. This particular n8n template showcases effective use of flow control and file handling within a reliable data pipeline.

How it Works


  1. Trigger: The process is initiated manually using the "When clicking 'Execute Workflow'" n8n trigger.

  2. Initialization: The n8n workflow uses the SetData and Set Default Folder Name n8n nodes to define the target Google Drive folder name and the list of invoices that need processing.

  3. Folder Check: The Search Drive Folder Google Drive n8n node verifies if the intended archival folder already exists in Google Drive.

  4. Conditional Logic: The If exists n8n node directs the flow. If the folder is found, the n8n workflow proceeds directly. If not, the Create Drive Folder n8n node runs to establish the new path.

  5. Folder ID Capture: The unique folder identifier is saved using the Set Folder ID n8n node for later use by the upload step.

  6. Iteration: The Set the loop n8n node prepares the data, which is then fed into the Loop Over Items (Split In Batches) n8n node, ensuring each invoice is processed individually.

  7. Invoice Retrieval: For each item in the loop, the Smartbill get invoice pdf HTTP Request n8n node executes, downloading the raw binary PDF file content from the SmartBill API.

  8. File Preparation: The Set mime code n8n node is crucial for correctly tagging the downloaded binary data as application/pdf.

  9. Upload: The Upload file to Google Drive Google Drive n8n node uploads the prepared PDF file to the previously identified Folder ID.

  10. Rate Control: A brief pause is introduced by the Wait a sec n8n node before the loop continues, mitigating the risk of hitting API rate limits during batch processing. This ensures the entire n8n workflow runs smoothly.

Installation Guide


  1. Import: Copy the provided n8n workflow JSON and import it directly into your n8n instance using the 'Workflows' section.

  2. Google Drive Credentials: Configure credentials for the three Google Drive n8n nodes (Search Drive Folder, Create Drive Folder, Upload file to Google Drive). This typically requires standard OAuth 2.0 setup.

  3. SmartBill/HTTP Setup: Configure the Smartbill get invoice pdf n8n node. You must replace placeholder values with your specific SmartBill API endpoint, authentication details, and ensure the URL expression correctly references the invoice ID from the looped item.

  4. Customization: Review and adjust the logic within the SetData and Set Default Folder Name n8n nodes to match your invoice data structure and desired naming convention for the Google Drive folder.

  5. Activation: Activate the n8n workflow. You can then test it by clicking the 'Execute Workflow' button on the manual trigger n8n node.

Node Details

When clicking "Execute Workflow" (Manual Trigger n8n trigger): The starting point for the automation.
Set Default Folder Name (Code n8n node): Sets the desired, dynamic name for the Google Drive folder where invoices will be stored.
Search Drive Folder (Google Drive n8n node): Checks for the existence of the folder using the 'Find' operation.
If exists (If n8n node): Manages the flow, directing execution to create the folder only if the search yields zero results.
Create Drive Folder (Google Drive n8n node): Creates the required destination folder if it is not found.
Loop Over Items (Split In Batches n8n node): An essential flow control n8n node, ensuring that the n8n workflow processes each invoice ID sequentially to prevent concurrency issues and manage API calls.
Smartbill get invoice pdf (HTTP Request n8n node): Downloads the raw PDF file from the SmartBill API using specific parameters derived from the looped data.
Set mime (Code n8n node): Prepares the binary file data for upload by setting the correct content type (MIME type) within the n8n item.


  • Upload file to Google Drive (Google Drive n8n node): Uses the 'Upload' operation to archive the fetched PDF files into the correct folder ID.

Related n8n Workflows

Paid

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by
Codez
Codez

Building automations and AI agents for businesses

Featured*