{
  "id": "X5xw7yGGTbOO90W2",
  "name": "Automatically Save QuickBooks Invoice PDFs to Google Drive",
  "tags": [],
  "nodes": [
    {
      "id": "ff7c6a74-195d-42db-b841-a18979f064db",
      "name": "QuickBooks Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -220,
        1300
      ],
      "parameters": {
        "path": "quickbooks-invoice",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "9283af9a-547a-4576-a006-c8555d1bb64b",
      "name": "Get an invoice",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        400,
        1300
      ],
      "parameters": {
        "resource": "invoice",
        "invoiceId": "={{ $json.body.eventNotifications[0].dataChangeEvent.entities[0].id }}"
      },
      "typeVersion": 1
    },
    {
      "id": "0d766411-d37d-4b61-8f57-7bab86a501fe",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1560,
        1300
      ],
      "parameters": {
        "name": "={{ $json[\"CustomerRef\"][\"name\"] + \"_\" + $json[\"TxnDate\"] + \".pdf\" }}\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "{YOUR_GOOGLE_DRIVE_FOLDER_ID}",
          "cachedResultUrl": "https://drive.google.com/drive/folders/{YOUR_GOOGLE_DRIVE_FOLDER_ID}",
          "cachedResultName": "n8n"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "7516bcdd-188d-4e9f-b4c8-2fb70a874e84",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        1440
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 400,
        "content": "**Step 1: Webhook Trigger Activated!** \ud83e\ude9d\ud83d\udce2\n\n\nThis node is the starting point of the workflow.\n\nIt listens for new invoice creation events in QuickBooks.\n\nWhat it does:\n\n\ud83d\udce1 Captures the invoice creation event in real time.\n\n\ud83d\udce6 Passes the new invoice data instantly into the workflow.\n\n\ud83d\udd04 Removes the need for manual checks or scheduled polling.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2786e56f-95c0-47da-8649-4a98d658e4af",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        820
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 440,
        "content": "### Step 2: Invoice Data Fetcher \ud83d\udcc4\ud83d\udd0d\n\nThis node uses the **Get an Invoice** operation to pull full details of the invoice from QuickBooks.\n\nWhy this step is important:\n\n- \u2705 Retrieves complete and up-to-date invoice information.\n- \ud83d\udcca Captures fields like invoice number, date, customer.\n- \ud83e\uddfe Ensures the Google Sheet reflects the exact state of the invoice at the moment of the event.\n\nIt\u2019s the step that turns a simple event notification into a fully detailed record. \ud83d\udce5\u2728\n"
      },
      "typeVersion": 1
    },
    {
      "id": "07455a09-ddbc-43a7-87ac-bf3ecc8917aa",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        1460
      ],
      "parameters": {
        "width": 460,
        "height": 380,
        "content": "### Step 3: Invoice PDF Generator \ud83d\udda8\ufe0f\ud83d\udcc2\n\nThis node sends an **HTTP Request** to QuickBooks to generate a downloadable PDF version of the invoice.\n\nWhy this step is important:\n\n- \ud83d\udda8\ufe0f Converts the invoice data into a ready-to-download PDF format.\n- \ud83d\udcc2 Ensures a consistent, professional layout directly from QuickBooks.\n- \ud83d\udd17 Provides a file link that can be shared, stored, or sent to customers.\n\nIt\u2019s the step that transforms invoice details into a polished, printable document. \ud83d\udcc4\u2728\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5de6c6e9-d40a-48cf-8b13-b769d08ed607",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        860
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 400,
        "content": "### Step 4: Google Drive PDF Uploader \u2601\ufe0f\ud83d\udce4\n\nThis node uses the **Upload File** operation in Google Drive to store the PDF invoices in your chosen folder.\n\nWhy this step is important:\n\n- \ud83d\udce4 Saves each invoice PDF securely in Google Drive.\n- \ud83d\udcc2 Keeps all invoices organized in a dedicated folder of your choice.\n- \ud83d\udd04 Enables easy access, sharing, and long-term storage.\n\nIt\u2019s the step that moves your invoices from generation to safe, cloud-based storage. \ud83d\uddc2\ufe0f\u2728\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3467b040-a23a-4225-bfbe-b500dd2e7d65",
      "name": "Generate PDF File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        940,
        1300
      ],
      "parameters": {
        "url": "=https://quickbooks.api.intuit.com/v3/company/{{ $node[\"QuickBooks Webhook\"].json[\"body\"][\"eventNotifications\"][0].realmId }}/invoice/{{ $node[\"QuickBooks Webhook\"].json[\"body\"][\"eventNotifications\"][0].dataChangeEvent.entities[0].id }}/pdf\n",
        "options": {},
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/pdf"
            }
          ]
        },
        "nodeCredentialType": "quickBooksOAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "8d83b1bf-90c1-49d9-b8e4-a326e98c8e14",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        500
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 620,
        "content": "## \ud83d\udee0\ufe0f Prerequisites\n\nBefore running this workflow, make sure the following are set up:\n\n1. **QuickBooks Webhook Configuration**  \n   - Connect the **production URL** of your webhook to the **Intuit Developer Portal** for your specific company.  \n   - Ensure **Invoice** events are subscribed and activated (e.g., create, update, delete).\n\n2. **Google Account Integration**  \n   - Connect your **Google Client Credentials**.  \n   - Enable the following APIs:  \n     - \ud83d\udcc2 Google Drive \n\nOnce these are in place, your workflow will seamlessly capture and upload every invoice change in real time. \ud83d\ude80\ud83d\udcca\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3929a8d0-2d15-43f7-96d2-5f9d4d47f0b7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1580,
        1520
      ],
      "parameters": {
        "color": 6,
        "width": 320,
        "height": 360,
        "content": "### Get in Touch\n\nPlease feel free to reachout to us, if you need any help in settin up this workflow.\n\nWe can also help customize workflow pet the use-case. \n\nReach out us at: getstarted@intuz.com\n\nWebsite: https://www.intuz.com/\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fef985a4-392f-4161-b6e5-a3e9876010e6",
  "connections": {
    "Get an invoice": {
      "main": [
        [
          {
            "node": "Generate PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate PDF File": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QuickBooks Webhook": {
      "main": [
        [
          {
            "node": "Get an invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}