8
n8n 中文网amn8n.com

使用 OpenRouter GPT-5 和邮件自动化职位机会摘要

高级

这是一个自动化工作流,包含 18 个节点。主要使用 Code, Html, Merge, Filter, EmailSend 等节点。 通过 OpenRouter GPT-5 和邮件实现职位机会摘要的自动化

前置要求
  • 可能需要目标 API 的认证凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "42450f423595f391b7c323eb4191c0bc81df9f6de5483a12f34f76cb4146556c",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "dc1dcca4-8789-4403-841a-690878eb0a53",
      "name": "每条帖子",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        576,
        -96
      ],
      "parameters": {
        "url": "={{ $json[\"jobLink\"] }}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 10,
              "batchInterval": 5000
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3b059cf0-931e-4ce1-8354-11382920d3d0",
      "name": "提取标题和描述",
      "type": "n8n-nodes-base.html",
      "position": [
        864,
        -240
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "jobDescription",
              "attribute": "content",
              "cssSelector": "meta[property=\"og:description\"]",
              "returnValue": "attribute"
            },
            {
              "key": "jobTitle",
              "attribute": "content",
              "cssSelector": "meta[property=\"og:title\"]",
              "returnValue": "attribute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6b041491-47c6-4194-98ab-c410631b16e7",
      "name": "最近7天",
      "type": "n8n-nodes-base.filter",
      "position": [
        352,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "551c6c94-a861-47b7-8850-32fadf883736",
              "operator": {
                "type": "dateTime",
                "operation": "after"
              },
              "leftValue": "={{ $json.date }}",
              "rightValue": "={{$now.minus({days: 7})}} "
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "16422542-708f-4af7-8ecc-b0633fa55beb",
      "name": "获取列表页",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -320,
        32
      ],
      "parameters": {
        "url": "https://community.n8n.io/c/jobs/13",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "971564de-3d6b-4f55-bfd8-4c4c80635885",
      "name": "提取帖子",
      "type": "n8n-nodes-base.html",
      "position": [
        -96,
        32
      ],
      "parameters": {
        "options": {},
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "jobLink",
              "attribute": "href",
              "cssSelector": ".raw-link",
              "returnArray": true,
              "returnValue": "attribute"
            },
            {
              "key": "date",
              "cssSelector": ".topic-list-item td:last-child",
              "returnArray": true
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d69d273d-f319-4473-8322-846bdd6c85b7",
      "name": "合并对象",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        32
      ],
      "parameters": {
        "jsCode": "// Input data from previous node is available in items array\nconst jobLinks = items[0].json[\"jobLink\"];\nconst dates = items[0].json.date;\n\n// Create new array of merged objects\nconst merged = jobLinks.map((link, index) => ({\n  \"jobLink\": link,\n  \"date\": dates[index],\n  \"source\": \"n8n-forum\"\n}));\n\n// Return the merged data\nreturn merged.map(item => ({ json: item }));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1237545b-bc8f-4e40-a1f9-be7715d88a1a",
      "name": "多表:您可以连接多个表以实现有组织的数据结构",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        944,
        288
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"summary\": \"What the client is looking to build\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "86eb1d6b-5fe5-4468-995c-6890286d6432",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        816,
        288
      ],
      "parameters": {
        "model": "openai/gpt-5-mini",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "aCsTDT5LGS5D8Ndl",
          "name": "OpenRouter account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d3bbfe52-65a6-489c-9cba-bd6cf79f0bf2",
      "name": "生成职位摘要",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        800,
        64
      ],
      "parameters": {
        "text": "=<content> {{ $('Each post').item.json.data }} </content>",
        "messages": {
          "messageValues": [
            {
              "message": "=<prompt>\n    <purpose>\n        Based on this HTML your task is to provide a summary of what the client is looking to build with the automation software n8n\n    </purpose>\n\n    <instructions>\n        <instruction>Output in json format</instruction>\n        <instruction>Give a high level summary of what the client wants to build</instruction>\n        <instruction>Make sure to only distill the relevant text from all the HTML input</instruction>\n    </instructions>\n</prompt>"
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "executeOnce": false,
      "typeVersion": 1.5
    },
    {
      "id": "f4ff7c72-e1e9-4473-9a4a-a9e48f464bd1",
      "name": "合并职位数据与摘要",
      "type": "n8n-nodes-base.merge",
      "position": [
        1152,
        48
      ],
      "parameters": {
        "mode": "combine",
        "options": {
          "includeUnpaired": false
        },
        "combineBy": "combineByPosition",
        "numberInputs": 3
      },
      "typeVersion": 3
    },
    {
      "id": "84d23d82-e136-4465-8966-4fdbf107dded",
      "name": "格式化摘要输出",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        64
      ],
      "parameters": {
        "jsCode": "return $input.all().map((item) => ({...item.json, summary:item.json.output.summary, output: undefined}))\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d61c6515-a368-4ee5-bd4d-5508f2b5ff51",
      "name": "汇总所有职位",
      "type": "n8n-nodes-base.code",
      "position": [
        1600,
        64
      ],
      "parameters": {
        "jsCode": "const items = $input.all().map((item) => {\n    const itemJson = item.json;\n    return {\n        ...itemJson\n    }\n})\n\nreturn {data: items}\n"
      },
      "typeVersion": 2
    },
    {
      "id": "2e493107-b36c-4908-b37e-9fe43133e3fd",
      "name": "发送每周职位摘要",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1824,
        64
      ],
      "webhookId": "d53405e8-9964-43c2-8fe4-38eeebf65d34",
      "parameters": {
        "html": "={{(() => {\n  const grouped = $json.data.sort((a,b) => new Date(b.date.replace(/\\s/, 'T')) - new Date(a.date.replace(/\\s/, 'T'))).reduce((acc, job) => {\n    const source = job.source === 'n8n-forum' ? 'n8n-forum' : \n                  job.source === 'make-forum' ? 'make-forum' : \n                  'reddit';\n    if (!acc[source]) acc[source] = [];\n    acc[source].push(job);\n    return acc;\n  }, {});\n  \n  return Object.entries(grouped).reduce((html, [source, jobs]) => \n    html + '<div class=\"section\"><h2>' + \n    (source === 'n8n-forum' ? 'n8n Forum Jobs' : \n     source === 'make-forum' ? 'Make Forum Jobs' : \n     'Reddit Jobs') + '</h2>' +\n    jobs.map(job => \n      '<div class=\"job-item\"><h3><a href=\"' + job.jobLink + '\">' + \n      job.jobTitle + '</a></h3><div class=\"date\">Posted: ' + \n      job.date + '</div><div class=\"source\">Source: ' + \n      (job.source === 'n8n-forum' ? 'n8n Forum' : \n       job.source === 'make-forum' ? 'Make Forum' : \n       'Reddit - ' + job.origin) + '</div><p class=\"summary\">' + \n      job.summary + '</p></div>'\n    ).join('') + '</div>',\n    '<!DOCTYPE html><html><head><style>body{font-family:Arial,sans-serif;line-height:1.6;color:#333;max-width:800px;margin:0 auto;padding:20px}.section{margin-bottom:30px}.job-item{border:1px solid #ddd;margin-bottom:20px;padding:15px;border-radius:5px}h2{color:#2c5282;border-bottom:2px solid #2c5282;padding-bottom:10px;margin-top:30px}h3{color:#2c5282;margin:0 0 10px}a{color:#2b6cb0;text-decoration:none}a:hover{text-decoration:underline}.date,.source{color:#666;font-size:0.9em;margin-bottom:8px}.summary{background:#f8f9fa;padding:10px;border-left:4px solid #4299e1;margin:10px 0}</style></head><body><h1>Latest Job Opportunities</h1><p>Generated on: ' + new Date().toLocaleString() + '</p>'\n  ) + '</body></html>';\n})()}}\n",
        "options": {},
        "subject": "Job Opportunities",
        "toEmail": "test@example.com",
        "fromEmail": "test@example.com"
      },
      "credentials": {
        "smtp": {
          "id": "JN7BvujMXvFvoUMh",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "250a3bdf-9a6c-4c86-a837-1ba70c6c0161",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -240
      ],
      "parameters": {
        "width": 320,
        "height": 224,
        "content": "## 🎯 工作流开始"
      },
      "typeVersion": 1
    },
    {
      "id": "caf3a804-e37d-4286-abb8-018933fd10b4",
      "name": "每周一早上运行",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -544,
        32
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4b548276-a148-4678-820f-9eef6743f5ed",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -240
      ],
      "parameters": {
        "width": 256,
        "height": 208,
        "content": "## ⏱️ 日期筛选"
      },
      "typeVersion": 1
    },
    {
      "id": "d3a054f0-121d-4120-b485-271e3119d5b3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        432
      ],
      "parameters": {
        "width": 320,
        "height": 176,
        "content": "## 🤖 AI提取"
      },
      "typeVersion": 1
    },
    {
      "id": "2d894203-70de-4283-86cd-fb4c50afa800",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        -176
      ],
      "parameters": {
        "width": 256,
        "height": 176,
        "content": "## 📧 邮件格式化"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Each post": {
      "main": [
        [
          {
            "node": "Extract title & description",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Job Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Last 7 days": {
      "main": [
        [
          {
            "node": "Combine Job Data & Summary",
            "type": "main",
            "index": 1
          },
          {
            "node": "Each post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract posts": {
      "main": [
        [
          {
            "node": "Merge objects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get list page": {
      "main": [
        [
          {
            "node": "Extract posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge objects": {
      "main": [
        [
          {
            "node": "Last 7 days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Jobs": {
      "main": [
        [
          {
            "node": "Send Weekly Job Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Job Summary": {
      "main": [
        [
          {
            "node": "Combine Job Data & Summary",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Format Summary Output": {
      "main": [
        [
          {
            "node": "Aggregate All Jobs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Job Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Job Summary",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Combine Job Data & Summary": {
      "main": [
        [
          {
            "node": "Format Summary Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract title & description": {
      "main": [
        [
          {
            "node": "Combine Job Data & Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Weekly on Monday Morning": {
      "main": [
        [
          {
            "node": "Get list page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

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

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

作者
Julian Kaiser

Julian Kaiser

@jksr

Full Stack Developer turned AI & Automation Engineer, implementing intelligent solutions with custom code, LLMs & n8n. Use my link to book a free 30-minute call to discuss your AI challenges and see if my services might be a good fit for your needs.

外部链接
在 n8n.io 查看

分享此工作流