{
  "id": "GGBZPOcvm844DgAy",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "n8n HR agent",
  "tags": [
    {
      "id": "cGamkQygZH77eaiZ",
      "name": "AI Assistant",
      "createdAt": "2025-06-06T05:05:58.931Z",
      "updatedAt": "2025-06-06T05:05:58.931Z"
    }
  ],
  "nodes": [
    {
      "id": "8654d46e-374a-4a70-89c7-0f2cd4f7358d",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -40,
        -220
      ],
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d0846906-506e-43ed-8eec-03b5a52278d0",
      "name": "Verify Message Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        4480,
        -720
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "94481a64-b102-4088-b336-cbd1cfbd2485",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].text }}",
                    "rightValue": "text"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Audio",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d16eb899-cccb-41b6-921e-172c525ff92c",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].audio }}",
                    "rightValue": "voice"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b297dfe7-ce3c-47c5-bb4b-e37a6aed73e0",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.messages[0].image }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2,
      "alwaysOutputData": false
    },
    {
      "id": "843fc00c-1206-4bb2-ae56-1ebe62777455",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5240,
        -660
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe",
        "binaryPropertyName": "=data"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "470b1f0e-6c0f-4331-a05c-3b349c9e6bd9",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        5460,
        -780
      ],
      "parameters": {
        "model": "gpt-4.1-nano",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "024c2624-dcae-4857-b44f-2f01041de1df",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        4640,
        -1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1b053bb4-ee13-478f-a254-e2c0873bfe3f",
              "name": "messages[0].text.body",
              "type": "string",
              "value": "={{ $json.messages[0].text.body }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "ce8140d1-55ec-4547-b872-6e123f224d21",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5000,
        -740
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "eb77953b-581a-4381-94b0-2ae5d8f5d864",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5000,
        -420
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "2997fa9c-7a79-4f19-99d3-b3bd3f19c084",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5400,
        -420
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "6da88e5f-93e6-46ff-8e23-ec06cb7df6e9",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3260,
        600
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "70162166-d37a-41bd-9e84-b4023069afcd",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        3060,
        420
      ],
      "parameters": {
        "jsCode": "// Earth radius in meters\nconst R = 6371000;\n\n// Convert degrees to radians\nconst toRad = deg => deg * Math.PI / 180;\n\n// Extract coordinates from the input JSON safely\nconst inputJson = $input.first().json;\nlet lat, lon;\nif (inputJson.messages && Array.isArray(inputJson.messages) && inputJson.messages[0] && inputJson.messages[0].location) {\n  lat = inputJson.messages[0].location.latitude;\n  lon = inputJson.messages[0].location.longitude;\n} else {\n  // Handle missing data as needed; here, we return an error object\n  return [{\n    json: {\n      error: \"Missing location data in input\"\n    }\n  }];\n}\n\n// Office polygon vertices [longitude, latitude]\nconst officePolygon = [\n  \n];\n\n// Set distance threshold (increase for more leeway)\nconst distanceThreshold = 2500;\n\nlet isNearby = false;\n\n// Haversine distance function\nfunction haversine(lat1, lon1, lat2, lon2) {\n  const dLat = toRad(lat2 - lat1);\n  const dLon = toRad(lon2 - lon1);\n  const a = Math.sin(dLat / 2) ** 2 +\n            Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *\n            Math.sin(dLon / 2) ** 2;\n  const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n  return R * c;\n}\n\n// Check if user is within threshold distance of any polygon point\nfor (const [polyLon, polyLat] of officePolygon) {\n  const distance = haversine(lat, lon, polyLat, polyLon);\n  if (distance <= distanceThreshold) {\n    isNearby = true;\n    break;\n  }\n}\n\n// Output result with user's location and isInsideOffice flag\nreturn [{\n  json: {\n    ...$input.first().json,\n    latitude: lat,\n    longitude: lon,\n    isInsideOffice: isNearby\n  }\n}];"
      },
      "executeOnce": true,
      "typeVersion": 2
    },
    {
      "id": "9a180d25-3738-4537-95a6-b18849ef560d",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        5860,
        -560
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "239a8c2a-a716-4213-954e-3e3cb78a9e87",
      "name": "Supabase Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
      "position": [
        5560,
        -480
      ],
      "parameters": {
        "options": {},
        "tableName": {
          "__rl": true,
          "mode": "list",
          "value": "data",
          "cachedResultName": "data"
        }
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ca0ee3f8-3685-42d7-8374-ac5ff961c885",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        5660,
        -320
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a1864c05-1898-414e-9cdb-149967bcbbc7",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        4920,
        -1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "2275a69d-d125-46f2-ae25-c438859b0042",
              "name": "text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "537928e1-d66f-4e71-9ad6-136cb4d8bafe",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        5200,
        -1000
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "759240be-4cc1-44de-8644-f62631553a09",
              "name": "content",
              "type": "string",
              "value": "={{ $json.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1f1b51ee-fdbe-4894-9125-057dd60aec36",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2740,
        -1240
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-nano",
          "cachedResultName": "gpt-4.1-nano"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9a8bdd0d-0110-4d12-ae2f-916cd12ebfc9",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3140,
        -1240
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {
          "ccList": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('CC', ``, 'string') }}",
          "senderName": "AI HR "
        },
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b4dfd871-0ebc-4024-b38b-7d1c30a7fb49",
      "name": "Edit Fields3",
      "type": "n8n-nodes-base.set",
      "position": [
        2400,
        -1460
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d34884e2-97b4-47da-86c9-cddcfdb8c23f",
              "name": "messages[0].text.body",
              "type": "string",
              "value": "={{ $json.messages[0].text.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6e7ed37b-feaf-44f1-83e6-6de2403149ae",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3700,
        2000
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"name\": \"tanay\",\n  \"email\" : \"user@example.com\",\n  \"score\": 0.8,\n  \"shortlist\" : \"yes\",\n  \"reason\": \"Does not meet required number of experience in years\",\n  \"missing skills\": \"list of missing skills\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "ce9d9db1-2c14-4e2c-ae0d-495e5f91ce69",
      "name": "Personalize email",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        4980,
        1920
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o-mini"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "assistant",
              "content": "=You are an HR assistant generating personalized recruitment emails based on candidate data for ICICI bank (mention in subject and content). Below is a candidate\u2019s information:\nthe input instructions are {{ $('WhatsApp Trigger').item.json.messages[0].text.body }}. extract number of candidates and poistion from this \n\nName: {{ $('Google Sheets2').item.json.Name }}\nEmail:{{ $('Shortlist Agent').item.json.output.email }}\nShortlist Status:  {{ $('Google Sheets2').item.json.Shortlist }}\nmessage {{ $('Book Meeting').item.json.output.message }}\nWrite a professional email:\n\n- If the candidate is shortlisted (`Shortlist` is \"yes\"):\n    - Congratulate the candidate on being shortlisted.\n    - Mention the position and the interview timings. mention in normal date time format\n    - Be encouraging and appreciative.\n\n- If the candidate is not shortlisted (`Shortlist` is \"no\"):\n    - Politely inform them they have not been selected.\n    - \n    - Thank them for applying and encourage future applications if appropriate.\n\nThe email should be polite, human-sounding, clear, and well-formatted.\n\nOutput as \nto: \nsubject: \"make this more detailed\"\ncontent\nsend the email using gmail node and write a whatsapp message confirming it \n\n"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.7
    },
    {
      "id": "45026096-21d4-4f24-ba47-6922284a23cb",
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        4160,
        2060
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', `The end time for the meeting`, 'string') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', `The start time for the meeting`, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "user@example.com",
          "cachedResultName": "user@example.com"
        },
        "additionalFields": {
          "location": "=Online"
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "327bb15a-3152-401e-bc02-fdda973f68ee",
      "name": "Google Sheets2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3780,
        1780
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.output.name }}",
            "Score": "={{ $json.output.score }}",
            "Reason": "={{ $json.output.reason }}",
            "Shortlist": "={{ $json.output.shortlist }}",
            "MIssing Skills": "={{ $json.output['missing skills'] }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Applying for",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Applying for",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "CV link",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "CV link",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Shortlist",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Shortlist",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reason",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "MIssing Skills",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "MIssing Skills",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1214220799,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1214220799",
          "cachedResultName": "applicants"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "28a9ab47-0f65-424d-8e5b-866b6db35a25",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3120,
        2000
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7bee56d5-6bd6-4ec5-b490-e873ac6d951c",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        5240,
        2140
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "cd46f06c-8c69-44ce-922d-3ea435e67d4d",
      "name": "JD tool",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3260,
        2120
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1467426312,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1467426312",
          "cachedResultName": "jd sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "192e25da-6e65-48e7-b133-28c81d688df0",
      "name": "applicants",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3400,
        2160
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}",
              "lookupColumn": "Applying for"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1214220799,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1214220799",
          "cachedResultName": "applicants"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "31e38e25-2843-4415-a614-c6415ff77acd",
      "name": "n8n",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        3480,
        2060
      ],
      "parameters": {
        "source": "parameter",
        "description": "call this tool to get downloaded and extracted cv",
        "workflowJson": "={\n  \"name\": \"My workflow 3\",\n  \"nodes\": [\n    {\n      \"parameters\": {\n        \"operation\": \"download\",\n        \"fileId\": {\n          \"__rl\": true,\n          \"value\": \"=https://drive.google.com/file/d/1_lAwQBG7BITidr8DPXclZSxWp_2ZPJ3H/view?usp=sharing\",\n          \"mode\": \"url\"\n        },\n        \"options\": {}\n      },\n      \"id\": \"9feaa5fc-b85a-41d5-8e37-4c52fd0fddee\",\n      \"name\": \"download CV\",\n      \"type\": \"n8n-nodes-base.googleDrive\",\n      \"position\": [\n        -1520,\n        160\n      ],\n      \"typeVersion\": 3,\n      \"credentials\": {\n        \"googleDriveOAuth2Api\": {\n          \"id\": \"LQx4eK8lTDnFORcL\",\n          \"name\": \"Google Drive account 3\"\n        }\n      }\n    },\n    {\n      \"parameters\": {\n        \"operation\": \"pdf\",\n        \"options\": {}\n      },\n      \"id\": \"18774bfe-6a10-4a3f-a12b-ae374ad9d928\",\n      \"name\": \"Extract from File\",\n      \"type\": \"n8n-nodes-base.extractFromFile\",\n      \"position\": [\n        -1060,\n        160\n      ],\n      \"typeVersion\": 1\n    },\n    {\n      \"parameters\": {\n        \"documentId\": {\n          \"__rl\": true,\n          \"value\": \"1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc\",\n          \"mode\": \"list\",\n          \"cachedResultName\": \"Untitled spreadsheet\",\n          \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk\"\n        },\n        \"sheetName\": {\n          \"__rl\": true,\n          \"value\": 1214220799,\n          \"mode\": \"list\",\n          \"cachedResultName\": \"applicants\",\n          \"cachedResultUrl\": \"https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1214220799\"\n        },\n        \"options\": {}\n      },\n      \"type\": \"n8n-nodes-base.googleSheets\",\n      \"typeVersion\": 4.6,\n      \"position\": [\n        -1800,\n        160\n      ],\n      \"id\": \"88198974-6f9a-4a4c-a400-1efe61634584\",\n      \"name\": \"Google Sheets\",\n      \"credentials\": {\n        \"googleSheetsOAuth2Api\": {\n          \"id\": \"U3oQStbFsePTfOCg\",\n          \"name\": \"Google Sheets account 3\"\n        }\n      }\n    },\n    {\n      \"parameters\": {},\n      \"type\": \"n8n-nodes-base.manualTrigger\",\n      \"typeVersion\": 1,\n      \"position\": [\n        -2040,\n        160\n      ],\n      \"id\": \"444d8fb5-f167-4228-8870-cc8c6ee5d2e7\",\n      \"name\": \"When clicking \u2018Execute workflow\u2019\"\n    }\n  ],\n  \"pinData\": {},\n  \"connections\": {\n    \"download CV\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Extract from File\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"Extract from File\": {\n      \"main\": [\n        []\n      ]\n    },\n    \"Google Sheets\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"download CV\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    },\n    \"When clicking \u2018Execute workflow\u2019\": {\n      \"main\": [\n        [\n          {\n            \"node\": \"Google Sheets\",\n            \"type\": \"main\",\n            \"index\": 0\n          }\n        ]\n      ]\n    }\n  },\n  \"active\": false,\n  \"settings\": {\n    \"executionOrder\": \"v1\"\n  },\n  \"versionId\": \"b83a5fe1-8ad2-48cc-8d2a-778c0131c618\",\n  \"meta\": {\n    \"templateCredsSetupCompleted\": true,\n    \"instanceId\": \"60ec675227f8b8ddf9f06a67b49cab3340ac72df709fd0ce0a5249b51b99f4fe\"\n  },\n  \"id\": \"ljyzZaJUlYFCG9go\",\n  \"tags\": [\n    {\n      \"createdAt\": \"2025-06-06T05:05:58.931Z\",\n      \"updatedAt\": \"2025-06-06T05:05:58.931Z\",\n      \"id\": \"cGamkQygZH77eaiZ\",\n      \"name\": \"AI Assistant\"\n    }\n  ]\n}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "6ba6652d-3ce4-4699-92ce-4890a3e02e46",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        4660,
        1800
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d2c8cfaf-67f3-4936-8aa2-950ff58eaf27",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": "true"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7b84665b-5153-4bff-b463-1e59edbb5745",
      "name": "OpenAI Chat Model5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3980,
        2020
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5d607c8a-bbb1-4914-99b1-a9dcf9c161ac",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        4280,
        2000
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"message\" : \"meeting has been scheduled from 11am to 11.30 am on 13th june 26 using google calendar.\",\n  \"link\" :\"This is the meeting link - hdawodianwdawd.com\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fca8ea93-079c-49cc-bf9c-8b796bf46ab6",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1140,
        -120
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "leave req",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "8d2f59b4-24d3-43ea-823d-da3941f56489",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "1"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "hr chatbot",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b21768f6-90b5-4d17-ae4a-614133fd7ec5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "2"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "attendance",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7fec0d2d-2415-409a-9ee9-428ff93528de",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "3"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "req/complaint mail",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "295cf88b-ea09-49fe-8290-56b9bb08d555",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "4"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "shortlist ",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "fdd43ca7-f523-4583-8346-54364c039e79",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.text }}",
                    "rightValue": "5"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "0269f774-f5be-4ed0-b7e5-1b5f9c3f0b64",
      "name": "OpenAI Chat Model6",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3220,
        1320
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1ece1f68-2ff9-4d56-914e-3906756d5694",
      "name": "Gmail2",
      "type": "n8n-nodes-base.gmailTool",
      "position": [
        3520,
        1320
      ],
      "parameters": {
        "sendTo": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('To', ``, 'string') }}",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {},
        "subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', ``, 'string') }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5305ad86-3747-4a50-ae85-d56bfda09d96",
      "name": "dept head email",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3380,
        1360
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1608741360,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1608741360",
          "cachedResultName": "leaves"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a6661129-c6cf-45a6-8185-c3d2c33c34a6",
      "name": "OpenAI Chat Model7",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        140,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ff7c8b15-6502-460d-b965-82de248e0b14",
      "name": "Structured Output Parser2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3620,
        580
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"message\" : \"Exit time updated: 18:10, 11-06-202\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "05742e89-29b3-4044-a006-2286c40e2f74",
      "name": "getrows",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3480,
        600
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', ``, 'string') }}",
              "lookupColumn": "Name"
            },
            {
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values1_Value', ``, 'string') }}",
              "lookupColumn": "Entry Time"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=0",
          "cachedResultName": "rec shortlist sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "fb682328-1b7c-435f-85b2-7cc5c3d78b65",
      "name": "putrows",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3400,
        680
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $json.contacts[0].profile.name }}",
            "Exit Time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Exit_Time', ``, 'string') }}",
            "Entry Time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Entry_Time', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Entry Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Entry Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Exit Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Exit Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=0",
          "cachedResultName": "rec shortlist sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        },
        "descriptionType": "manual",
        "toolDescription": "Append or update row in sheet in Google Sheets"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4b77002e-ed9c-4048-a5f7-6f5caf7887e8",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1720,
        40
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "2c160e79-cbe9-4699-9f3d-92742a01ac08",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1720,
        -180
      ],
      "parameters": {
        "mode": "chooseBranch"
      },
      "typeVersion": 3.2
    },
    {
      "id": "2d8b8180-a3e8-4e4f-bc89-d1ab29633f8d",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        1720,
        -420
      ],
      "parameters": {
        "mode": "chooseBranch"
      },
      "typeVersion": 3.2
    },
    {
      "id": "bc4d28b6-5bb1-4cd3-ab4b-e9a18516e6c5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -320
      ],
      "parameters": {
        "width": 1260,
        "height": 660,
        "content": "LLM Message Classifier (WhatsApp Trigger)\nClassifies incoming WhatsApp messages into 5 categories using message.type and text.body\n\nRules:\nIf type = \"text\":\n1 = Leave request (e.g. \"I need leave tomorrow\")\n2 = HR query/policy/FAQ (e.g. \"How many leaves left?\")\n5 = Shortlist candidates (e.g. \"Filter CVs for backend\")\n4 = Escalation/complaint to dept head (e.g. \"Mail to IT\")\n\nIf type = \"location\":\n3 = Attendance via GPS\n\nIf type = \"audio\" or \"image\":\n2 = HR query via media\n\nStrict output: only return one number (1, 2, 3, 4, or 5) with no text or formatting\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a9ee3e6d-8790-4d1c-a17c-a7bc461c5feb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -640
      ],
      "parameters": {
        "color": 5,
        "width": 920,
        "height": 860,
        "content": "Switch Router (Based on LLM Output)\nTakes number output from LLM (1\u20135) and routes flow accordingly:\n\n1 \u2192 Route to Leave Agent\n2 \u2192 Route to HR FAQ Agent\n3 \u2192 Route to Attendance Marking\n4 \u2192 Route to Escalation Agent\n5 \u2192 Route to Shortlisting Agent\n\nUse Merge node after each path to bring back original WhatsApp data from trigger for agent processing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3be3de19-1133-4263-bf09-8761a030b588",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2260,
        -1700
      ],
      "parameters": {
        "width": 1040,
        "height": 640,
        "content": "Leave Agent\nIf leave duration < 2 days \u2192 auto-approve\nIf \u2265 2 days \u2192 escalate to dept head\n\nDept head email is fetched from Google Sheets based on employee data\nUse IF node to compare duration, then route accordingly\n"
      },
      "typeVersion": 1
    },
    {
      "id": "6eb1106d-5b4b-4ab8-baa6-2419774bda38",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2860,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 1220,
        "height": 580,
        "content": "Attendance Handler\nCode node defines office polygon (geo boundary)\nChecks if location is inside polygon = present\n\nAI Agent:\nIf no entry for name \u2192 write date & time as entry\nIf entry exists \u2192 add time as exit\nIf user requests OT \u2192 calculate & add overtime entry\n"
      },
      "typeVersion": 1
    },
    {
      "id": "98917621-0e70-4b9e-902b-bafcf8aa320a",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2120,
        1700
      ],
      "parameters": {
        "color": 5,
        "width": 3220,
        "height": 660,
        "content": "Shortlisting Agent\nUses JD + applicants sheet to filter candidates (count from WhatsApp)\nWrites: score, reason, missing skills \u2192 to sheet\n\nSchedules meeting via calendar\nIf user confirms on WhatsApp \u2192 sends email to shortlisted candidate\n"
      },
      "typeVersion": 1
    },
    {
      "id": "87b2942b-7bea-4885-ab3e-665f32935549",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5080,
        420
      ],
      "parameters": {
        "width": 720,
        "height": 620,
        "content": "Final WhatsApp Responder\nCollects responses from all agents\nFormats final message to user with relevant updates\n\nSupports interactive reply options for next steps\n(e.g. confirm, ask more, request edit)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ff57c13d-0bbe-4e17-923d-b33ffd8588eb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3060,
        960
      ],
      "parameters": {
        "width": 780,
        "height": 580,
        "content": "Request/Complaint Agent\nGenerates email content from WhatsApp message\nFetches dept head email from Google Sheets\nSends email to dept head with complaint/request details\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9be1d343-1ce6-46a9-a468-c1831cc22406",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4300,
        -1220
      ],
      "parameters": {
        "color": 6,
        "width": 2120,
        "height": 1120,
        "content": "FAQ / Chatbot Agent\nSwitch checks message type: text, audio, or image\nUses OpenAI to transcribe audio/image if needed\n\nAgent answers general FAQs\nIf policy-related \u2192 searches embeddings from vector store (preloaded with company policy docs)\nReturns closest match as reference in reply\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ce04a445-2c86-42a3-9100-fed62efa0135",
      "name": "Delegatory LLM",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        120,
        -80
      ],
      "parameters": {
        "text": "=You are given a message object with the structure:\n\ntype: {{ $json.messages[0].type }}\n\ntext body (if applicable): {{ $json.messages[0].text.body }}\n\nYour task is to analyze the message and classify it into exactly one category, returning only the corresponding number, based on the detailed rules below.\n\n\ud83d\udce9 If the type is \"text\":\nAnalyze the content in {{ $json.messages[0].text.body }} and classify based on the user's intent:\n\n\u2705 Output 1 \u2192 Leave Request\nUse this only if the message is about applying for leave, informing absence, or time off.\nExamples:\n\n\u201cI need leave for tomorrow.\u201d\n\n\u201cI won\u2019t be coming in today.\u201d\n\n\u201cApply leave from 12th to 14th.\u201d\n\n\u2705 Output 2 \u2192 HR Chatbot (FAQ or Policy Queries)\nUse this for any general queries about HR policies, benefits, leave balances, holidays, or onboarding.\nExamples:\n\n\u201cHow many leaves do I have left?\u201d\n\n\u201cWhat is the dress code policy?\u201d\n\n\u201cWhere can I get my salary slip?\u201d\n\n\u2705 Output 5 \u2192 Shortlisting Request\nUse this if the user is instructing to filter, rank, or shortlist candidates for a particular job or JD.\nExamples:\n\n\u201cShortlist candidates for backend role.\u201d\n\n\u201cFilter CVs for the UI designer position.\u201d\n\n\u2705 Output 4 \u2192 Request or Complaint for Department Head\nUse this if the user is requesting to send an email to or escalate an issue to a department head or authority.\nExamples:\n\n\u201cRaise a complaint to admin.\u201d\n\n\u201cSend a mail to IT about my laptop.\u201d\n\n\u201cEscalate this matter to HR.\u201d\n\n\ud83d\udccd If the type is \"location\":\nThis indicates attendance marking via GPS.\n\n\u2705 Output 3\n\ud83c\udf99\ufe0f If the type is \"audio\" or \"image\":\nAssume this is a general HR query via media. For example, a voice message asking for policy info or a photo of a document.\n\n\u2705 Output 2\n\ud83d\udd34 Final & Strict Instruction:\nYou must return only one of the following numbers:\n1, 2, 3, 4, or 5\nNo text. No description. No formatting. Only the number.\n\n",
        "batching": {},
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "6d936987-3ed9-4417-9829-62ee00ceb907",
      "name": "update leaves",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        3020,
        -1240
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $json.contacts[0].profile.name }}"
          },
          "schema": [
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "department head  email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "department head  email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "available leaves",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "available leaves",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "last leave ",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "last leave ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "attendance ",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "attendance ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "department",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1608741360,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1608741360",
          "cachedResultName": "leaves"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "4dbab467-b3c1-401b-8481-e5af8f8ace06",
      "name": "get leaves",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2900,
        -1240
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1608741360,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=1608741360",
          "cachedResultName": "leaves"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "c99010c9-5e77-46bc-857e-0d50cbaafb17",
      "name": "Leave Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2760,
        -1460
      ],
      "parameters": {
        "text": "=You are an autonomous leave request assistant for ICICI's internal HR system.\nYou receive leave requests from employees through WhatsApp in plain text \n{{ $json.messages[0].text.body }}- this is the leave request text and details use the above \n- \u201cI need a sick leave on 11th June\u201d\n- \u201cI'm applying for medical leave from 11th to 14th June\u201d\n- \u201cCan I take a personal leave tomorrow?\u201d\nYour goal is to process each leave request correctly based on live employee data and respond with the appropriate action.\nTools You Can Use:\n1. **Google Sheets \u2013 Get Rows Tool**\n   - Use this to retrieve employee records\n   - Sheet contains the following columns:\n     - `name`, `email`, `department head email`, `available leaves`, `last leave`, `attendance`, `department`\n2. **Google Sheets \u2013 Append or Update Rows Tool**\n   - Use this to log any leave taken or updates if needed\n3. **Gmail Tool**\n   - Use this to send emails (e.g. approvals, forwarding to department heads)\nInput Format:\n- Each leave request comes from WhatsApp and contains:\n  - **Text** of the request (e.g. \u201cI need a sick leave on 11th June\u201d)\n  - **Name** of the requester, from WhatsApp contact:\n    `{{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}`\nYour Step-by-Step Logic:\n1. **Extract the following from the message:*{{ $json.messages[0].text.body }}*\n   - Dates requested (single or range)\n2. **Match the WhatsApp user\u2019s name** {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}with the **name** column in the Google Sheet using the `Get Rows` tool.\n3. **Check the employee\u2019s available leaves.**\n   - If available leaves \u2265 1:\n     - \u2705 **Sick leave for 1 day**:\n       - Compose an approval email to the employee\u2019s email\n       - CC the department head\n       - Email body should include the leave date and confirmation\n       - Use Gmail Tool to send\n       - Send WhatsApp message:  \n         > \u201cYour sick leave has been approved. Please check your email.\u201d\n     - \u2705 **Multi-day or non-sick leave**:\n       - Compose a **leave request email to the department head**\n       - Include reason, dates, and requester\u2019s name\n       - CC the employee\n       - Send WhatsApp message:  \n         > \u201cYour leave request has been forwarded to your department head for approval.\u201d\n\n   - \u274c If no available leaves:\n     - Do not send email\n     - Send WhatsApp message:  \n       > \u201cYou currently have no available leaves. Please contact HR if you believe this is an error.\u201d\n- Hallucinate any leave status\n- Invent dates or assume approval\n- Reply with personal opinions",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "4c37cdcc-e682-45c2-a229-7a180b1c39fe",
      "name": "HR Chatbot",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        5600,
        -1000
      ],
      "parameters": {
        "text": "={{ $json.text }}\n{{ $json.messages[0].text.body }}\n{{ $json.content }}",
        "options": {
          "systemMessage": "You are an autonomous HR assistant chatbot for ICICI employees.\n\nYou support inputs from text, audio, and image transcription.\n\nYou have access to a tool called `icici_policy_vector_store` that lets you retrieve official ICICI HR policies and documents.\n\nWhen answering **any HR policy-related question** (e.g., about leave, holidays, code of conduct, dress code, hybrid policy), always use this tool internally to retrieve information and guide your response. Do not mention that you are using the tool, vector search, or any database. Simply respond as if you already know the answer.\n\nIf the tool does not return any documents, respond clearly:\n> \u201cI couldn\u2019t find an official document for this, but here\u2019s what I can share based on general HR practices.\u201d\n\nYou also have access to a Google Sheet containing employee attendance. When a user asks about their attendance:\n- Count how many rows match their name\n- Each row is a day present\n- Count how many of those have Entry Time \u2264 09:15 and Exit Time > 17:15 for overtime\nRespond like: \u201cYou were present for 20 days this month, with 5 days of overtime.\u201d\n\nIf a user thanks you or ends the conversation, close politely.\n\nKeep all responses professional, friendly, helpful, and aligned with ICICI\u2019s HR voice.\n",
          "returnIntermediateSteps": true
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "f876f76f-56a2-4ba5-92e3-c4220b2c394b",
      "name": "policy_vector_store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        5800,
        -700
      ],
      "parameters": {
        "description": "\"toolDescription\": \" policy document search tool\"\n"
      },
      "typeVersion": 1.1
    },
    {
      "id": "53b5ced7-bb74-4bef-b091-243fee75989f",
      "name": "download media",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        4720,
        -440
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f091079a-734e-4c84-979c-54bd7f8ffeb5",
      "name": "download media1",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        4720,
        -680
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $json.messages[0].audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5206318e-e101-48e9-bfb5-588dce0bc965",
      "name": "read sheets",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        6040,
        -840
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=0",
          "cachedResultName": "rec shortlist sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "3eb8eda6-a8de-48de-bec4-15784b1b5f4f",
      "name": "WhatsApp Responder",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        5100,
        660
      ],
      "parameters": {
        "textBody": "={{ $json.output.message }}\n{{ $json.output }}",
        "operation": "send",
        "phoneNumberId": "635212696350193",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fbeaf315-5f58-46ec-bb1b-e6747e40e175",
      "name": "Attendance Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3300,
        420
      ],
      "parameters": {
        "text": "=Follow the steps below precisely:\n\nStep 1: Location Check\nthe value is true\n\nIf false, output only this exact message:\n\"not in office please resend loc when inside the building\"\n\nIf true, proceed to Step 2.\n\nStep 2: Extract User Info\nExtract the following:\n\nUser Name \u2192 {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\n\nCurrent DateTime \u2192 {{ $now }}\n\nFormat it as: hh:mm, DD-MM-YYYY\n\nStep 3: Google Sheet Attendance Logic\nuse the getrows tool and search for a row where:\n\nName equals {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\n\n\nDate equals today (based on formatted {{ $now }})\n\nThen:\n\nCase A: No matching row found\n\u2795 Create a new row with the following: using putrows tool\nName: {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\n\n\nDate: today\nName : {{ $json.contacts[0].profile.name }}\nEntry Time: current time (hh:mm), Date ( eg: 11th june, 10am)\n\nExit Time: (leave blank)\n\nCase B: Matching row exists & Exit Time is blank using getrows and putrows tool\n\n\ud83d\udd53 Update the existing row\u2019s Exit Time with current time.\n\nCase C: Matching row exists & Exit Time is already filled\n\u2705 Do nothing or optionally return: using google sheet 5 tool\n\"You have already logged both entry and exit for today.\"\n\nOutput Format:\nReturn a message like:\n\"Entry time logged: 09:45, 11-06-2025\"\n\"Exit time updated: 18:10, 11-06-2025\"\nOr, if already marked:\n\"You have already logged both entry and exit for today.\"\n\n\ud83d\udd01 Summary:\nOnly proceed if user is inside the office using {{ $json.isInsideOffice }}\nUse Google Sheets to track attendance per name per day.\n\nLog times in hh:mm, DD-MM-YYYY format.\n\nAvoid duplicate exit entries.",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "13da2613-9548-4986-8919-2ab9d3509685",
      "name": "Email Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3340,
        1120
      ],
      "parameters": {
        "text": "=based on {{ $('WhatsApp Trigger').item.json.messages[0].text.body }} , you need to generate an email for the users dept head from the google sheets tool and generate a mail based on whats in the whatspp message body \nitll be to the dept head email from the sheet and cc the user email.\nmatch using {{ $('WhatsApp Trigger').item.json.contacts[0].profile.name }}\nand generate a proper mail and send it with the gmail tool \n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "24190ee6-14f2-4bbd-a31d-d88116395b81",
      "name": "Shortlist Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3200,
        1780
      ],
      "parameters": {
        "text": "={{ $json.messages[0].text.body }} is the user input.\nuse the JD sheet tool to extract the respective JD for the given poistion in the user input.\nuse the applicants sheets tool to extract applicant data , only name, email phone, you have a filter for returning only rows matching the required \"applied for\" role\nuse n8n tool to get cv text and compare with jd and make reaons for required output parser content\nalways return a new output with proper reasoning\ngive a score 1-10 based on exp, relevance of projects and listed skills\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "cccb72d6-be59-4539-874d-1ab0719ee7bd",
      "name": "Book Meeting",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        4000,
        1780
      ],
      "parameters": {
        "text": "=create a meeting for the user based on google calendar tool. meeting should be 2 days after {{ $today }} and between 11 and 12pm and 30 mins long.\ndont forget to output time and date in the message with human readable formatting\n\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "56dbb775-e51e-4b42-870a-4deea2a92b82",
      "name": "get mail",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        5100,
        2160
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "Name"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit#gid=0",
          "cachedResultName": "rec shortlist sheet"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1cV4GluXOU9d1xXON9yW80ZYPFEhQfizzDjcc8xwpeNc/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "ee2c331e-2360-4599-93a8-be260b909685",
      "name": "WhatsApp Approval",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        4440,
        1760
      ],
      "parameters": {
        "message": "={{ $json.output.message }}\n\n{{ $json.output.link }}",
        "options": {},
        "operation": "sendAndWait",
        "phoneNumberId": "635212696350193",
        "recipientPhoneNumber": "919108281677"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "any",
    "executionOrder": "v1"
  },
  "versionId": "c4b6ec7f-bdcb-4d87-aebb-99c7725632cf",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Personalize email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n": {
      "ai_tool": [
        [
          {
            "node": "Shortlist Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Attendance Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail": {
      "ai_tool": [
        [
          {
            "node": "Leave Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "ai_tool": [
        [
          {
            "node": "Personalize email",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail2": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Verify Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Shortlist Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JD tool": {
      "ai_tool": [
        [
          {
            "node": "Shortlist Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getrows": {
      "ai_tool": [
        [
          {
            "node": "Attendance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "putrows": {
      "ai_tool": [
        [
          {
            "node": "Attendance Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "get mail": {
      "ai_tool": [
        [
          {
            "node": "Personalize email",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "HR Chatbot": {
      "main": [
        [
          {
            "node": "WhatsApp Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "applicants": {
      "ai_tool": [
        [
          {
            "node": "Shortlist Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "get leaves": {
      "ai_tool": [
        [
          {
            "node": "Leave Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "HR Chatbot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Agent": {
      "main": [
        [
          {
            "node": "WhatsApp Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Leave Agent": {
      "main": [
        [
          {
            "node": "WhatsApp Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "read sheets": {
      "ai_tool": [
        [
          {
            "node": "HR Chatbot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Book Meeting": {
      "main": [
        [
          {
            "node": "WhatsApp Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "HR Chatbot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "HR Chatbot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "Leave Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update leaves": {
      "ai_tool": [
        [
          {
            "node": "Leave Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delegatory LLM": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        [
          {
            "node": "Book Meeting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "download media": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "Book Meeting",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Shortlist Agent": {
      "main": [
        [
          {
            "node": "Google Sheets2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "dept head email": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "download media1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attendance Agent": {
      "main": [
        [
          {
            "node": "WhatsApp Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Delegatory LLM",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Supabase Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "HR Chatbot",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Personalize email": {
      "main": [
        [
          {
            "node": "WhatsApp Responder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Approval": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "policy_vector_store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Leave Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Attendance Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Shortlist Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Book Meeting",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Email Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "Delegatory LLM",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Responder": {
      "main": [
        []
      ]
    },
    "Verify Message Type": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "download media1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "download media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "policy_vector_store": {
      "ai_tool": [
        [
          {
            "node": "HR Chatbot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Supabase Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "policy_vector_store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Shortlist Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Book Meeting",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "Attendance Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}