{
  "name": "Log farm machinery operations from a webhook into Google Sheets",
  "nodes": [
    {
      "id": "ff5e8a30-7c98-4a57-912d-d237d93e9b77",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -848,
        -384
      ]
    },
    {
      "id": "d4beaa47-e36f-4181-afe9-614c69cc6afb",
      "name": "Capture Breakdowns",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        80,
        -352
      ]
    },
    {
      "id": "8ff6382c-b471-4fbf-8339-e8c921f5f7a6",
      "name": "Main Log Capture Node",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        80,
        -128
      ]
    },
    {
      "id": "429281d7-9104-4b5f-9e55-75edab9b0f69",
      "name": "Fuel Capture Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        64,
        -576
      ]
    },
    {
      "id": "1593e048-49bb-43cd-a40d-22532aad6799",
      "name": "Expand Fuel Entries",
      "type": "n8n-nodes-base.code",
      "position": [
        -272,
        -576
      ]
    },
    {
      "id": "2895c5b3-8746-44ae-a689-13de76e98428",
      "name": "Expand Breakdowns",
      "type": "n8n-nodes-base.code",
      "position": [
        -240,
        -352
      ]
    },
    {
      "id": "8580fa54-9d40-49d7-9ef6-a40a211889ef",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -592,
        -384
      ]
    },
    {
      "id": "1a5e1949-86e1-4a43-bbb3-7767e276694a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -848
      ],
      "parameters": {
        "width": 544,
        "height": 688,
        "content": "## OPERATOR-SPECIFIC FARM OPERATIONS LOGGER\n\nCaptures detailed farm machinery operations data via webhook and logs to three Google Sheets tabs: main operations, fuel consumption, and equipment breakdo"
      }
    },
    {
      "id": "913f580c-0727-4030-8ef4-3a441167c2e5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -848
      ],
      "parameters": {
        "width": null,
        "height": 624,
        "content": "## WEBHOOK TRIGGER\nReceives POST requests from data collection app\nPath: farm-operations-logger\nAccepts JSON payload with operation details\n→ Passes to Workflow Configuration"
      }
    },
    {
      "id": "563bf9f7-510b-4875-b2ae-e27a0c9eb869",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -848
      ],
      "parameters": {
        "width": 224,
        "height": 624,
        "content": "## WORKFLOW CONFIGURATION\nCentral node that:\n- Stores spreadsheet ID for reference\n- Splits data flow to 3 branches:\n  1. Main log (direct)\n  2. Fuel entries (via expansion)\n  3. Breakdowns (via expan"
      }
    },
    {
      "id": "e4e692a0-dede-40e9-b847-25cc48f0828b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        -848
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "## EXPAND FUEL ENTRIES\nCode node that loops through fuelEntries array\nCreates one item per fuel entry with log ID\nHandles multiple fuel fills per operation\n→ Each fuel entry becomes separate row"
      }
    },
    {
      "id": "733d329c-30a1-4597-8a4a-4937bc05871c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -592
      ],
      "parameters": {
        "width": 400,
        "height": null,
        "content": "## FUEL CAPTURE LOG\nWrites to \"fuel\" sheet tab\nColumns: id, mach-start, mach-end, litre, attendant, supplier\n⚠️ Update Document to your spreadsheet\n⚠️ Ensure \"fuel\" tab exists"
      }
    },
    {
      "id": "fb48e538-cd6c-4dac-88d4-b37998e47b34",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -144
      ],
      "parameters": {
        "width": 400,
        "height": 224,
        "content": "## MAIN LOG CAPTURE NODE\nWrites to \"main_logs\" sheet tab\nCaptures primary operation data:\n- Operator, machinery, field, operation\n- Start/end times, total hours\n- Operation output (value/units)\n⚠️ Upd"
      }
    },
    {
      "id": "9fbc3803-56fd-4025-9680-dea97dde81d1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -176
      ],
      "parameters": {
        "width": 320,
        "height": 208,
        "content": "## EXPAND BREAKDOWNS\nCode node that loops through breakdowns array\nCreates one item per breakdown with log ID\nIncludes: type, start/end times, downtime, notes\n→ Each breakdown becomes separate row"
      }
    },
    {
      "id": "77e1ba97-4211-43e9-b8d5-5a30893b03cd",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -368
      ],
      "parameters": {
        "width": 400,
        "height": null,
        "content": "## CAPTURE BREAKDOWNS\nWrites to \"breakdowns\" sheet tab\nColumns: id, type, start time, end time, total downtime, notes\n⚠️ Update Document to your spreadsheet\n⚠️ Ensure \"breakdowns\" tab exists"
      }
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expand Breakdowns": {
      "main": [
        [
          {
            "node": "Capture Breakdowns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expand Fuel Entries": {
      "main": [
        [
          {
            "node": "Fuel Capture Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Main Log Capture Node",
            "type": "main",
            "index": 0
          },
          {
            "node": "Expand Fuel Entries",
            "type": "main",
            "index": 0
          },
          {
            "node": "Expand Breakdowns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}