{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "51712938-ec75-46ce-813b-d08f99770465",
      "name": "Fetch Customers from QuickBooks",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        -32,
        304
      ],
      "parameters": {
        "filters": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "quickBooksOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3cffcb60-530d-498d-904e-999944a96bfc",
      "name": "Prepare Customer Data",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        304
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "34a12d33-7b0b-4cec-a5ca-8e9520e6b644",
              "name": "=Period",
              "type": "string",
              "value": "={{ new Date().toISOString().slice(0, 7); }}"
            },
            {
              "id": "86d36b63-e8f1-4fc8-a0a4-884754416439",
              "name": "Id",
              "type": "string",
              "value": "={{ $json.Id }}"
            },
            {
              "id": "4f994c1c-110b-44f7-b2a2-58bf5416f6fc",
              "name": "Balance",
              "type": "number",
              "value": "={{ $json.Balance }}"
            },
            {
              "id": "2263be28-e780-4d64-b50a-1e7688195539",
              "name": "Email",
              "type": "string",
              "value": "={{ $json.PrimaryEmailAddr.Address }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ae4c32cf-e227-4ce1-9f30-71eb3ab3e729",
      "name": "Export to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        432,
        304
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/example"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/example"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "e516f009-e153-46fd-bc14-6aabd7ee7c0b",
      "name": "Monthly Export Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -288,
        304
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "months",
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "contact-note-1759910018486",
      "name": "Creator Contact Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -988,
        -291
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 440,
        "content": "# Contact Us:\n## Milan @ SmoothWork - [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n![Milan](https://gravatar.com/avatar/95700d17ba300a9f14c1b8cacf933df7720027b3adda9cbe6183d89142925422?r=pg&d=retro&size=100)\n\n\n### We help businesses eliminate busywork by building compact business tools tailored to your process.\n### Contact us for customizing this, or building similar automations.\n\n\ud83d\udce7 hello@smoothwork.ai\n\u25b6\ufe0f [Check us on YouTube](https://www.youtube.com/@vasarmilan)\n\ud83d\udcde [Book a Free Consulting Call](https://smoothwork.ai/book-a-call/)\n\ud83d\udcbc [Add me on Linkedin](https://www.linkedin.com/in/mil%C3%A1n-v%C3%A1s%C3%A1rhelyi-3a9985123/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "doc-note-1759910018486",
      "name": "Workflow Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -988,
        149
      ],
      "parameters": {
        "width": 600,
        "height": 750,
        "content": "## Workflow Overview\n\nThis workflow automatically exports customer balance data from QuickBooks to a Google Sheet on a monthly basis. It's designed to help you track customer balances over time without manual data entry, creating a historical record that updates automatically each month.\n\n### First Setup\n\n1. **QuickBooks Developer Account**: Register at `developer.intuit.com` and create a new app in the App Dashboard. Select the 'Accounting' scope for permissions.\n2. **Connect Credentials**: Configure the QuickBooks OAuth2 credentials in n8n using your app's Client ID and Client Secret. Set the environment to 'Sandbox' for testing or 'Production' for live data (requires app approval from Intuit).\n3. **Google Sheets**: Connect your Google Sheets account credentials in n8n and ensure you have a destination spreadsheet ready with appropriate column headers (Period, Id, Balance, Email).\n\n### Configuration\n\n- **Schedule**: The workflow runs monthly on the first day of each month at 8 AM. Adjust the Schedule Trigger to change the frequency or timing.\n- **Google Sheet URL**: Update the 'Export to Google Sheets' node with your own spreadsheet URL.\n- **Data Fields**: The 'Prepare Customer Data' node extracts specific fields. Modify the assignments to capture different customer information as needed."
      },
      "typeVersion": 1
    },
    {
      "id": "video-note-1759912267934",
      "name": "Video Walkthrough",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -378,
        -291
      ],
      "parameters": {
        "width": 420,
        "height": 340,
        "content": "# Video Walkthrough\n[![image.png](https://vasarmilan-public.s3.us-east-1.amazonaws.com/blog_thumbnails/thumbnail_rec0EGjS8Q1AxvT1b.jpg)](https://youtu.be/mprQ4CY3yn0)"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Prepare Customer Data": {
      "main": [
        [
          {
            "node": "Export to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monthly Export Trigger": {
      "main": [
        [
          {
            "node": "Fetch Customers from QuickBooks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Customers from QuickBooks": {
      "main": [
        [
          {
            "node": "Prepare Customer Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}