8
n8n 中文网amn8n.com

使用GPT-4、JotForm和Google Sheets的自动化企业培训请求

高级

这是一个自动化工作流,包含 21 个节点。主要使用 If, Set, Code, Gmail, GoogleSheets 等节点。 使用GPT-4、JotForm和Google Sheets的自动化企业培训请求

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

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e39f08f2-f12e-4b84-93b9-cf264a43c6d7",
      "name": "解析培训请求",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        0
      ],
      "parameters": {
        "jsCode": "const formData = $input.first().json;\n\nreturn {\n  json: {\n    requestId: formData.submissionID || 'TRN-' + 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    trainingTopic: formData.trainingTopic || formData.q10_trainingTopic,\n    trainingCategory: formData.trainingCategory || formData.q11_trainingCategory || 'Technical',\n    skillGap: formData.skillGap || formData.q12_skillGap || '',\n    currentSkillLevel: formData.currentSkillLevel || formData.q13_currentSkillLevel || 'Beginner',\n    desiredSkillLevel: formData.desiredSkillLevel || formData.q14_desiredSkillLevel || 'Intermediate',\n    urgency: formData.urgency || formData.q15_urgency || 'Normal',\n    businessJustification: formData.businessJustification || formData.q16_businessJustification || '',\n    projectImpact: formData.projectImpact || formData.q17_projectImpact || '',\n    preferredFormat: formData.preferredFormat || formData.q18_preferredFormat || 'In-Person',\n    preferredDates: formData.preferredDates || formData.q19_preferredDates || '',\n    numberOfAttendees: parseInt(formData.numberOfAttendees || formData.q20_numberOfAttendees || '1'),\n    estimatedBudget: parseFloat(formData.estimatedBudget || formData.q21_estimatedBudget || '0'),\n    additionalNotes: formData.additionalNotes || formData.q22_additionalNotes || '',\n    status: 'pending_review'\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "b1dd4dc8-c71c-48e9-862f-4cf623af5954",
      "name": "检查培训预算",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        0
      ],
      "parameters": {
        "jsCode": "const data = $input.first().json;\n\n// Training budget database per department (annual)\nconst departmentBudgets = {\n  'Engineering': { total: 50000, spent: 28000, remaining: 22000 },\n  'Sales': { total: 30000, spent: 18000, remaining: 12000 },\n  'Marketing': { total: 25000, spent: 15000, remaining: 10000 },\n  'HR': { total: 15000, spent: 8000, remaining: 7000 },\n  'Finance': { total: 20000, spent: 12000, remaining: 8000 },\n  'Operations': { total: 18000, spent: 10000, remaining: 8000 },\n  'Customer Support': { total: 12000, spent: 6000, remaining: 6000 },\n  'Product': { total: 35000, spent: 20000, remaining: 15000 }\n};\n\n// Training catalog with costs\nconst trainingCatalog = {\n  'Technical': [\n    { name: 'Python Programming Fundamentals', duration: '3 days', cost: 1200, level: 'Beginner', provider: 'TechAcademy' },\n    { name: 'Advanced JavaScript & React', duration: '5 days', cost: 2000, level: 'Intermediate', provider: 'CodeSchool' },\n    { name: 'AWS Cloud Practitioner', duration: '2 days', cost: 800, level: 'Beginner', provider: 'CloudExperts' },\n    { name: 'Docker & Kubernetes', duration: '4 days', cost: 1800, level: 'Advanced', provider: 'DevOpsInstitute' },\n    { name: 'Cybersecurity Essentials', duration: '3 days', cost: 1500, level: 'Intermediate', provider: 'SecureLearn' }\n  ],\n  'Leadership': [\n    { name: 'Leadership Fundamentals', duration: '2 days', cost: 1000, level: 'Beginner', provider: 'LeadershipPro' },\n    { name: 'Strategic Management', duration: '3 days', cost: 1800, level: 'Advanced', provider: 'ExecutiveEd' },\n    { name: 'Team Building & Motivation', duration: '1 day', cost: 600, level: 'Intermediate', provider: 'TeamSuccess' }\n  ],\n  'Sales': [\n    { name: 'Consultative Selling', duration: '2 days', cost: 900, level: 'Intermediate', provider: 'SalesForce Academy' },\n    { name: 'Negotiation Mastery', duration: '2 days', cost: 1100, level: 'Advanced', provider: 'DealMakers' },\n    { name: 'Sales Fundamentals', duration: '1 day', cost: 500, level: 'Beginner', provider: 'SalesPro' }\n  ],\n  'Communication': [\n    { name: 'Effective Communication', duration: '1 day', cost: 400, level: 'Beginner', provider: 'CommSkills' },\n    { name: 'Public Speaking Mastery', duration: '2 days', cost: 800, level: 'Intermediate', provider: 'SpeakWell' },\n    { name: 'Presentation Skills', duration: '1 day', cost: 500, level: 'Intermediate', provider: 'PresenterPro' }\n  ],\n  'Project Management': [\n    { name: 'PMP Certification Prep', duration: '5 days', cost: 2500, level: 'Advanced', provider: 'PMI Institute' },\n    { name: 'Agile & Scrum Fundamentals', duration: '2 days', cost: 900, level: 'Beginner', provider: 'AgileExperts' },\n    { name: 'Project Planning & Execution', duration: '3 days', cost: 1200, level: 'Intermediate', provider: 'ProjectSuccess' }\n  ],\n  'Data & Analytics': [\n    { name: 'Data Analysis with Excel', duration: '2 days', cost: 700, level: 'Beginner', provider: 'DataSkills' },\n    { name: 'Power BI Advanced', duration: '3 days', cost: 1400, level: 'Advanced', provider: 'BIExperts' },\n    { name: 'SQL for Business', duration: '2 days', cost: 900, level: 'Intermediate', provider: 'DataAcademy' }\n  ]\n};\n\nconst department = data.department;\nconst budget = departmentBudgets[department] || { total: 10000, spent: 5000, remaining: 5000 };\nconst estimatedCost = data.estimatedBudget || 1000;\n\nconst budgetAvailable = budget.remaining >= estimatedCost;\nconst budgetUtilization = ((budget.spent / budget.total) * 100).toFixed(1);\n\nreturn {\n  json: {\n    ...data,\n    departmentBudgetTotal: budget.total,\n    departmentBudgetSpent: budget.spent,\n    departmentBudgetRemaining: budget.remaining,\n    budgetAvailable: budgetAvailable,\n    budgetUtilization: budgetUtilization,\n    trainingCatalog: trainingCatalog\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "94a80dc3-7d19-4ed8-a79d-db40bd326baa",
      "name": "AI 培训分析",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1200,
        0
      ],
      "parameters": {
        "text": "=You are an expert corporate training advisor with 15+ years in L&D. Analyze this training request and provide recommendations.\n\n**Employee Information:**\n- Name: {{ $json.employeeName }}\n- Position: {{ $json.position }}\n- Department: {{ $json.department }}\n- Current Skill Level: {{ $json.currentSkillLevel }}\n- Desired Skill Level: {{ $json.desiredSkillLevel }}\n\n**Training Request:**\n- Topic: {{ $json.trainingTopic }}\n- Category: {{ $json.trainingCategory }}\n- Skill Gap: {{ $json.skillGap }}\n- Business Justification: {{ $json.businessJustification }}\n- Project Impact: {{ $json.projectImpact }}\n- Urgency: {{ $json.urgency }}\n- Format Preference: {{ $json.preferredFormat }}\n- Attendees: {{ $json.numberOfAttendees }}\n- Estimated Budget: ${{ $json.estimatedBudget }}\n\n**Budget Context:**\n- Department Total Budget: ${{ $json.departmentBudgetTotal }}\n- Already Spent: ${{ $json.departmentBudgetSpent }}\n- Remaining: ${{ $json.departmentBudgetRemaining }}\n- Budget Available: {{ $json.budgetAvailable }}\n- Utilization: {{ $json.budgetUtilization }}%\n\n**Available Training Catalog:**\n{{ JSON.stringify($json.trainingCatalog, null, 2) }}\n\nProvide comprehensive analysis in JSON:\n{\n  \"needsAnalysis\": {\n    \"skillGapSeverity\": \"critical|high|medium|low\",\n    \"businessImpact\": \"high|medium|low\",\n    \"urgencyJustified\": true|false,\n    \"alignment\": \"strongly_aligned|aligned|partially_aligned|misaligned\",\n    \"roiPotential\": \"high|medium|low\",\n    \"analysis\": \"detailed assessment of training need\"\n  },\n  \"recommendedCourses\": [\n    {\n      \"courseName\": \"course from catalog\",\n      \"provider\": \"provider name\",\n      \"duration\": \"duration\",\n      \"cost\": number,\n      \"matchScore\": 0-100,\n      \"reasoning\": \"why this course fits\",\n      \"prerequisites\": [],\n      \"outcomes\": [\"expected outcome 1\", \"outcome 2\"]\n    }\n  ],\n  \"alternativeOptions\": [\n    {\n      \"option\": \"alternative approach\",\n      \"cost\": number,\n      \"pros\": [],\n      \"cons\": []\n    }\n  ],\n  \"budgetAnalysis\": {\n    \"requestWithinBudget\": true|false,\n    \"costEffective\": true|false,\n    \"budgetRecommendation\": \"approve|defer|reduce_scope|seek_alternatives\",\n    \"costOptimization\": [\"suggestion 1\", \"suggestion 2\"]\n  },\n  \"approvalRecommendation\": {\n    \"recommend\": \"strongly_approve|approve|conditional_approve|defer|reject\",\n    \"confidence\": 0-100,\n    \"reasoning\": \"detailed justification\",\n    \"conditions\": [\"condition 1 if applicable\"]\n  },\n  \"implementationPlan\": {\n    \"suggestedTimeline\": \"when to schedule\",\n    \"preparationNeeded\": [\"prep step 1\", \"prep step 2\"],\n    \"postTrainingActions\": [\"follow-up 1\", \"follow-up 2\"],\n    \"successMetrics\": [\"metric 1\", \"metric 2\"]\n  },\n  \"skillDevelopmentPath\": {\n    \"currentToDesired\": \"path description\",\n    \"estimatedTimeframe\": \"time to reach desired level\",\n    \"additionalTraining\": [\"future training 1\", \"future training 2\"],\n    \"onTheJobLearning\": [\"practical application 1\"]\n  },\n  \"teamImpact\": {\n    \"teamBenefit\": \"high|medium|low\",\n    \"knowledgeSharingPotential\": true|false,\n    \"multiplierEffect\": \"how this helps team\",\n    \"suggestAdditionalAttendees\": [\"name/role if applicable\"]\n  },\n  \"riskAssessment\": {\n    \"delayRisks\": [\"risk if not trained\"],\n    \"overInvestmentRisk\": \"low|medium|high\",\n    \"alternativeResources\": [\"internal mentoring\", \"online courses\"],\n    \"mitigation\": [\"how to mitigate risks\"]\n  },\n  \"managerGuidance\": {\n    \"keyConsiderations\": [\"point 1\", \"point 2\"],\n    \"questionsToAsk\": [\"question 1\", \"question 2\"],\n    \"approvalCriteria\": [\"criterion 1\", \"criterion 2\"]\n  }\n}",
        "options": {
          "systemMessage": "You are an expert corporate training advisor specializing in learning & development, ROI analysis, and skill development pathways."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "ba7ef4b8-9b63-4d63-88ca-18d39838ce5b",
      "name": "提取 AI 分析",
      "type": "n8n-nodes-base.set",
      "position": [
        1552,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "aiAnalysis",
              "name": "aiAnalysis",
              "type": "string",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "ba552a4e-b4c6-456b-af96-446155e5d625",
      "name": "合并培训分析",
      "type": "n8n-nodes-base.code",
      "position": [
        1808,
        -160
      ],
      "parameters": {
        "jsCode": "const trainingData = $input.first().json;\nconst aiAnalysisRaw = trainingData.aiAnalysis;\n\nlet aiAnalysis;\ntry {\n  aiAnalysis = JSON.parse(aiAnalysisRaw);\n} catch (e) {\n  aiAnalysis = {\n    needsAnalysis: {skillGapSeverity: 'medium', businessImpact: 'medium', urgencyJustified: true, alignment: 'aligned', roiPotential: 'medium', analysis: 'Training needed'},\n    recommendedCourses: [{courseName: 'General Training', provider: 'TBD', duration: '2 days', cost: 1000, matchScore: 70, reasoning: 'Relevant training', prerequisites: [], outcomes: ['Skill improvement']}],\n    alternativeOptions: [],\n    budgetAnalysis: {requestWithinBudget: true, costEffective: true, budgetRecommendation: 'approve', costOptimization: []},\n    approvalRecommendation: {recommend: 'approve', confidence: 75, reasoning: 'Valid training request', conditions: []},\n    implementationPlan: {suggestedTimeline: 'Within 30 days', preparationNeeded: [], postTrainingActions: [], successMetrics: []},\n    skillDevelopmentPath: {currentToDesired: 'Standard progression', estimatedTimeframe: '3-6 months', additionalTraining: [], onTheJobLearning: []},\n    teamImpact: {teamBenefit: 'medium', knowledgeSharingPotential: true, multiplierEffect: 'Team skill improvement', suggestAdditionalAttendees: []},\n    riskAssessment: {delayRisks: [], overInvestmentRisk: 'low', alternativeResources: [], mitigation: []},\n    managerGuidance: {keyConsiderations: [], questionsToAsk: [], approvalCriteria: []}\n  };\n}\n\nconst topCourse = aiAnalysis.recommendedCourses[0];\nconst approvalNeeded = aiAnalysis.budgetAnalysis.requestWithinBudget && \n                       (aiAnalysis.approvalRecommendation.recommend === 'approve' || \n                        aiAnalysis.approvalRecommendation.recommend === 'strongly_approve');\n\nreturn {\n  json: {\n    ...trainingData,\n    skillGapSeverity: aiAnalysis.needsAnalysis.skillGapSeverity,\n    businessImpact: aiAnalysis.needsAnalysis.businessImpact,\n    urgencyJustified: aiAnalysis.needsAnalysis.urgencyJustified,\n    alignment: aiAnalysis.needsAnalysis.alignment,\n    roiPotential: aiAnalysis.needsAnalysis.roiPotential,\n    needsAnalysisDetail: aiAnalysis.needsAnalysis.analysis,\n    recommendedCourses: aiAnalysis.recommendedCourses,\n    topRecommendedCourse: topCourse.courseName,\n    topCourseProvider: topCourse.provider,\n    topCourseDuration: topCourse.duration,\n    topCourseCost: topCourse.cost,\n    courseMatchScore: topCourse.matchScore,\n    courseReasoning: topCourse.reasoning,\n    coursePrerequisites: topCourse.prerequisites,\n    courseOutcomes: topCourse.outcomes,\n    alternativeOptions: aiAnalysis.alternativeOptions,\n    requestWithinBudget: aiAnalysis.budgetAnalysis.requestWithinBudget,\n    costEffective: aiAnalysis.budgetAnalysis.costEffective,\n    budgetRecommendation: aiAnalysis.budgetAnalysis.budgetRecommendation,\n    costOptimization: aiAnalysis.budgetAnalysis.costOptimization,\n    aiRecommendation: aiAnalysis.approvalRecommendation.recommend,\n    recommendationConfidence: aiAnalysis.approvalRecommendation.confidence,\n    recommendationReasoning: aiAnalysis.approvalRecommendation.reasoning,\n    approvalConditions: aiAnalysis.approvalRecommendation.conditions,\n    suggestedTimeline: aiAnalysis.implementationPlan.suggestedTimeline,\n    preparationNeeded: aiAnalysis.implementationPlan.preparationNeeded,\n    postTrainingActions: aiAnalysis.implementationPlan.postTrainingActions,\n    successMetrics: aiAnalysis.implementationPlan.successMetrics,\n    skillPath: aiAnalysis.skillDevelopmentPath.currentToDesired,\n    estimatedTimeframe: aiAnalysis.skillDevelopmentPath.estimatedTimeframe,\n    additionalTraining: aiAnalysis.skillDevelopmentPath.additionalTraining,\n    onTheJobLearning: aiAnalysis.skillDevelopmentPath.onTheJobLearning,\n    teamBenefit: aiAnalysis.teamImpact.teamBenefit,\n    knowledgeSharing: aiAnalysis.teamImpact.knowledgeSharingPotential,\n    multiplierEffect: aiAnalysis.teamImpact.multiplierEffect,\n    suggestedAttendees: aiAnalysis.teamImpact.suggestAdditionalAttendees,\n    delayRisks: aiAnalysis.riskAssessment.delayRisks,\n    overInvestmentRisk: aiAnalysis.riskAssessment.overInvestmentRisk,\n    alternativeResources: aiAnalysis.riskAssessment.alternativeResources,\n    riskMitigation: aiAnalysis.riskAssessment.mitigation,\n    managerConsiderations: aiAnalysis.managerGuidance.keyConsiderations,\n    managerQuestions: aiAnalysis.managerGuidance.questionsToAsk,\n    approvalCriteria: aiAnalysis.managerGuidance.approvalCriteria,\n    requiresApproval: approvalNeeded\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "8083f98b-ab59-464d-930f-1bd4f8d6dad8",
      "name": "需要审批?",
      "type": "n8n-nodes-base.if",
      "position": [
        2016,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition1",
              "operator": {
                "type": "boolean",
                "operation": "true"
              },
              "leftValue": "={{ $json.requiresApproval }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8f382f2a-cfce-4106-96fa-f9c99bfc7a46",
      "name": "发送经理审批",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2336,
        -32
      ],
      "webhookId": "f5fdae09-daec-4399-906a-85a27b3e0cac",
      "parameters": {
        "sendTo": "={{ $json.managerEmail }}",
        "message": "=Hi {{ $json.manager }},\n\n{{ $json.employeeName }} has requested training approval.\n\n📋 **TRAINING REQUEST DETAILS:**\n\n**Employee:** {{ $json.employeeName }} ({{ $json.position }})\n**Department:** {{ $json.department }}\n**Topic:** {{ $json.trainingTopic }}\n**Category:** {{ $json.trainingCategory }}\n**Urgency:** {{ $json.urgency }}\n\n**Skill Development:**\nCurrent Level: {{ $json.currentSkillLevel }}\nDesired Level: {{ $json.desiredSkillLevel }}\nSkill Gap: {{ $json.skillGap }}\n\n**Business Justification:**\n{{ $json.businessJustification }}\n\n**Project Impact:**\n{{ $json.projectImpact }}\n\n🤖 **AI TRAINING ANALYSIS:**\n\n**Needs Assessment:**\n• Skill Gap Severity: {{ $json.skillGapSeverity.toUpperCase() }}\n• Business Impact: {{ $json.businessImpact.toUpperCase() }}\n• Urgency Justified: {{ $json.urgencyJustified ? 'YES' : 'NO' }}\n• Strategic Alignment: {{ $json.alignment }}\n• ROI Potential: {{ $json.roiPotential.toUpperCase() }}\n\n{{ $json.needsAnalysisDetail }}\n\n**AI Recommendation:** {{ $json.aiRecommendation.replace('_', ' ').toUpperCase() }}\nConfidence: {{ $json.recommendationConfidence }}%\n\n**Reasoning:**\n{{ $json.recommendationReasoning }}\n\n{{ $json.approvalConditions.length > 0 ? '**Conditions:**\\n' + $json.approvalConditions.map((c, i) => `${i + 1}. ${c}`).join('\\n') + '\\n\\n' : '' }}\n\n💡 **RECOMMENDED TRAINING:**\n\n**Top Match:** {{ $json.topRecommendedCourse }}\n• Provider: {{ $json.topCourseProvider }}\n• Duration: {{ $json.topCourseDuration }}\n• Cost: ${{ $json.topCourseCost }}\n• Match Score: {{ $json.courseMatchScore }}%\n\n**Why This Course:**\n{{ $json.courseReasoning }}\n\n**Expected Outcomes:**\n{{ $json.courseOutcomes.map((outcome, i) => `${i + 1}. ${outcome}`).join('\\n') }}\n\n{{ $json.coursePrerequisites.length > 0 ? '**Prerequisites:**\\n' + $json.coursePrerequisites.map((p, i) => `${i + 1}. ${p}`).join('\\n') + '\\n\\n' : '' }}\n\n💰 **BUDGET ANALYSIS:**\n\n**Department Training Budget:**\n• Total Annual: ${{ $json.departmentBudgetTotal.toLocaleString() }}\n• Already Spent: ${{ $json.departmentBudgetSpent.toLocaleString() }}\n• Remaining: ${{ $json.departmentBudgetRemaining.toLocaleString() }}\n• Utilization: {{ $json.budgetUtilization }}%\n\n**This Request:**\n• Estimated Cost: ${{ $json.topCourseCost.toLocaleString() }}\n• Within Budget: {{ $json.requestWithinBudget ? '✅ YES' : '❌ NO' }}\n• Cost Effective: {{ $json.costEffective ? 'YES' : 'NO' }}\n• Recommendation: {{ $json.budgetRecommendation.toUpperCase() }}\n\n{{ $json.costOptimization.length > 0 ? '**Cost Optimization Ideas:**\\n' + $json.costOptimization.map((opt, i) => `${i + 1}. ${opt}`).join('\\n') + '\\n\\n' : '' }}\n\n📅 **IMPLEMENTATION PLAN:**\n\n**Suggested Timeline:** {{ $json.suggestedTimeline }}\n**Attendees:** {{ $json.numberOfAttendees }}\n**Format:** {{ $json.preferredFormat }}\n{{ $json.preferredDates ? 'Preferred Dates: ' + $json.preferredDates : '' }}\n\n**Preparation Needed:**\n{{ $json.preparationNeeded.map((prep, i) => `${i + 1}. ${prep}`).join('\\n') }}\n\n**Post-Training Actions:**\n{{ $json.postTrainingActions.map((action, i) => `${i + 1}. ${action}`).join('\\n') }}\n\n**Success Metrics:**\n{{ $json.successMetrics.map((metric, i) => `${i + 1}. ${metric}`).join('\\n') }}\n\n🎯 **SKILL DEVELOPMENT PATH:**\n\n{{ $json.skillPath }}\n\n**Estimated Timeframe:** {{ $json.estimatedTimeframe }}\n\n**Additional Future Training:**\n{{ $json.additionalTraining.map((training, i) => `${i + 1}. ${training}`).join('\\n') }}\n\n**On-the-Job Learning:**\n{{ $json.onTheJobLearning.map((learn, i) => `${i + 1}. ${learn}`).join('\\n') }}\n\n👥 **TEAM IMPACT:**\n\n• Team Benefit Level: {{ $json.teamBenefit.toUpperCase() }}\n• Knowledge Sharing Potential: {{ $json.knowledgeSharing ? 'YES' : 'NO' }}\n• Multiplier Effect: {{ $json.multiplierEffect }}\n\n{{ $json.suggestedAttendees.length > 0 ? '**Suggested Additional Attendees:**\\n' + $json.suggestedAttendees.map((att, i) => `${i + 1}. ${att}`).join('\\n') + '\\n\\n' : '' }}\n\n⚠️ **RISK ASSESSMENT:**\n\n{{ $json.delayRisks.length > 0 ? '**Risks if Training Delayed:**\\n' + $json.delayRisks.map((risk, i) => `${i + 1}. ${risk}`).join('\\n') + '\\n\\n' : '' }}\n\n**Over-Investment Risk:** {{ $json.overInvestmentRisk.toUpperCase() }}\n\n{{ $json.alternativeResources.length > 0 ? '**Alternative Resources:**\\n' + $json.alternativeResources.map((alt, i) => `${i + 1}. ${alt}`).join('\\n') + '\\n\\n' : '' }}\n\n{{ $json.alternativeOptions.length > 0 ? '**Alternative Training Options:**\\n' + $json.alternativeOptions.map((opt, i) => `${i + 1}. ${opt.option} - $${opt.cost}\\n   Pros: ${opt.pros.join(', ')}\\n   Cons: ${opt.cons.join(', ')}`).join('\\n\\n') + '\\n\\n' : '' }}\n\n📝 **YOUR CONSIDERATIONS:**\n\n{{ $json.managerConsiderations.map((consider, i) => `${i + 1}. ${consider}`).join('\\n') }}\n\n**Questions to Discuss with {{ $json.employeeName }}:**\n{{ $json.managerQuestions.map((q, i) => `${i + 1}. ${q}`).join('\\n') }}\n\n**Approval Criteria:**\n{{ $json.approvalCriteria.map((criteria, i) => `${i + 1}. ${criteria}`).join('\\n') }}\n\n---\n\n**APPROVAL OPTIONS:**\n\n✅ **APPROVE** - Proceed with recommended training\n❌ **REJECT** - Decline training request\n⏸️ **DEFER** - Postpone to next quarter\n\nReply to this email with your decision or contact HR for discussion.\n\nRequest ID: {{ $json.requestId }}\n\n---\nAI-Powered Training Management System",
        "options": {},
        "subject": "=Training Approval Required: {{ $json.employeeName }} - {{ $json.trainingTopic }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "d7fcf67b-d1e5-4155-98c6-3e267a8b8f1f",
      "name": "发送拒绝邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2336,
        192
      ],
      "webhookId": "3fdf4066-4a62-4208-a4eb-2e82824a7d4e",
      "parameters": {
        "sendTo": "={{ $('Jotform Trigger').item.json['Employee Email'] }}",
        "message": "=Hi {{ $('Jotform Trigger').item.json['Employee Name'].first }},\n\nYour training request has been reviewed but cannot be approved at this time.\n\n**Training Requested:** {{ $('Jotform Trigger').item.json.trainingTopic }}\n**Request ID:** {{ $('Parse Training Request').item.json.requestId }}\n\n**AI Analysis Result:**\nRecommendation: {{ $json.aiRecommendation.replace('_', ' ').toUpperCase() }}\n\n**Reason:**\n{{ $json.recommendationReasoning }}\n**Alternative Options:**\n{{ $json.alternativeResources.map((alt, i) => `${i + 1}. ${alt}`).join('\\n') }}\n\n{{ $json.alternativeOptions.map((opt, i) => `${i + 1}. ${opt.option} - ${opt.cost}`).join('\\n') }}\n\nPlease discuss with your manager or contact HR for alternatives.\n\nHR Training Team",
        "options": {},
        "subject": "=Training Request Auto-Rejected: {{ $('Jotform Trigger').item.json.trainingTopic }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8069beb1-5bc1-4361-a7d1-5f4e68c81770",
      "name": "发送员工确认",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2496,
        32
      ],
      "webhookId": "963ba631-0c4c-4678-a99f-7aec756746e0",
      "parameters": {
        "sendTo": "={{ $('Jotform Trigger').item.json['Employee Email'] }}",
        "message": "=Hi {{ $('Jotform Trigger').item.json['Employee Name'].first }},\n\nWe've received your training request and it's under review.\n\n**Request Details:**\n• Topic: {{ $('Jotform Trigger').item.json.trainingTopic }}\n• Category: {{ $('Jotform Trigger').item.json.trainingCategory }}\n• Urgency: {{ $('Jotform Trigger').item.json.urgency }}\n• Request ID: {{ $('Parse Training Request').item.json.requestId }}\n\n🤖 **AI Preliminary Analysis:**\n\n**Recommended Training:**{{ $('Merge Training Analysis').item.json.topRecommendedCourse }}\n\n• Provider: {{ $('Merge Training Analysis').item.json.topCourseProvider }}\n• Duration: {{ $('Merge Training Analysis').item.json.topCourseDuration }}\n• Cost: ${{ $('Merge Training Analysis').item.json.topCourseCost }}\n• Match Score: {{ $('Merge Training Analysis').item.json.courseMatchScore }}%\n\n**Why This Course Fits:**\n{{ $('Merge Training Analysis').item.json.courseReasoning }}\n\n**Expected Outcom\n\n**Skill Development Path:**\n{{ $('Merge Training Analysis').item.json.skillPath }}\nEstimated Timeframe: {{ $('Merge Training Analysis').item.json.estimatedTimeframe }}\n\n\n\nQuestions? Contact training@company.com\n\nHR Training Team\n\n---\nAI-Powered Training System",
        "options": {},
        "subject": "=Training Request Received: {{ $('Jotform Trigger').item.json.trainingTopic }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "PIMDNhXNj8Zyiz3G",
          "name": "Gmail account - Deepanshi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b16541ba-fbd7-4588-a96f-f0d97c08af78",
      "name": "记录到Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2720,
        32
      ],
      "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": "8b95bf15-1249-42b8-aa53-693818899488",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "📩 **触发器**"
      },
      "typeVersion": 1
    },
    {
      "id": "8da00a85-b44f-4454-ae6a-02f6aef216e8",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "🧾 **解析**"
      },
      "typeVersion": 1
    },
    {
      "id": "cb7fa984-c720-4471-87ab-76045dbc9bc7",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "💰 **预算检查**"
      },
      "typeVersion": 1
    },
    {
      "id": "913df66f-a72d-458f-a691-8c342f03b2ea",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "🤖 **AI 分析**"
      },
      "typeVersion": 1
    },
    {
      "id": "7480bc0c-023a-45a2-996e-9d1a807f1877",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "🔗 **提取**"
      },
      "typeVersion": 1
    },
    {
      "id": "ca8ec47d-82ca-4966-a956-9ec822c41725",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1712,
        -272
      ],
      "parameters": {
        "height": 240,
        "content": "🧩 **合并**"
      },
      "typeVersion": 1
    },
    {
      "id": "217b46bc-5540-4a70-88cd-220cee1db83d",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "✅ **审批路由**"
      },
      "typeVersion": 1
    },
    {
      "id": "9d253c9a-927c-49d6-be92-247956293121",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2208,
        -160
      ],
      "parameters": {
        "width": 416,
        "height": 512,
        "content": "📧 **通知**"
      },
      "typeVersion": 1
    },
    {
      "id": "8bc5f928-08bc-4c1d-9d63-1adc186a79eb",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        -128
      ],
      "parameters": {
        "height": 240,
        "content": "📊 **日志记录**"
      },
      "typeVersion": 1
    },
    {
      "id": "bd9f4e47-74d5-4200-8b8f-00cf4d807e62",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1200,
        192
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "8IkhtT3EbXygnvcr",
          "name": "Klinsman OpenAI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "adf39cf1-4c03-4516-be90-d0db7d774019",
      "name": "Jotform 触发器",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        432,
        0
      ],
      "webhookId": "training-request",
      "parameters": {
        "form": "252852702090453"
      },
      "credentials": {
        "jotFormApi": {
          "id": "W7O1b225FpOwkwDT",
          "name": "JotForm account-Deepanshi"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Jotform Trigger": [
      {
        "Manager": "me",
        "urgency": "normal",
        "Position": "manager",
        "skillGap": "very much",
        "Department": "IT",
        "employee Id": "223",
        "Employee Name": {
          "last": "Singhal",
          "first": "Deepanshi"
        },
        "Manager Email": "Deep@gmail.com",
        "projectImpact": "yes",
        "trainingTopic": "sql",
        "Employee Email": "deepashirig@gmail.com",
        "preferredDates": "2025-11-10",
        "additionalNotes": "",
        "estimatedBudget": "100000",
        "preferredFormat": "in person",
        "trainingCategory": "it",
        "currentSkillLevel": "beginner",
        "desiredSkillLevel": "advanced",
        "numberOfAttendees": "50",
        "businessJustification": "yes"
      }
    ]
  },
  "connections": {
    "Jotform Trigger": {
      "main": [
        [
          {
            "node": "Parse Training Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Training Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Requires Approval?": {
      "main": [
        [
          {
            "node": "Send Manager Approval",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Rejection Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract AI Analysis": {
      "main": [
        [
          {
            "node": "Merge Training Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Training Analysis": {
      "main": [
        [
          {
            "node": "Extract AI Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Rejection Email": {
      "main": [
        [
          {
            "node": "Send Employee Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Training Budget": {
      "main": [
        [
          {
            "node": "AI Training Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Manager Approval": {
      "main": [
        [
          {
            "node": "Send Employee Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Training Request": {
      "main": [
        [
          {
            "node": "Check Training Budget",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Training Analysis": {
      "main": [
        [
          {
            "node": "Requires Approval?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Employee Confirmation": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量21
分类-
节点类型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 查看

分享此工作流