{
  "name": "Sync Toggl Track time entries with Google Sheets detail and summary tabs",
  "nodes": [
    {
      "id": "manual-trigger",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        -136
      ]
    },
    {
      "id": "set-dates",
      "name": "Set Date Range",
      "type": "n8n-nodes-base.set",
      "position": [
        224,
        -136
      ]
    },
    {
      "id": "http-time-entries",
      "name": "Fetch Time Entries",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        -256
      ]
    },
    {
      "id": "http-projects",
      "name": "Fetch Projects",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        448,
        -64
      ]
    },
    {
      "id": "merge-data",
      "name": "Merge With Projects",
      "type": "n8n-nodes-base.merge",
      "position": [
        672,
        -136
      ]
    },
    {
      "id": "code-process",
      "name": "Process Data",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        -136
      ]
    },
    {
      "id": "http-get-sheets",
      "name": "Get Sheet Info 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1120,
        -136
      ]
    },
    {
      "id": "code-batch",
      "name": "Build Sheet Ops 1",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        -136
      ]
    },
    {
      "id": "http-batch-update",
      "name": "Apply Sheet Ops 1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1568,
        -136
      ]
    },
    {
      "id": "http-get-sheets-2",
      "name": "Get Sheet Info 2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1792,
        -136
      ]
    },
    {
      "id": "code-batch-2",
      "name": "Build Sheet Ops 2",
      "type": "n8n-nodes-base.code",
      "position": [
        2016,
        -136
      ]
    },
    {
      "id": "http-batch-update-2",
      "name": "Apply Sheet Ops 2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2240,
        -136
      ]
    },
    {
      "id": "code-read-data",
      "name": "Read Detail Data",
      "type": "n8n-nodes-base.code",
      "position": [
        2464,
        -136
      ]
    },
    {
      "id": "loop-write",
      "name": "Detail Write Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2688,
        -136
      ]
    },
    {
      "id": "code-expand",
      "name": "Expand Entries",
      "type": "n8n-nodes-base.code",
      "position": [
        2912,
        -112
      ]
    },
    {
      "id": "gs-append",
      "name": "Write Details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3136,
        -112
      ]
    },
    {
      "id": "code-read-summaries",
      "name": "Read Summary Data",
      "type": "n8n-nodes-base.code",
      "position": [
        2912,
        -328
      ]
    },
    {
      "id": "loop-summaries",
      "name": "Summary Write Loop",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3136,
        -328
      ]
    },
    {
      "id": "code-expand-summaries",
      "name": "Expand Summaries",
      "type": "n8n-nodes-base.code",
      "position": [
        3376,
        -320
      ]
    },
    {
      "id": "gs-append-summaries",
      "name": "Write Summaries",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3584,
        -320
      ]
    },
    {
      "id": "sticky-note-1",
      "name": "Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -512
      ],
      "parameters": {
        "width": 460,
        "height": 840,
        "content": "## Sync Toggl Track time entries with Google Sheets monthly tabs\n\nThis workflow fetches Toggl time entries, filters by project, and writes:\n- **Detail Sheet**: individual entries\n- **Summary Sheet**: "
      }
    },
    {
      "id": "sticky-section-1",
      "name": "Section: Trigger Date",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        -480
      ],
      "parameters": {
        "width": 300,
        "height": 170,
        "content": "## Trigger & Date Range\nStarts the workflow and builds dynamic `start_date` / `end_date` values for API queries."
      }
    },
    {
      "id": "sticky-section-2",
      "name": "Section: Toggl Fetch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -480
      ],
      "parameters": {
        "width": 320,
        "height": 170,
        "content": "## Toggl Data Fetch\nRequests time entries and projects from Toggl Track API using HTTP Basic Auth credentials."
      }
    },
    {
      "id": "sticky-section-3",
      "name": "Section: Merge Transform",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -480
      ],
      "parameters": {
        "width": 340,
        "height": 190,
        "content": "## Merge & Transform\nMerges entries with project metadata, filters by project name, and prepares detail + summary datasets grouped by month."
      }
    },
    {
      "id": "sticky-section-4",
      "name": "Section: Detail Prep",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        -480
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## Detail Sheet Preparation\nEnsures monthly tabs exist in the detail spreadsheet and clears previous monthly tab values before writing."
      }
    },
    {
      "id": "sticky-section-5",
      "name": "Section: Detail Loop",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2624,
        96
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## Detail Sheet Write Loop\nSplits detail data by month, expands entries, and appends rows to each monthly tab in the detail spreadsheet."
      }
    },
    {
      "id": "sticky-section-6",
      "name": "Section: Summary Prep",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2784,
        -544
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## Summary Sheet Preparation\nEnsures monthly tabs exist in the summary spreadsheet and clears previous monthly tab values before writing."
      }
    },
    {
      "id": "sticky-section-7",
      "name": "Section: Summary Loop",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3328,
        -528
      ],
      "parameters": {
        "width": 350,
        "height": 180,
        "content": "## Summary Sheet Write Loop\nSplits summary data by month, expands entries, and appends rows to each monthly tab in the summary spreadsheet."
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Set Date Range",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Data": {
      "main": [
        [
          {
            "node": "Get Sheet Info 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Details": {
      "main": [
        [
          {
            "node": "Detail Write Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expand Entries": {
      "main": [
        [
          {
            "node": "Write Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Projects": {
      "main": [
        [
          {
            "node": "Merge With Projects",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Set Date Range": {
      "main": [
        [
          {
            "node": "Fetch Time Entries",
            "type": "main",
            "index": 0
          },
          {
            "node": "Fetch Projects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Summaries": {
      "main": [
        [
          {
            "node": "Summary Write Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expand Summaries": {
      "main": [
        [
          {
            "node": "Write Summaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sheet Info 1": {
      "main": [
        [
          {
            "node": "Build Sheet Ops 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sheet Info 2": {
      "main": [
        [
          {
            "node": "Build Sheet Ops 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Detail Data": {
      "main": [
        [
          {
            "node": "Detail Write Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Sheet Ops 1": {
      "main": [
        [
          {
            "node": "Get Sheet Info 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply Sheet Ops 2": {
      "main": [
        [
          {
            "node": "Read Detail Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Sheet Ops 1": {
      "main": [
        [
          {
            "node": "Apply Sheet Ops 1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Sheet Ops 2": {
      "main": [
        [
          {
            "node": "Apply Sheet Ops 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Detail Write Loop": {
      "main": [
        [
          {
            "node": "Read Summary Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Expand Entries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Summary Data": {
      "main": [
        [
          {
            "node": "Summary Write Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Time Entries": {
      "main": [
        [
          {
            "node": "Merge With Projects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summary Write Loop": {
      "main": [
        [],
        [
          {
            "node": "Expand Summaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge With Projects": {
      "main": [
        [
          {
            "node": "Process Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}