{
  "id": "RJSOp14jzYxVasAo",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Bulk Google Calendar Event with Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "f8647e6d-d06c-41ef-924b-ece066dc4e2c",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        300,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "03c10888-8281-44a2-80b4-f2164d5a46e3",
      "name": "Read Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        660,
        -240
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit?usp=drivesdk",
          "cachedResultName": "[EXAMPLE] Bulk Create Event Google Calendar"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "aa4cd7d9-289c-47ba-b211-2f885b0de0bc",
      "name": "Create Event",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1660,
        -260
      ],
      "parameters": {
        "end": "={{ $('Read Sheet').item.json.end }}",
        "start": "={{ $('Read Sheet').item.json.start }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "user@example.com",
          "cachedResultName": "user@example.com"
        },
        "additionalFields": {
          "summary": "={{ $('Read Sheet').item.json.summary }}",
          "location": "={{ $('Read Sheet').item.json.location }}",
          "attendees": [
            "={{ $json.attendees }}"
          ],
          "description": "={{ $('Read Sheet').item.json.description }}"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 1,
      "continueOnFail": true
    },
    {
      "id": "08a13bc7-9dec-4bc9-bd96-b127e98fd937",
      "name": "Update Sheet (Created)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2580,
        -220
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "created",
            "row_number": "={{ $('Check Status Spreadsheets').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "start",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "end",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "end",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "location",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "location",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "attendees",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "attendees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit?usp=drivesdk",
          "cachedResultName": "[EXAMPLE] Bulk Create Event Google Calendar"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "c38cb4ac-3050-4c52-8aa4-8aeee3f9e767",
      "name": "Update Sheet (Failed)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2580,
        20
      ],
      "parameters": {
        "columns": {
          "value": {
            "status": "failed",
            "row_number": "={{ $('Check Status Spreadsheets').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "start",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "start",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "end",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "end",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "location",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "location",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "attendees",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "attendees",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tICaP43DEMAbnL15FAbhRQtHwF30LISBPsktPI8ZOUg/edit?usp=drivesdk",
          "cachedResultName": "[EXAMPLE] Bulk Create Event Google Calendar"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "95080995-a49e-4700-9b5e-7b654944972d",
      "name": "Check Status Spreadsheets",
      "type": "n8n-nodes-base.if",
      "position": [
        1140,
        -240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a5d9cd7d-7aa1-4338-93f8-763c3ddcce25",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "pending"
            },
            {
              "id": "e1e1f286-c230-4364-a526-e20639e41382",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "failed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5ac6b9c1-f0ba-4e4a-af68-e64131df19eb",
      "name": "Check If Error",
      "type": "n8n-nodes-base.if",
      "position": [
        2000,
        -260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "a5d9cd7d-7aa1-4338-93f8-763c3ddcce25",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{$json.error}}",
              "rightValue": "error"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2d6c97be-e525-49b3-bcb2-50ab9d61bbd0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -540
      ],
      "parameters": {
        "width": 420,
        "height": 700,
        "content": "## Bulk Google Calendar Event with Google Sheets\n\n### How it works\n\n1. **Manual Trigger** \u2013 Start workflow manually.\n2. **Read Sheet** \u2013 Reads all rows from the configured Google Sheet.\n3. **Check Status Spreadsheets** \u2013 Determines if each row is pending/failed or already processed:\n    - **Pending/Failed**: Proceed to create a calendar event.\n    - **Already Created**: Mark as duplicate.\n6. **Create Event** \u2013 Uses row data (summary, start/end time, description, location, attendees) to create an event in Google Calendar.\n7. **Check If Error** \u2013 Detects if the event creation succeeded:\n    - Success: Update row status as Created.\n    - Failure: Update row status as Failed.\n\n### Setup steps\n- [ ] Enable Google Sheets and Google Calendar APIs\n- [ ] Set up credentials to connect to Google Sheets and Google Calendar\n- [ ] Verify credentials are working properly\n- [ ] Set up the Google Sheets file"
      },
      "typeVersion": 1
    },
    {
      "id": "d39219fd-0023-4195-8480-cd73226cb7c0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -420
      ],
      "parameters": {
        "color": 7,
        "width": 340,
        "height": 380,
        "content": "## 1. Initialize workflow\n\nStarts the workflow and sets initial variables."
      },
      "typeVersion": 1
    },
    {
      "id": "3538def0-041c-4e6c-a3bc-d1749a52ceab",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        600,
        -420
      ],
      "parameters": {
        "color": 7,
        "width": 800,
        "height": 380,
        "content": "## 2. Read Google Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "efe0a6e0-96f1-4728-9eed-78b6a0591b4d",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1540,
        120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a581c93a-5ac4-4239-8d48-8c5cae2c6f04",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        -420
      ],
      "parameters": {
        "color": 7,
        "width": 800,
        "height": 380,
        "content": "## 3. Create Event to Calendar\n\nUses row data (summary, start/end time, description, location, attendees\n        "
      },
      "typeVersion": 1
    },
    {
      "id": "be1a414e-44b3-4c36-a9f6-566b5f2db727",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2420,
        -420
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 640,
        "content": "## 4. Update Status to Google Sheets\n\nThis will update status if success will be `created` and if failed will be `failed`"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "701a4bd1-ee4f-4bb4-95f0-c36d33708426",
  "connections": {
    "Read Sheet": {
      "main": [
        [
          {
            "node": "Check Status Spreadsheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Event": {
      "main": [
        [
          {
            "node": "Check If Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Error": {
      "main": [
        [
          {
            "node": "Update Sheet (Created)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sheet (Failed)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Read Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Status Spreadsheets": {
      "main": [
        [
          {
            "node": "Create Event",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}