{
  "id": "fgGjrwJD0wsrTF4C",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated Candidate Interview Tracker with Google Calendar & Gmail Alerts",
  "tags": [],
  "nodes": [
    {
      "id": "40220665-8466-4ca5-a665-59b1b7fb4dcd",
      "name": "Check Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        144,
        -64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cec5691c-d2e4-4da0-a72f-a5eacc87e4d1",
      "name": "Get Calendar Events",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        368,
        -64
      ],
      "parameters": {
        "options": {
          "timeMax": "={{ $now.plus({ hours: 1 }).toISO() }}",
          "timeMin": "={{ $now.toISO() }}"
        },
        "calendar": {
          "__rl": true,
          "mode": "id",
          "value": "=76iujhgtr4321eryi8"
        },
        "operation": "getAll"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e600def1-33a8-433b-978a-5bd334d4e861",
      "name": "Filter Upcoming Interviews",
      "type": "n8n-nodes-base.filter",
      "position": [
        592,
        -64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition1",
              "operator": {
                "type": "dateTime",
                "operation": "before",
                "singleValue": true
              },
              "leftValue": "={{ $json.start.dateTime }}",
              "rightValue": "={{ $now.plus({ minutes: 5 }).toISO() }}"
            },
            {
              "id": "condition2",
              "operator": {
                "type": "dateTime",
                "operation": "after",
                "singleValue": true
              },
              "leftValue": "={{ $json.start.dateTime }}",
              "rightValue": "={{ $now.toISO() }}"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "871ea2fb-6f24-4291-888c-94c1a47a6518",
      "name": "Add to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        816,
        -160
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SPREADSHEET_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "97b38c41-ea45-4e4b-8318-5da4d3c24135",
      "name": "Send Reminder to Candidate",
      "type": "n8n-nodes-base.gmail",
      "position": [
        816,
        32
      ],
      "parameters": {
        "sendTo": "={{ $json.attendees[0].email }}",
        "message": "=<h2>Interview Reminder</h2>\n<p>Dear Candidate,</p>\n<p>Your interview is scheduled to start in <strong>5 minutes</strong>.</p>\n<p><strong>Interview:</strong> {{ $json.summary }}<br>\n<strong>Time:</strong> {{ $json.start.dateTime }}<br>\n<strong>Google Meet Link:</strong> <a href=\"{{ $json.hangoutLink }}\">Join Meeting</a></p>\n<p>Please join on time. Good luck!</p>",
        "options": {},
        "subject": "Interview Reminder - Starting in 5 Minutes"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "53f7164c-9007-4261-8628-24b1bcdac2c7",
      "name": "Update Sheet with Result",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        368,
        352
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_SPREADSHEET_ID"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "6780349a-d56e-465c-8dc4-4a23a2523dbf",
      "name": "Webhook: Submit Interview Result",
      "type": "n8n-nodes-base.webhook",
      "position": [
        144,
        352
      ],
      "parameters": {
        "path": "interview-result",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "4269bbb9-8d74-4d20-8053-260836d36478",
      "name": "Check if Passed",
      "type": "n8n-nodes-base.if",
      "position": [
        592,
        352
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "passed-condition",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.result }}",
              "rightValue": "Pass"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e9572ff4-464a-4956-a14e-2c0b1917a3c3",
      "name": "Email Candidate - Passed",
      "type": "n8n-nodes-base.gmail",
      "position": [
        816,
        256
      ],
      "parameters": {
        "sendTo": "={{ $json.candidateEmail }}",
        "message": "=<h2>Congratulations!</h2>\n<p>Dear Candidate,</p>\n<p>We are pleased to inform you that you have <strong>PASSED</strong> the interview.</p>\n<p><strong>Feedback:</strong> {{ $json.feedback }}</p>\n<p>Our team will contact you soon with next steps.</p>\n<p>Best regards,<br>HR Team</p>",
        "options": {},
        "subject": "\ud83c\udf89 Congratulations! You Passed the Interview"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "11a09ef5-e424-45db-9923-700ca794fc47",
      "name": "Email Candidate - Failed",
      "type": "n8n-nodes-base.gmail",
      "position": [
        816,
        448
      ],
      "parameters": {
        "sendTo": "={{ $json.candidateEmail }}",
        "message": "=<h2>Interview Result</h2>\n<p>Dear Candidate,</p>\n<p>Thank you for taking the time to interview with us.</p>\n<p>After careful consideration, we have decided not to move forward with your application at this time.</p>\n<p><strong>Feedback:</strong> {{ $json.feedback }}</p>\n<p>We wish you all the best in your future endeavors.</p>\n<p>Best regards,<br>HR Team</p>",
        "options": {},
        "subject": "Interview Result"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "1d62aabc-dc5b-40d8-9be5-d18eff86a10e",
      "name": "Email Manager",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1040,
        352
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=<h2>Interview Completed</h2>\n<p><strong>Candidate:</strong> {{ $json.candidateEmail }}<br>\n<strong>Result:</strong> {{ $json.result }}<br>\n<strong>Feedback:</strong> {{ $json.feedback }}</p>\n<p>Updated in Google Sheet.</p>",
        "options": {},
        "subject": "Interview Result: {{ $json.candidateEmail }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0c077145-df34-4e7d-8bf1-31244f07fca9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -336
      ],
      "parameters": {
        "color": 3,
        "width": 672,
        "height": 208,
        "content": "## Workflow Overview\n\n- **Check Every 5 Minutes**: Triggers the workflow to run every 5 minutes.\n- **Get Calendar Events**: Retrieves upcoming interview events from Google Calendar.\n- **Filter Upcoming Interviews**: Filters the retrieved events to focus on upcoming interviews.\n- **Add to Google Sheet**: Appends filtered interview details to a Google Sheet.\n- **Send Reminder to Candidate**: Sends an email reminder to the candidate via Gmail.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e553920b-784e-4841-b3ec-2fb43307a6a0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        96
      ],
      "parameters": {
        "width": 688,
        "height": 224,
        "content": "## Workflow Overview\n\n- **Webhook: Submit Interview Result**: Receives interview result data via a webhook.\n- **Update Sheet with Result**: Updates the Google Sheet with the submitted interview result.\n- **Check if Passed**: Evaluates whether the interview result indicates a pass or fail.\n- **Email Candidate - Passed**: Sends a pass notification email to the candidate via Gmail.\n- **Email Manager**: Sends an email update to the manager via Gmail.\n- **Email Candidate - Failed**: Sends a fail notification email to the candidate via Gmail."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e41094e8-2bbf-499d-a796-e50f5a930408",
  "connections": {
    "Check if Passed": {
      "main": [
        [
          {
            "node": "Email Candidate - Passed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email Candidate - Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Calendar Events": {
      "main": [
        [
          {
            "node": "Filter Upcoming Interviews",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Get Calendar Events",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Candidate - Failed": {
      "main": [
        [
          {
            "node": "Email Manager",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Candidate - Passed": {
      "main": [
        [
          {
            "node": "Email Manager",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet with Result": {
      "main": [
        [
          {
            "node": "Check if Passed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Upcoming Interviews": {
      "main": [
        [
          {
            "node": "Add to Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Reminder to Candidate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook: Submit Interview Result": {
      "main": [
        [
          {
            "node": "Update Sheet with Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}