8
n8n 中文网amn8n.com

使用 GPT-4o-mini 生成每日 Pipedrive 交易摘要

中级

这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 14 个节点。主要使用 Set, Code, Aggregate, Pipedrive, Summarize 等节点。 使用 GPT-4o-mini 生成每日 Pipedrive 交易摘要

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "165f2d3a-d197-4112-91ed-b8397cc6194d",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -416,
        1952
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d6630b97-9d30-4dd1-a6e4-c547499bd2b6",
      "name": "获取多个交易",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        -192,
        2480
      ],
      "parameters": {
        "filters": {},
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "pipedriveApi": {
          "id": "Tk6DUhlSCIuPlg0c",
          "name": "Pipedrive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3487ab2c-d87a-499a-9cd7-860100ad31fb",
      "name": "获取多条笔记",
      "type": "n8n-nodes-base.pipedrive",
      "position": [
        240,
        1920
      ],
      "parameters": {
        "resource": "note",
        "operation": "getAll",
        "returnAll": true,
        "additionalFields": {
          "deal_id": "={{ $json.id }}"
        }
      },
      "credentials": {
        "pipedriveApi": {
          "id": "Tk6DUhlSCIuPlg0c",
          "name": "Pipedrive account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "2620c098-2507-4884-9392-905ece30ecab",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        48,
        1952
      ],
      "parameters": {
        "jsCode": "// Code node: Rename stage_id numbers to names\n// Input: items with item.json.stage_id\n// Output: item.json.stage_name (string)\n\nconst stageMap = {\n  1: \"Prospecting\",\n  2: \"Qualified\",\n  3: \"Proposal Sent\",\n  4: \"Negotiation\",\n  5: \"Closed Won\"\n};\n\nreturn items.map(item => {\n  const stageId = item.json.stage_id;\n  item.json.stage_name = stageMap[stageId] || `Unknown (${stageId})`;\n  return item;\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e5925254-2fa0-4c4e-96ad-44a4f7afc2c9",
      "name": "OpenAI 聊天模型3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1104,
        2416
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f57e1044-3d56-438a-957e-d09de9c48f1e",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        1760
      ],
      "parameters": {
        "width": 400,
        "height": 912,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5a4cc9ef-73a0-4137-bfa8-be951faddf98",
      "name": "便签56",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        1760
      ],
      "parameters": {
        "color": 7,
        "width": 1984,
        "height": 912,
        "content": "# 📊 Pipedrive 交易每日摘要 (n8n + OpenAI)"
      },
      "typeVersion": 1
    },
    {
      "id": "4c55d8b2-a416-4c2b-b4f4-2505ac3a1d75",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        2080
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 544,
        "content": "### 2️⃣ 连接 Pipedrive"
      },
      "typeVersion": 1
    },
    {
      "id": "48b1c9e1-576b-475a-8f64-d237fdb5bc12",
      "name": "便利贴11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        2256
      ],
      "parameters": {
        "color": 3,
        "width": 288,
        "height": 304,
        "content": "### 1️⃣ 设置 OpenAI 连接"
      },
      "typeVersion": 1
    },
    {
      "id": "ce5d2198-e82a-4cec-9367-874798dbee30",
      "name": "合并笔记",
      "type": "n8n-nodes-base.summarize",
      "position": [
        336,
        2304
      ],
      "parameters": {
        "options": {},
        "fieldsToSplitBy": "deal_id",
        "fieldsToSummarize": {
          "values": [
            {
              "field": "content",
              "separateBy": "=,",
              "aggregation": "concatenate"
            },
            {
              "field": "deal.title",
              "aggregation": "max"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "477886ba-3c21-4b1c-badd-c802f63bbcd4",
      "name": "设置字段名称",
      "type": "n8n-nodes-base.set",
      "position": [
        528,
        2144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1d2af38f-855d-435a-b70c-24cf560d103f",
              "name": "stage_name",
              "type": "string",
              "value": "={{ $('Code').item.json.stage_name }}"
            },
            {
              "id": "eb58ba6e-4722-4cc5-be7c-031a823a3488",
              "name": "deal.title",
              "type": "string",
              "value": "={{ $json.max_deal_title }}"
            },
            {
              "id": "d4fe6419-7954-450d-87ab-788149086bd5",
              "name": "content",
              "type": "string",
              "value": "={{ $json.concatenated_content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1bde07e2-8487-4589-9b96-6b10fc19612a",
      "name": "为代理汇总",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        688,
        2032
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "63f75533-fb6e-47eb-82e0-34ed04e2dd58",
      "name": "将对象转换为文本",
      "type": "n8n-nodes-base.set",
      "position": [
        896,
        1968
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "9578adb8-b0e3-4629-a375-8ac9585022f2",
              "name": "data",
              "type": "string",
              "value": "={{ $json.data }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5c9c8df3-4038-4aa6-8555-aa52abfe0572",
      "name": "汇总 Pipedrive",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1152,
        1936
      ],
      "parameters": {
        "text": "=Deals: {{ $json.data }}",
        "options": {
          "systemMessage": "You are a helpful assistant. Do a daily summary of the deals in our pipedrive funnel. "
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Get many notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Notes": {
      "main": [
        [
          {
            "node": "Set Field Names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many deals": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many notes": {
      "main": [
        [
          {
            "node": "Combine Notes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Field Names": {
      "main": [
        [
          {
            "node": "Aggregate for Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Pipedrive",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate for Agent": {
      "main": [
        [
          {
            "node": "Turn Objects to Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Turn Objects to Text": {
      "main": [
        [
          {
            "node": "Summarize Pipedrive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get many deals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - AI 摘要总结, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
中级
节点数量14
分类2
节点类型9
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部链接
在 n8n.io 查看

分享此工作流