8
n8n 中文网amn8n.com

使用 GPT-4 分析和 JotForm 离职面谈自动化员工离职流程

高级

这是一个自动化工作流,包含 20 个节点。主要使用 If, Set, Code, Gmail, GoogleSheets 等节点。 使用 GPT-4 分析和 JotForm 离职面谈实现员工离职流程自动化

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6d7688d5-8162-40d8-a707-9c95343e5e3d",
      "name": "解析离职数据",
      "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离职面谈分析",
      "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": "提取AI分析",
      "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": "合并离职分析",
      "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": "存在红旗标志?",
      "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": "发送红旗警报",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -144,
        144
      ],
      "webhookId": "965ee19b-d0c0-45d9-aefa-bf82b4963f11",
      "parameters": {
        "sendTo": "hr-director@company.com",
        "message": "=🚨 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⚠️ **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": "=🚨 URGENT: Exit Interview Red Flags - {{ $json.employeeName }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f8168232-a4f2-4194-8697-b709e1b2345b",
      "name": "发送员工清单",
      "type": "n8n-nodes-base.gmail",
      "position": [
        368,
        560
      ],
      "webhookId": "7bff5bb9-913c-4d54-b6e5-9f0051d03e3f",
      "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📦 **EQUIPMENT TO RETURN:**\n\n\nReturn by: {{ $('Jotform Trigger').item.json['Last Working Day '] }}\nShip to: IT Department, [Company Address]\n\n🔑 **ACCESS DEACTIVATION:**\nAll access will be automatically revoked on {{ $('Jotform Trigger').item.json['Last Working Day '] }}:\n• Email account\n• Company systems\n• Building access\n• VPN\n\n📄 **KNOWLEDGE TRANSFER:**\n{{ $json.replacementName !== 'TBD' ? 'Your replacement: ' + $json.replacementName : 'Replacement TBD' }}\n\nPlease ensure:\n• Project documentation updated\n• Passwords transferred to manager\n• Critical contacts documented\n• Ongoing work status documented\n\n💰 **FINAL PAYCHECK:**\n• Date: {{ $('Jotform Trigger').item.json['Last Working Day '] }}\n• Unused PTO: Included\n• COBRA info: Mailed in 14 days\n• 401(k) rollover: Separate email\n\n📧 **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": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8b39327d-4763-4903-938d-fa05d810ac65",
      "name": "发送经理行动项",
      "type": "n8n-nodes-base.gmail",
      "position": [
        336,
        256
      ],
      "webhookId": "1b42fa79-4f3f-4bee-b4a1-961106e7bcb5",
      "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🤖 **AI INSIGHTS:**\n{{ $json.executiveSummary }}\n\n**Preventability:** {{ $json.preventable ? 'YES (' + $json.preventabilityScore + '%)' : 'NO' }}\n**Primary Reason:** {{ $json.primaryReason.replace('_', ' ') }}\n\n{{ $json.managerIssue ? '⚠️ 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📋 **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 ? '⚠️ 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 ? '💰 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": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0cf711cd-fa20-466d-8975-0f5bc7e2712b",
      "name": "发送IT离职处理",
      "type": "n8n-nodes-base.gmail",
      "position": [
        512,
        64
      ],
      "webhookId": "37c95c12-43c4-476c-ac58-7bd040c26369",
      "parameters": {
        "sendTo": "it@company.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🔒 **ACCESS TO REVOKE ON {{ $json.lastWorkingDay }}:**\n• Email account ({{ $json.employeeEmail }})\n• All company systems\n• VPN access\n• Building access card\n• Any admin privileges\n\n📦 **EQUIPMENT TO RECOVER:**\n{{ $json.equipmentList.length > 0 ? $json.equipmentList.map((item, i) => `${i + 1}. ${item}`).join('\\n') : 'No equipment listed' }}\n\n📧 **EMAIL FORWARDING:**\nForward to: {{ $json.manager }} ({{ $json.managerEmail }})\nDuration: 30 days\n\n💾 **DATA TRANSFER:**\n• Backup employee files\n• Transfer to: {{ $json.replacementName !== 'TBD' ? $json.replacementName + ' (' + $json.replacementEmail + ')' : $json.manager }}\n• Document location: {{ $json.documentationLocation || 'TBD' }}\n\n📋 **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 ? '⚠️ 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": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "faae0f0c-322c-4415-8360-d73bb308584d",
      "name": "记录到 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": {
          "id": "Kz2DdSp11rxqwlFt",
          "name": "Google Sheets account - Deepanshi"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "71b9e82f-c9d8-4b33-a415-0696f80142c9",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        48
      ],
      "parameters": {
        "height": 240,
        "content": "📩 **触发器**"
      },
      "typeVersion": 1
    },
    {
      "id": "797528ee-89eb-4bde-97ed-99a0af58a3f1",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        48
      ],
      "parameters": {
        "height": 240,
        "content": "🧾 **解析**"
      },
      "typeVersion": 1
    },
    {
      "id": "bee1b348-6fc4-4660-a812-5854140d48b2",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        48
      ],
      "parameters": {
        "height": 640,
        "content": "🤖 **AI分析**"
      },
      "typeVersion": 1
    },
    {
      "id": "71087237-b7f3-4489-aa99-0cbdd3c1c845",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        0
      ],
      "parameters": {
        "height": 240,
        "content": "🔗 **提取**"
      },
      "typeVersion": 1
    },
    {
      "id": "d1a2d1bb-275f-4462-a880-41aeba329d84",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        80
      ],
      "parameters": {
        "height": 240,
        "content": "🧩 **合并**"
      },
      "typeVersion": 1
    },
    {
      "id": "c41d3858-26fb-4b6b-b8fb-a2a9fa9d129c",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        96
      ],
      "parameters": {
        "width": 352,
        "height": 416,
        "content": "⚠️ **红旗检查**"
      },
      "typeVersion": 1
    },
    {
      "id": "1d71ecc7-886c-462b-8dc0-b4380655160d",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        16
      ],
      "parameters": {
        "width": 640,
        "height": 736,
        "content": "📧 **通知**"
      },
      "typeVersion": 1
    },
    {
      "id": "864a4f22-2ed4-433e-9846-d16ab2aac05e",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        96
      ],
      "parameters": {
        "height": 240,
        "content": "📊 **日志记录**"
      },
      "typeVersion": 1
    },
    {
      "id": "1f9c4d10-9a3a-4578-9844-3eca072b5554",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1120,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8IkhtT3EbXygnvcr",
          "name": "Klinsman OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "032e0843-0db5-4d76-869e-a10f9905fcf0",
      "name": "Jotform触发器",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        -1632,
        192
      ],
      "webhookId": "employee-offboarding",
      "parameters": {
        "form": "252852702090453"
      },
      "credentials": {
        "jotFormApi": {
          "id": "W7O1b225FpOwkwDT",
          "name": "JotForm account-Deepanshi"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Jotform Trigger": [
      {
        "Manager": "me",
        "Position": "manager",
        "hasLaptop": "",
        "hasMobile": "",
        "Department": "IT",
        "Shirt Size": "",
        "Laptop Type": "hp",
        "employee Id": "223",
        "New Employer": "mo",
        "Phone Needed": "35915",
        "careerGrowth": "nil",
        "Employee Name": {
          "last": "Singhal",
          "first": "Deepanshi"
        },
        "Employee Type": "Full Type",
        "Manager Email": "Deep@gmail.com",
        "managerRating": "2",
        "Employee Email": "deepashirig@gmail.com",
        "whatWorkedWell": "nothing",
        "wouldRecommend": "no",
        "Software Access": "070249",
        "replacementName": "",
        "willingToReturn": "never",
        "Experience Level": "mid level",
        "compensationFair": "2",
        "criticalProjects": "",
        "improvementAreas": "",
        "reasonForLeaving": "",
        "replacementEmail": "",
        "Emergency Contact": {
          "full": ""
        },
        "Last Working Day ": {
          "day": "18",
          "year": "2025",
          "month": "10"
        },
        "resignationReason": "Due t o limited growth and poor organization culture",
        "additionalFeedback": "",
        "laptopSerialNumber": "",
        "overallSatisfaction": "1",
        "Dietary Restrictions": "",
        "documentationLocation": "",
        "workEnvironmentRating": "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量20
分类-
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jitesh Dugar

Jitesh Dugar

@jiteshdugar

AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.

外部链接
在 n8n.io 查看

分享此工作流