8
n8n 中文网amn8n.com

使用 Azure OpenAI 和 Google Workspace 自动化 DEI 资格筛选

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 19 个节点。主要使用 If, Code, Gmail, GoogleDrive, GoogleSheets 等节点。 使用Azure GPT-4o、Google云端硬盘和表格自动进行DEI资格筛选

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Drive API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "dFiA2ofAChCtsSKh",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Azure OpenAI 和 Google Workspace 自动化 DEI 资格筛选",
  "tags": [],
  "nodes": [
    {
      "id": "a8050a45-eb9a-44b5-bbe8-24e1fe813f48",
      "name": "Azure OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        672,
        128
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "id": "C3WzT18XqF8OdVM6",
          "name": "Azure Open AI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d419a8e2-13ba-4505-9b51-07b7dc07bf2a",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        928,
        128
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"Name\": \"Jyothi\",\n   \"Location\": \"Hyderabad\",\n\t\"Language\": \"Telugu\",\n    \"Gender\" : \"Male\",\n    \"Disability\": \"No\",\n    \"DEI\": \"Yes\",\n    \"Factor\": \"Location\"\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "9c82394a-aed4-4d09-949d-a66290915071",
      "name": "在 Google Sheets 中获取行",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        800,
        128
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8/edit?usp=drivesdk",
          "cachedResultName": "HR Dei"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "sOplQNr4zvwQul4A",
          "name": "jyothi"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e22db6e8-3dca-4f92-964d-307cfff24927",
      "name": "简历触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        0,
        -96
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1KyX5RGqeF7v0sAvvaoBnJPTQoq4aOHLz",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1KyX5RGqeF7v0sAvvaoBnJPTQoq4aOHLz",
          "cachedResultName": "HR auto"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "gPmEPTuQP4KLm1KD",
          "name": "jyothi"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2207292d-6455-478d-bcdd-1314066738ea",
      "name": "下载简历",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        224,
        -96
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $json.webViewLink }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "gPmEPTuQP4KLm1KD",
          "name": "jyothi"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2d54c6ad-d960-4a5b-971d-853bdddbde47",
      "name": "从 PDF 提取内容",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        448,
        -96
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "ccdb0c73-5757-45f2-84a6-8b22f743786a",
      "name": "检查 DEI 资格",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        736,
        -96
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=You are an HR analytics assistant that processes candidate resumes and questionnaires and evaluates DEI hire eligibility using organization-defined balance rules. You must never infer protected attributes; only use self-reported data and Google Sheets records. Return strict, valid JSON exactly as specified. If data is missing or uncertain, use null and include conservative confidence scores.\n\nMandatory tooling\n • You MUST use the Google Sheets tool to read current representation of already hired employees before making any DEI eligibility decision.\nstate/country to location_bucket)\n\nObjectives\n • Extract structured proxies from the candidate: gender (self-reported only), location (city/state/country), language(s) (self-reported only), disability (self-reported only)\n• Determine DEI eligibility by comparing candidate’s categories against current workforce representation from the google sheet.\n\nOutput should be:\n- Name (self-reported)\n- gender (self-reported only)\n- location (city/state/country)\n- language (self-reported only)\n- disability (self-reported only)\n- DEI Eligible (Yes/No), If Yes in which factor.\n- Factor\n\nYOu will check the current employees and against this candidate and come to a conslucion whether or not this person is being underpresented in the firm in any factor  "
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "c61ef3a2-4ef5-4a2b-a4a9-07c5db11a212",
      "name": "在表格中更新",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1136,
        -96
      ],
      "parameters": {
        "columns": {
          "value": {
            "DEI": "={{ $json.output.DEI }}",
            "Name": "={{ $json.output.Name }}",
            "Factor": "={{ $json.output.Factor }}",
            "Gender": "={{ $json.output.Gender }}",
            "Language": "={{ $json.output.Language }}",
            "Location": "={{ $json.output.Location }}",
            "Disability": "={{ $json.output.Disability }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Location",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Location",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Gender",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Gender",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Disability",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Disability",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Language",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Language",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "DEI",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "DEI",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Factor",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Factor",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1P8uforIuBJCkX0i9dl5BgUmzi4Nk63EHyFKLyeQvxT8/edit?usp=drivesdk",
          "cachedResultName": "HR Dei"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "sOplQNr4zvwQul4A",
          "name": "jyothi"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "9ebadf68-ba24-4889-9bcc-e74e39f3aab2",
      "name": "逻辑判断",
      "type": "n8n-nodes-base.if",
      "position": [
        1360,
        -96
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "32ffb27d-1706-4aa8-b64c-9f661a38af22",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.DEI }}",
              "rightValue": "Yes"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ac244e53-235e-425e-bae4-5e9d91aec305",
      "name": "创建邮件",
      "type": "n8n-nodes-base.code",
      "position": [
        1584,
        -96
      ],
      "parameters": {
        "jsCode": "// n8n Code node: build HTML email for DEI eligibility notification\n\n// Input data (replace with values from previous nodes or item fields)\nconst name = $json.Name || \"Candidate\";\nconst location = $json.Location || null;\nconst languages = $json.Language || null; // comma-delimited string\nconst gender = $json.Gender || null;\nconst disability = $json.Disability || null;\nconst deiEligible = ($json.DEI || \"No\").toLowerCase() === \"yes\";\nconst factor = $json.Factor || null;\n\n// Email metadata (adjust as needed or set in Gmail node)\nconst subject = `DEI Eligibility — ${name}`;\nconst preheader = `Candidate ${name} is ${deiEligible ? \"eligible\" : \"not eligible\"} for DEI hire${factor ? ` via ${factor}` : \"\"}.`;\n\n// Build a safe text summary\nconst textSummaryParts = [\n  `Candidate: ${name}`,\n  `DEI Eligibility: ${deiEligible ? \"Yes\" : \"No\"}`,\n];\nif (factor) textSummaryParts.push(`Factor: ${factor}`);\nif (location) textSummaryParts.push(`Location: ${location}`);\nif (languages) textSummaryParts.push(`Language(s): ${languages}`);\ntextSummaryParts.push(`Gender: ${gender ?? \"null\"}`);\ntextSummaryParts.push(`Disability: ${disability ?? \"null\"}`);\nconst textBody = textSummaryParts.join(\"\\n\");\n\n// Basic inline styles for email clients\nconst styles = {\n  container: \"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; color:#111; background:#ffffff; margin:0; padding:0;\",\n  wrapper: \"max-width:640px; margin:0 auto; padding:24px;\",\n  card: \"border:1px solid #e5e7eb; border-radius:12px; padding:20px;\",\n  h1: \"font-size:20px; margin:0 0 12px; color:#111;\",\n  p: \"margin:0 0 12px; line-height:1.5; color:#374151;\",\n  badgeYes: \"display:inline-block; background:#065f46; color:#ffffff; font-weight:600; font-size:12px; padding:6px 10px; border-radius:999px;\",\n  badgeNo: \"display:inline-block; background:#7f1d1d; color:#ffffff; font-weight:600; font-size:12px; padding:6px 10px; border-radius:999px;\",\n  table: \"width:100%; border-collapse:collapse; margin-top:12px;\",\n  th: \"text-align:left; font-size:12px; color:#6b7280; padding:6px 0;\",\n  td: \"font-size:14px; color:#111; padding:6px 0;\",\n  footer: \"margin-top:16px; font-size:12px; color:#6b7280;\",\n  divider: \"height:1px; background:#e5e7eb; border:none; margin:16px 0;\"\n};\n\n// Build HTML email\nconst html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n  <title>${subject}</title>\n  <meta name=\"color-scheme\" content=\"light only\" />\n  <meta name=\"supported-color-schemes\" content=\"light\" />\n  <!-- Preheader text -->\n  <span style=\"display:none !important; visibility:hidden; opacity:0; color:transparent; height:0; width:0; overflow:hidden;\">${preheader}</span>\n</head>\n<body style=\"${styles.container}\">\n  <div style=\"${styles.wrapper}\">\n    <div style=\"${styles.card}\">\n      <h1 style=\"${styles.h1}\">DEI Eligibility Review</h1>\n      <p style=\"${styles.p}\">\n        Candidate <strong>${name}</strong> has been evaluated for DEI eligibility.\n      </p>\n      <p style=\"${styles.p}\">\n        Status:\n        <span style=\"${deiEligible ? styles.badgeYes : styles.badgeNo}\">\n          ${deiEligible ? \"DEI Eligible\" : \"Not DEI Eligible\"}\n        </span>\n      </p>\n      ${factor ? `<p style=\"${styles.p}\">Primary eligibility factor: <strong>${factor}</strong>.</p>` : \"\"}\n\n      <hr style=\"${styles.divider}\" />\n\n      <table role=\"presentation\" style=\"${styles.table}\">\n        <tbody>\n          <tr>\n            <th style=\"${styles.th}\">Name</th>\n            <td style=\"${styles.td}\">${name}</td>\n          </tr>\n          <tr>\n            <th style=\"${styles.th}\">Location</th>\n            <td style=\"${styles.td}\">${location ?? \"—\"}</td>\n          </tr>\n          <tr>\n            <th style=\"${styles.th}\">Language(s)</th>\n            <td style=\"${styles.td}\">${languages ?? \"—\"}</td>\n          </tr>\n          <tr>\n            <th style=\"${styles.th}\">Gender</th>\n            <td style=\"${styles.td}\">${gender ?? \"null\"}</td>\n          </tr>\n          <tr>\n            <th style=\"${styles.th}\">Disability</th>\n            <td style=\"${styles.td}\">${disability ?? \"null\"}</td>\n          </tr>\n          <tr>\n            <th style=\"${styles.th}\">DEI Eligible</th>\n            <td style=\"${styles.td}\">${deiEligible ? \"Yes\" : \"No\"}</td>\n          </tr>\n          ${factor ? `\n          <tr>\n            <th style=\"${styles.th}\">Factor</th>\n            <td style=\"${styles.td}\">${factor}</td>\n          </tr>` : \"\"}\n        </tbody>\n      </table>\n\n      <p style=\"${styles.footer}\">\n        This notification is generated automatically from the latest evaluation records.\n      </p>\n    </div>\n  </div>\n</body>\n</html>\n`;\n\n// Return for downstream Gmail node (use fields: subject, html, text)\nreturn [\n  {\n    json: {\n      subject,\n      html,\n      text: textBody\n      // Optionally include \"to\" and \"from\" here or set them in the Gmail node configuration.\n      // to: \"manager@company.com\",\n      // from: \"automations@techdome.ai\"\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "9ae3966c-09cb-4e5d-9a9a-94ed01b52229",
      "name": "发送邮件给经理",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1808,
        -96
      ],
      "webhookId": "1b8b6079-b721-4612-b513-cddb5ecfa677",
      "parameters": {
        "sendTo": "jyothi.swarup@techdome.net.in",
        "message": "={{ $json.html }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "70f5n8rPahCANHs7",
          "name": "jyothi"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3627dee6-a28a-410f-8a57-23d94b7a5869",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -112
      ],
      "parameters": {
        "content": "## 简历触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "6cc70516-452d-4ace-b42a-0a9eaa97f53e",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -288
      ],
      "parameters": {
        "content": "## 下载简历"
      },
      "typeVersion": 1
    },
    {
      "id": "c3c3ebeb-be02-4d71-a4ca-5844a1c1baa8",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        96
      ],
      "parameters": {
        "content": "## 从 PDF 提取内容"
      },
      "typeVersion": 1
    },
    {
      "id": "4bdbcfdf-565a-4f21-bb12-03010a41267b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        -288
      ],
      "parameters": {
        "content": "## Azure OpenAI 聊天模型"
      },
      "typeVersion": 1
    },
    {
      "id": "458dbccb-2ba7-4123-a489-c0a576e377bd",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        96
      ],
      "parameters": {
        "content": "## 在表格中更新"
      },
      "typeVersion": 1
    },
    {
      "id": "c6d4c2c5-a84f-4423-b163-c2fe27641b86",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        96
      ],
      "parameters": {
        "content": "## 创建邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "408efdea-b86a-442b-9b5f-7f16e1a7892c",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        -304
      ],
      "parameters": {
        "content": "## 发送邮件给经理"
      },
      "typeVersion": 1
    },
    {
      "id": "770d70e4-6035-4551-8746-f1db3a367b56",
      "name": "## 试试看!",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -288
      ],
      "parameters": {
        "content": "## 逻辑判断"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c99e6cbc-64e8-488b-93e9-7e3b09131955",
  "connections": {
    "Logic": {
      "main": [
        [
          {
            "node": "Create Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CV Trigger": {
      "main": [
        [
          {
            "node": "Download CV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download CV": {
      "main": [
        [
          {
            "node": "Extract from PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Email": {
      "main": [
        [
          {
            "node": "Email to Manager",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update on Sheet": {
      "main": [
        [
          {
            "node": "Logic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from PDF": {
      "main": [
        [
          {
            "node": "Check for DEI Eligibility",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Check for DEI Eligibility",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Check for DEI Eligibility",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check for DEI Eligibility": {
      "main": [
        [
          {
            "node": "Update on Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "Check for DEI Eligibility",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量19
分类2
节点类型12
难度说明

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

作者
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

外部链接
在 n8n.io 查看

分享此工作流