{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6d7688d5-8162-40d8-a707-9c95343e5e3d",
      "name": "Parse Offboarding Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1344,
        160
      ],
      "parameters": {
        "jsCode": "const formData = $input.first().json;\n\nreturn {\n  json: {\n    offboardingId: formData.submissionID || 'OFF-' + Date.now(),\n    submissionDate: new Date().toISOString(),\n    employeeName: formData.employeeName || formData.q3_employeeName,\n    employeeEmail: formData.employeeEmail || formData.q4_employeeEmail,\n    employeeId: formData.employeeId || formData.q5_employeeId,\n    department: formData.department || formData.q6_department,\n    position: formData.position || formData.q7_position,\n    manager: formData.manager || formData.q8_manager,\n    managerEmail: formData.managerEmail || formData.q9_managerEmail,\n    lastWorkingDay: formData.lastWorkingDay || formData.q10_lastWorkingDay,\n    resignationReason: formData.resignationReason || formData.q11_resignationReason,\n    newEmployer: formData.newEmployer || formData.q12_newEmployer || 'Not disclosed',\n    willingToReturn: formData.willingToReturn || formData.q13_willingToReturn || 'Maybe',\n    overallSatisfaction: formData.overallSatisfaction || formData.q14_overallSatisfaction || '3',\n    managerRating: formData.managerRating || formData.q15_managerRating || '3',\n    workEnvironmentRating: formData.workEnvironmentRating || formData.q16_workEnvironmentRating || '3',\n    compensationFair: formData.compensationFair || formData.q17_compensationFair || 'Somewhat',\n    careerGrowth: formData.careerGrowth || formData.q18_careerGrowth || 'Limited',\n    wouldRecommend: formData.wouldRecommend || formData.q19_wouldRecommend || 'Maybe',\n    whatWorkedWell: formData.whatWorkedWell || formData.q20_whatWorkedWell || '',\n    improvementAreas: formData.improvementAreas || formData.q21_improvementAreas || '',\n    reasonForLeaving: formData.reasonForLeaving || formData.q22_reasonForLeaving || '',\n    additionalFeedback: formData.additionalFeedback || formData.q23_additionalFeedback || '',\n    hasLaptop: formData.hasLaptop || formData.q24_hasLaptop || 'no',\n    laptopSerialNumber: formData.laptopSerialNumber || formData.q25_laptopSerialNumber || '',\n    hasMobile: formData.hasMobile || formData.q26_hasMobile || 'no',\n    mobileNumber: formData.mobileNumber || formData.q27_mobileNumber || '',\n    hasKeyCard: formData.hasKeyCard || formData.q28_hasKeyCard || 'no',\n    hasCreditCard: formData.hasCreditCard || formData.q29_hasCreditCard || 'no',\n    otherEquipment: formData.otherEquipment || formData.q30_otherEquipment || '',\n    replacementName: formData.replacementName || formData.q31_replacementName || 'TBD',\n    replacementEmail: formData.replacementEmail || formData.q32_replacementEmail || '',\n    criticalProjects: formData.criticalProjects || formData.q33_criticalProjects || '',\n    documentationLocation: formData.documentationLocation || formData.q34_documentationLocation || '',\n    keyContacts: formData.keyContacts || formData.q35_keyContacts || '',\n    status: 'initiated'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "29cfc4d5-2cff-444e-ab0f-756ccc0476aa",
      "name": "AI Exit Interview Analysis",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1104,
        240
      ],
      "parameters": {
        "text": "=You are an expert HR analyst. Analyze this exit interview:\n\n**Employee:** {{ $json.employeeName }} - {{ $json.position }} ({{ $json.department }})\n**Manager:** {{ $json.manager }}\n**Last Day:** {{ $json.lastWorkingDay }}\n**Reason:** {{ $json.resignationReason }}\n**New Employer:** {{ $json.newEmployer }}\n\n**Ratings:**\n- Overall Satisfaction: {{ $json.overallSatisfaction }}/5\n- Manager: {{ $json.managerRating }}/5\n- Environment: {{ $json.workEnvironmentRating }}/5\n- Compensation Fair: {{ $json.compensationFair }}\n- Career Growth: {{ $json.careerGrowth }}\n- Would Recommend: {{ $json.wouldRecommend }}\n- Willing to Return: {{ $json.willingToReturn }}\n\n**Feedback:**\nWorked Well: {{ $json.whatWorkedWell }}\nImprovements: {{ $json.improvementAreas }}\nLeaving Reason: {{ $json.reasonForLeaving }}\nAdditional: {{ $json.additionalFeedback }}\n\nProvide JSON analysis:\n{\n  \"retentionAnalysis\": {\"flightRisk\": \"voluntary|pushout|retirement\", \"primaryReason\": \"compensation|career|management|culture\", \"preventable\": true|false, \"preventabilityScore\": 0-100, \"reasoning\": \"\"},\n  \"sentimentAnalysis\": {\"overallSentiment\": \"positive|neutral|negative\", \"sentimentScore\": 0-100, \"keyEmotions\": [], \"toneDescription\": \"\"},\n  \"managerPerformance\": {\"managerIssue\": true|false, \"managementConcerns\": [], \"managerActionRequired\": true|false, \"managerCoaching\": \"\"},\n  \"departmentInsights\": {\"departmentIssues\": [], \"culturalConcerns\": [], \"processImprovements\": [], \"teamImpact\": \"\"},\n  \"compensationInsights\": {\"compensationIssue\": true|false, \"marketCompetitiveness\": \"below|at|above\", \"benefitsAdequate\": true|false, \"recommendedAdjustment\": \"\"},\n  \"retentionRecommendations\": [{\"recommendation\": \"\", \"priority\": \"critical|high|medium\", \"targetAudience\": \"\", \"expectedImpact\": \"\"}],\n  \"boomerangPotential\": {\"likelyToReturn\": true|false, \"returnProbability\": 0-100, \"rehireRecommendation\": \"strongly_recommend|recommend|neutral\", \"rehireNotes\": \"\"},\n  \"knowledgeTransferRisk\": {\"criticalKnowledgeRisk\": \"low|medium|high\", \"documentationStatus\": \"excellent|good|poor\", \"transferComplexity\": \"simple|moderate|complex\", \"transferPlan\": []},\n  \"competitorIntelligence\": {\"competitorMoving\": true|false, \"competitorName\": \"\", \"competitorAdvantages\": [], \"competitiveThreat\": \"low|medium|high\"},\n  \"redFlags\": {\"hasRedFlags\": true|false, \"flaggedIssues\": [], \"requiresInvestigation\": true|false, \"urgency\": \"immediate|high|low\", \"escalationRequired\": true|false},\n  \"actionItems\": [{\"action\": \"\", \"owner\": \"\", \"deadline\": \"\", \"priority\": \"critical|high|medium\"}],\n  \"executiveSummary\": \"\",\n  \"hrPriority\": 1-5\n}",
        "options": {
          "systemMessage": "You are an expert HR analyst specializing in employee retention and organizational development."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "e0705b20-98fb-4cc9-8158-8b714e6397bf",
      "name": "Extract AI Analysis",
      "type": "n8n-nodes-base.set",
      "position": [
        -752,
        112
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "aiAnalysis",
              "name": "aiAnalysis",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "86beba39-71ae-4d75-b0b6-73fa0ddc8372",
      "name": "Merge Exit Analysis",
      "type": "n8n-nodes-base.code",
      "position": [
        -512,
        224
      ],
      "parameters": {
        "jsCode": "const offboardingData = $input.first().json;\nconst aiAnalysisRaw = offboardingData.aiAnalysis;\n\nlet aiAnalysis;\ntry {\n  aiAnalysis = JSON.parse(aiAnalysisRaw);\n} catch (e) {\n  aiAnalysis = {\n    retentionAnalysis: {flightRisk: 'voluntary', primaryReason: 'personal', preventable: false, preventabilityScore: 30, reasoning: 'Personal reasons'},\n    sentimentAnalysis: {overallSentiment: 'neutral', sentimentScore: 50, keyEmotions: ['professional'], toneDescription: 'Professional'},\n    managerPerformance: {managerIssue: false, managementConcerns: [], managerActionRequired: false, managerCoaching: 'None'},\n    departmentInsights: {departmentIssues: [], culturalConcerns: [], processImprovements: [], teamImpact: 'Minimal'},\n    compensationInsights: {compensationIssue: false, marketCompetitiveness: 'at', benefitsAdequate: true, recommendedAdjustment: 'None'},\n    retentionRecommendations: [],\n    boomerangPotential: {likelyToReturn: true, returnProbability: 50, rehireRecommendation: 'recommend', rehireNotes: 'Good performer'},\n    knowledgeTransferRisk: {criticalKnowledgeRisk: 'medium', documentationStatus: 'good', transferComplexity: 'moderate', transferPlan: ['Document processes']},\n    competitorIntelligence: {competitorMoving: false, competitorName: 'Unknown', competitorAdvantages: [], competitiveThreat: 'low'},\n    redFlags: {hasRedFlags: false, flaggedIssues: [], requiresInvestigation: false, urgency: 'low', escalationRequired: false},\n    actionItems: [],\n    executiveSummary: 'Standard voluntary departure.',\n    hrPriority: 3\n  };\n}\n\nconst lastDay = new Date(offboardingData.lastWorkingDay);\nconst today = new Date();\nconst daysUntilLastDay = Math.ceil((lastDay - today) / (1000 * 60 * 60 * 24));\n\nconst equipmentList = [];\nif (offboardingData.hasLaptop === 'yes') equipmentList.push('Laptop: ' + offboardingData.laptopSerialNumber);\nif (offboardingData.hasMobile === 'yes') equipmentList.push('Mobile: ' + offboardingData.mobileNumber);\nif (offboardingData.hasKeyCard === 'yes') equipmentList.push('Key Card');\nif (offboardingData.hasCreditCard === 'yes') equipmentList.push('Corporate Card');\nif (offboardingData.otherEquipment) equipmentList.push('Other: ' + offboardingData.otherEquipment);\n\nreturn {\n  json: {\n    ...offboardingData,\n    daysUntilLastDay: daysUntilLastDay,\n    equipmentList: equipmentList,\n    equipmentCount: equipmentList.length,\n    flightRisk: aiAnalysis.retentionAnalysis.flightRisk,\n    primaryReason: aiAnalysis.retentionAnalysis.primaryReason,\n    preventable: aiAnalysis.retentionAnalysis.preventable,\n    preventabilityScore: aiAnalysis.retentionAnalysis.preventabilityScore,\n    retentionReasoning: aiAnalysis.retentionAnalysis.reasoning,\n    overallSentiment: aiAnalysis.sentimentAnalysis.overallSentiment,\n    sentimentScore: aiAnalysis.sentimentAnalysis.sentimentScore,\n    keyEmotions: aiAnalysis.sentimentAnalysis.keyEmotions,\n    toneDescription: aiAnalysis.sentimentAnalysis.toneDescription,\n    managerIssue: aiAnalysis.managerPerformance.managerIssue,\n    managementConcerns: aiAnalysis.managerPerformance.managementConcerns,\n    managerActionRequired: aiAnalysis.managerPerformance.managerActionRequired,\n    managerCoaching: aiAnalysis.managerPerformance.managerCoaching,\n    departmentIssues: aiAnalysis.departmentInsights.departmentIssues,\n    culturalConcerns: aiAnalysis.departmentInsights.culturalConcerns,\n    processImprovements: aiAnalysis.departmentInsights.processImprovements,\n    teamImpact: aiAnalysis.departmentInsights.teamImpact,\n    compensationIssue: aiAnalysis.compensationInsights.compensationIssue,\n    marketCompetitiveness: aiAnalysis.compensationInsights.marketCompetitiveness,\n    benefitsAdequate: aiAnalysis.compensationInsights.benefitsAdequate,\n    salaryRecommendation: aiAnalysis.compensationInsights.recommendedAdjustment,\n    retentionRecommendations: aiAnalysis.retentionRecommendations,\n    likelyToReturn: aiAnalysis.boomerangPotential.likelyToReturn,\n    returnProbability: aiAnalysis.boomerangPotential.returnProbability,\n    rehireRecommendation: aiAnalysis.boomerangPotential.rehireRecommendation,\n    rehireNotes: aiAnalysis.boomerangPotential.rehireNotes,\n    knowledgeRisk: aiAnalysis.knowledgeTransferRisk.criticalKnowledgeRisk,\n    documentationStatus: aiAnalysis.knowledgeTransferRisk.documentationStatus,\n    transferComplexity: aiAnalysis.knowledgeTransferRisk.transferComplexity,\n    transferPlan: aiAnalysis.knowledgeTransferRisk.transferPlan,\n    movingToCompetitor: aiAnalysis.competitorIntelligence.competitorMoving,\n    competitorName: aiAnalysis.competitorIntelligence.competitorName,\n    competitorAdvantages: aiAnalysis.competitorIntelligence.competitorAdvantages,\n    competitiveThreat: aiAnalysis.competitorIntelligence.competitiveThreat,\n    hasRedFlags: aiAnalysis.redFlags.hasRedFlags,\n    flaggedIssues: aiAnalysis.redFlags.flaggedIssues,\n    requiresInvestigation: aiAnalysis.redFlags.requiresInvestigation,\n    flagUrgency: aiAnalysis.redFlags.urgency,\n    escalationRequired: aiAnalysis.redFlags.escalationRequired,\n    actionItems: aiAnalysis.actionItems,\n    executiveSummary: aiAnalysis.executiveSummary,\n    hrPriority: aiAnalysis.hrPriority\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "e1eef5b4-5a69-4820-9d13-e6558a9cf570",
      "name": "Has Red Flags?",
      "type": "n8n-nodes-base.if",
      "position": [
        -272,
        320
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "condition1",
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.hasRedFlags }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "ec33fccb-989c-4a04-8966-b0fb7f202a60",
      "name": "Send Red Flag Alert",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -144,
        144
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=\ud83d\udea8 CRITICAL EXIT INTERVIEW ALERT\n\n**Employee:** {{ $json.employeeName }}\n**Position:** {{ $json.position }}\n**Department:** {{ $json.department }}\n**Manager:** {{ $json.manager }}\n**Last Day:** {{ $json.lastWorkingDay }}\n\n\u26a0\ufe0f **RED FLAGS:**\n{{ $json.flaggedIssues.map((flag, i) => `${i + 1}. ${flag.toUpperCase()}`).join('\\n') }}\n\n**Urgency:** {{ $json.flagUrgency.toUpperCase() }}\nRequires Investigation: {{ $json.requiresInvestigation ? 'YES' : 'NO' }}\nEscalation: {{ $json.escalationRequired ? 'YES - Executive Level' : 'HR Level' }}\n\n**AI Summary:**\n{{ $json.executiveSummary }}\n\n**Primary Reason:** {{ $json.primaryReason.replace('_', ' ').toUpperCase() }}\nPreventable: {{ $json.preventable ? 'YES (' + $json.preventabilityScore + '%)' : 'NO' }}\n\n{{ $json.managerIssue ? 'MANAGER ISSUE DETECTED: ' + $json.managementConcerns.join(', ') : '' }}\n\n**Ratings:**\n- Satisfaction: {{ $json.overallSatisfaction }}/5\n- Manager: {{ $json.managerRating }}/5\n- Environment: {{ $json.workEnvironmentRating }}/5\n\n**Immediate Actions:**\n{{ $json.actionItems.filter(item => item.priority === 'critical').map((item, i) => `${i + 1}. ${item.action} (${item.owner})`).join('\\n') }}\n\nConfidential - Handle Immediately\n\n---\nAI-Powered Exit Interview System",
        "options": {},
        "subject": "=\ud83d\udea8 URGENT: Exit Interview Red Flags - {{ $json.employeeName }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f8168232-a4f2-4194-8697-b709e1b2345b",
      "name": "Send Employee Checklist",
      "type": "n8n-nodes-base.gmail",
      "position": [
        368,
        560
      ],
      "parameters": {
        "sendTo": "={{ $('Jotform Trigger').item.json['Employee Email'] }}",
        "message": "=Hi {{ $('Jotform Trigger').item.json['Employee Name'].first }},\n\nThank you for your service. Here's your offboarding checklist:\n\n**Last Working Day:** {{ $('Jotform Trigger').item.json['Last Working Day '] }}\n\n\ud83d\udce6 **EQUIPMENT TO RETURN:**\n\n\nReturn by: {{ $('Jotform Trigger').item.json['Last Working Day '] }}\nShip to: IT Department, [Company Address]\n\n\ud83d\udd11 **ACCESS DEACTIVATION:**\nAll access will be automatically revoked on {{ $('Jotform Trigger').item.json['Last Working Day '] }}:\n\u2022 Email account\n\u2022 Company systems\n\u2022 Building access\n\u2022 VPN\n\n\ud83d\udcc4 **KNOWLEDGE TRANSFER:**\n{{ $json.replacementName !== 'TBD' ? 'Your replacement: ' + $json.replacementName : 'Replacement TBD' }}\n\nPlease ensure:\n\u2022 Project documentation updated\n\u2022 Passwords transferred to manager\n\u2022 Critical contacts documented\n\u2022 Ongoing work status documented\n\n\ud83d\udcb0 **FINAL PAYCHECK:**\n\u2022 Date: {{ $('Jotform Trigger').item.json['Last Working Day '] }}\n\u2022 Unused PTO: Included\n\u2022 COBRA info: Mailed in 14 days\n\u2022 401(k) rollover: Separate email\n\n\ud83d\udce7 **BEFORE YOUR LAST DAY:**\n1. Return all equipment\n2. Forward personal emails\n3. Download personal files\n4. Complete knowledge transfer\n\nQuestions? Contact hr@company.com\n\n{{ $json.willingToReturn === 'Yes' ? 'We hope to work together again someday!' : 'Best wishes in your next role!' }}\n\nHR Team",
        "options": {},
        "subject": "=Offboarding Checklist - Equipment & Access"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8b39327d-4763-4903-938d-fa05d810ac65",
      "name": "Send Manager Action Items",
      "type": "n8n-nodes-base.gmail",
      "position": [
        336,
        256
      ],
      "parameters": {
        "sendTo": "={{ $('Jotform Trigger').item.json['Manager Email'] }}",
        "message": "=Hi {{ $('Jotform Trigger').item.json.Manager }} ,\n\n{{ $('Jotform Trigger').item.json['Employee Name'].first }} is leaving. Here's what you need to do:\n\n**Employee:** {{ $('Jotform Trigger').item.json['Employee Name'].first }}\n**Last Day:** {{ $('Jotform Trigger').item.json['Last Working Day '] }}\n**Days Remaining:** {{ $json.daysUntilLastDay }}\n**Reason:** {{ $('Jotform Trigger').item.json.resignationReason }}\n\n\ud83e\udd16 **AI INSIGHTS:**\n{{ $json.executiveSummary }}\n\n**Preventability:** {{ $json.preventable ? 'YES (' + $json.preventabilityScore + '%)' : 'NO' }}\n**Primary Reason:** {{ $json.primaryReason.replace('_', ' ') }}\n\n{{ $json.managerIssue ? '\u26a0\ufe0f MANAGEMENT FEEDBACK: ' + $json.managementConcerns.join(', ') + '\\nHR will follow up.' : '' }}\n\n**Ratings:**\n- Satisfaction: {{ $('Jotform Trigger').item.json.overallSatisfaction }}/5\n- Your Rating: {{ $('Jotform Trigger').item.json.managerRating }}/5\n- Environment: {{ $('Jotform Trigger').item.json.workEnvironmentRating }}/5\n\n\ud83d\udccb **YOUR ACTION ITEMS:**\n\n**1. Knowledge Transfer ({{ $json.knowledgeRisk.toUpperCase() }} RISK)**\nComplexity: {{ $json.transferComplexity }}\nReplacement: {{ $('Jotform Trigger').item.json.replacementName }}\n\nPlan:\n{{ $json.transferPlan.map((step, i) => `${i + 1}. ${step}`).join('\\n') }}\n\n**2. Critical Projects:**\n{{ $json.criticalProjects || 'Please identify with employee' }}\n\n**3. Documentation:**\nLocation: {{ $json.documentationLocation || 'TBD' }}\n\n**4. Key Contacts:**\n{{ $json.keyContacts || 'TBD' }}\n\n**5. Schedule Transfer Sessions:**\nDeadline: {{ $('Jotform Trigger').item.json['Last Working Day '] }}\n{{ $json.daysUntilLastDay < 10 ? '\u26a0\ufe0f URGENT - Limited time!' : '' }}\n\n**6. Team Communication:**\nAnnounce departure and transition plan\n\n**7. Access Review:**\nConfirm all shared passwords documented\n\n{{ $json.compensationIssue ? '\ud83d\udcb0 COMPENSATION NOTE: Exit interview indicated comp concerns. Consider for team retention.' : '' }}\n\n**Retention Recommendations:**\n{{ $json.retentionRecommendations.slice(0, 3).map((rec, i) => `${i + 1}. ${rec.recommendation} (${rec.priority})`).join('\\n') }}\n\n**Boomerang Potential:** {{ $json.returnProbability }}%\n{{ $json.likelyToReturn ? 'Keep door open - they may return!' : '' }}\n\nContact HR with questions.\n\nHR Team",
        "options": {},
        "subject": "=Action Required: Offboarding -  {{ $('Jotform Trigger').item.json['Employee Name'].first }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0cf711cd-fa20-466d-8975-0f5bc7e2712b",
      "name": "Send IT Offboarding",
      "type": "n8n-nodes-base.gmail",
      "position": [
        512,
        64
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=IT Offboarding Request\n\n**Employee:** {{ $json.employeeName }}\n**ID:** {{ $json.employeeId }}\n**Email:** {{ $json.employeeEmail }}\n**Department:** {{ $json.department }}\n**Last Day:** {{ $json.lastWorkingDay }}\n**Days Until:** {{ $json.daysUntilLastDay }}\n\n\ud83d\udd12 **ACCESS TO REVOKE ON {{ $json.lastWorkingDay }}:**\n\u2022 Email account ({{ $json.employeeEmail }})\n\u2022 All company systems\n\u2022 VPN access\n\u2022 Building access card\n\u2022 Any admin privileges\n\n\ud83d\udce6 **EQUIPMENT TO RECOVER:**\n{{ $json.equipmentList.length > 0 ? $json.equipmentList.map((item, i) => `${i + 1}. ${item}`).join('\\n') : 'No equipment listed' }}\n\n\ud83d\udce7 **EMAIL FORWARDING:**\nForward to: {{ $json.manager }} ({{ $json.managerEmail }})\nDuration: 30 days\n\n\ud83d\udcbe **DATA TRANSFER:**\n\u2022 Backup employee files\n\u2022 Transfer to: {{ $json.replacementName !== 'TBD' ? $json.replacementName + ' (' + $json.replacementEmail + ')' : $json.manager }}\n\u2022 Document location: {{ $json.documentationLocation || 'TBD' }}\n\n\ud83d\udccb **CHECKLIST:**\n[ ] Revoke all system access\n[ ] Disable email account\n[ ] Forward emails to manager\n[ ] Backup user files\n[ ] Transfer critical data\n[ ] Deactivate VPN\n[ ] Disable badge access\n[ ] Confirm equipment return\n[ ] Remove from distribution lists\n[ ] Update org chart systems\n\n{{ $json.daysUntilLastDay < 7 ? '\u26a0\ufe0f URGENT - Less than 1 week!' : '' }}\n\nSchedule access revocation for EOD {{ $json.lastWorkingDay }}\n\nHR Team",
        "options": {},
        "subject": "=IT Offboarding: {{ $json.employeeName }} - {{ $json.lastWorkingDay }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "faae0f0c-322c-4415-8360-d73bb308584d",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        848,
        240
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "Employee Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Employee Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Employee Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Start Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Start Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Position",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Position",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Department",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Department",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Manager Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Manager Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Employee Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Employee Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Laptop Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Laptop Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Software Access",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Software Access",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Phone Needed",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Phone Needed",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Experience Level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Experience Level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Emergency Contact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Emergency Contact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Shirt Size",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Shirt Size",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Dietary Restrictions",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Dietary Restrictions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "threadId",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "threadId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelIds",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "labelIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pwrTx5GXB7mAg5eJQ9q0I9tsgSI9keZ2W4iuTZi7wF8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1pwrTx5GXB7mAg5eJQ9q0I9tsgSI9keZ2W4iuTZi7wF8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1pwrTx5GXB7mAg5eJQ9q0I9tsgSI9keZ2W4iuTZi7wF8/edit?usp=drivesdk",
          "cachedResultName": "Employee Onboarding"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "71b9e82f-c9d8-4b33-a415-0696f80142c9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        48
      ],
      "parameters": {
        "height": 240,
        "content": "\ud83d\udce9 **TRIGGER**\nCaptures resignation\nand exit interview data\nvia Jotform\nCreate your form for free on [Jotform using this link](https://www.jotform.com/?partner=mediajade)"
      },
      "typeVersion": 1
    },
    {
      "id": "797528ee-89eb-4bde-97ed-99a0af58a3f1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        48
      ],
      "parameters": {
        "height": 240,
        "content": "\ud83e\uddfe **PARSE**\nNormalizes all\noffboarding data"
      },
      "typeVersion": 1
    },
    {
      "id": "bee1b348-6fc4-4660-a812-5854140d48b2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        48
      ],
      "parameters": {
        "height": 640,
        "content": "\ud83e\udd16 **AI ANALYSIS**\nAnalyzes exit interview\nfor retention insights,\nred flags, and trends"
      },
      "typeVersion": 1
    },
    {
      "id": "71087237-b7f3-4489-aa99-0cbdd3c1c845",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        0
      ],
      "parameters": {
        "height": 240,
        "content": "\ud83d\udd17 **EXTRACT**\nExtracts structured\nJSON from AI"
      },
      "typeVersion": 1
    },
    {
      "id": "d1a2d1bb-275f-4462-a880-41aeba329d84",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        80
      ],
      "parameters": {
        "height": 240,
        "content": "\ud83e\udde9 **MERGE**\nCombines AI insights\nwith offboarding data\nand calculates metrics"
      },
      "typeVersion": 1
    },
    {
      "id": "c41d3858-26fb-4b6b-b8fb-a2a9fa9d129c",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        96
      ],
      "parameters": {
        "width": 352,
        "height": 416,
        "content": "\u26a0\ufe0f **RED FLAG CHECK**\nRoutes serious issues\nto HR/Legal immediately"
      },
      "typeVersion": 1
    },
    {
      "id": "1d71ecc7-886c-462b-8dc0-b4380655160d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        16
      ],
      "parameters": {
        "width": 640,
        "height": 736,
        "content": "\ud83d\udce7 **NOTIFICATIONS**\nSends automated emails to:\n\u2022 Employee (checklist)\n\u2022 Manager (action items)\n\u2022 IT (access revocation)\n\u2022 HR (alerts if red flags)"
      },
      "typeVersion": 1
    },
    {
      "id": "864a4f22-2ed4-433e-9846-d16ab2aac05e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        96
      ],
      "parameters": {
        "height": 240,
        "content": "\ud83d\udcca **LOGGING**\nComplete audit trail\nwith AI insights for\nretention analytics"
      },
      "typeVersion": 1
    },
    {
      "id": "1f9c4d10-9a3a-4578-9844-3eca072b5554",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1120,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "032e0843-0db5-4d76-869e-a10f9905fcf0",
      "name": "Jotform Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -1632,
        192
      ],
      "parameters": {
        "form": "252852702090453"
      },
      "credentials": {
        "jotFormApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Has Red Flags?": {
      "main": [
        [
          {
            "node": "Send Red Flag Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Manager Action Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Jotform Trigger": {
      "main": [
        [
          {
            "node": "Parse Offboarding Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Exit Interview Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract AI Analysis": {
      "main": [
        [
          {
            "node": "Merge Exit Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Exit Analysis": {
      "main": [
        [
          {
            "node": "Has Red Flags?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send IT Offboarding": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Red Flag Alert": {
      "main": [
        [
          {
            "node": "Send Manager Action Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Offboarding Data": {
      "main": [
        [
          {
            "node": "AI Exit Interview Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Employee Checklist": {
      "main": [
        [
          {
            "node": "Send IT Offboarding",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Manager Action Items": {
      "main": [
        [
          {
            "node": "Send Employee Checklist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Exit Interview Analysis": {
      "main": [
        [
          {
            "node": "Extract AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}