8
n8n 中文网amn8n.com

用于更智能BRD(业务需求文档)编写的多Agent RAG系统

高级

这是一个AI RAG, Multimodal AI领域的自动化工作流,包含 37 个节点。主要使用 Set, Code, Merge, Filter, SendGrid 等节点。 使用多Agent GPT和Google Workspace生成业务需求文档

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "SSNPPZY3Fe7YACQ8",
  "meta": {
    "instanceId": "4a2e6764ba7a6bc9890d9225f4b21d570ce88fc9bd57549c89057fcee58fed0f",
    "templateId": "5453",
    "templateCredsSetupCompleted": true
  },
  "name": "用于更智能 BRD(业务需求文档)编写的多 Agent RAG 系统",
  "tags": [
    {
      "id": "pg2i0mqcvGPoanrU",
      "name": "Sales Workflow",
      "createdAt": "2025-08-02T06:00:12.615Z",
      "updatedAt": "2025-08-02T06:00:12.615Z"
    }
  ],
  "nodes": [
    {
      "id": "38a513fb-1f3d-4d66-9cbe-03e49a769478",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -1312,
        1408
      ],
      "webhookId": "14d1da84-e103-4cb4-bbc1-e50f6403f649",
      "parameters": {
        "options": {},
        "formTitle": "Business Requirements Document Request Form",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Project ID",
              "placeholder": "Project Identification String",
              "requiredField": true
            },
            {
              "fieldLabel": "Project Title",
              "placeholder": "Short, descriptive title for the project",
              "requiredField": true
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Business Domain",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Education"
                  },
                  {
                    "option": "E-commerce"
                  },
                  {
                    "option": "Healthcare"
                  },
                  {
                    "option": "Finance & Banking"
                  },
                  {
                    "option": "Manufacturing"
                  },
                  {
                    "option": "Logistics"
                  },
                  {
                    "option": "Real Estate"
                  },
                  {
                    "option": "Retail"
                  },
                  {
                    "option": "Travel & Hospitality"
                  },
                  {
                    "option": "Government"
                  },
                  {
                    "option": "Energy"
                  },
                  {
                    "option": "Media & Entertainment"
                  },
                  {
                    "option": "IT & Software"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "file",
              "fieldLabel": "Supporting Documents",
              "requiredField": true,
              "acceptFileTypes": ".pdf"
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Notes",
              "placeholder": "Any quick context or remarks for the BRD team",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Email",
              "placeholder": "Email to receive draft BRD",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Please provide your basic contact details, project overview, and upload all relevant documents containing the background, objectives, scope, constraints, and any other supporting information."
      },
      "typeVersion": 2.2
    },
    {
      "id": "97aee54a-088d-4c7d-aacc-fbd8f46661f5",
      "name": "从文件提取",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -720,
        1648
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "03f021f5-5e64-4b9f-a2fa-282df5c0608d",
      "name": "处理多个文件",
      "type": "n8n-nodes-base.code",
      "position": [
        -1088,
        1488
      ],
      "parameters": {
        "jsCode": "const data = $input.item.json;\nconst binaryData = $input.item.binary;\n\nlet output = [];\n\nObject.keys(binaryData)\n  .filter(label => label.startsWith(\"Supporting_Documents\"))\n  .forEach(label => {\n    output.push({\n      json: data,\n      binary: { data: binaryData[label] }\n    });\n  });\n\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "bed0865e-07b6-44b4-b6a1-5e104355622c",
      "name": "创建 BRD 请求记录",
      "type": "n8n-nodes-base.code",
      "position": [
        -1088,
        1152
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const requestForm = $('On form submission').first().json;\n\nreturn {\n      ProjectID: requestForm[\"Project ID\"],\n      ProjectTitle: requestForm[\"Project Title\"],\n      BusinessDomain: requestForm[\"Business Domain\"],\n      Notes: requestForm[\"Notes\"],\n      Email: requestForm[\"Email\"],\n      Status: 'Submitted',\n      SubmittedAt: requestForm[\"submittedAt\"]\n    }"
      },
      "typeVersion": 2
    },
    {
      "id": "0dbfe2d6-2bb9-4125-b91b-94c565dc3c7c",
      "name": "插入数据到存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -336,
        1648
      ],
      "parameters": {
        "mode": "insert",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "vector_store_key",
          "cachedResultName": "vector_store_key"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9ab3ac6a-8977-44ca-8733-41024de1c729",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -176,
        1872
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "45685132-63e3-498e-b80a-b7af32bbb367",
      "name": "查询数据工具",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -736,
        2064
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "knowledge_base",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "vector_store_key"
        },
        "toolDescription": "Use this knowledge base to answer questions from the user"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d08dbc8f-0b88-4e85-b8f8-e7d2c3e9cce0",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -864,
        2064
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4",
          "cachedResultName": "gpt-4"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "PPSwAKeLQYgAPobT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bc1715fa-85da-4942-9225-cb709c76069e",
      "name": "标记请求为已完成",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1408,
        2240
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "ProjectID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ProjectID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ProjectTitle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ProjectTitle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "BusinessDomain",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "BusinessDomain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SubmittedAt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "SubmittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "ProjectID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit#gid=0",
          "cachedResultName": "Requests"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit?usp=drivesdk",
          "cachedResultName": "BRD"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "L670Nly6gZGo71br",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "af657464-1132-4334-b573-51a0ad9cf220",
      "name": "创建记录以更新 Google Sheets 行",
      "type": "n8n-nodes-base.code",
      "position": [
        1184,
        2240
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const request = $('Merge content').item.json.Request;\nreturn {\n  ProjectID:request.ProjectID,\n  ProjectTitle:request.ProjectTitle,\n  BusinessDomain:request.BusinessDomain,\n  Notes:request.Notes,\n  Email:request.Email,\n  SubmittedAt:request.SubmittedAt,\n  Status:'Completed'\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "d7b864a7-a6e5-4585-a8fa-10f5910e5490",
      "name": "请求完成了吗?",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1088,
        2144
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5ea39d89-d6bb-47be-9aa8-34f6d18cacd9",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "Completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "13d8ecee-6021-494d-b7a4-2793612a8869",
      "name": "新请求已添加到跟踪表",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -1312,
        2144
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 5
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit#gid=0",
          "cachedResultName": "Requests"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit?usp=drivesdk",
          "cachedResultName": "BRD"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "CPEKrYOrl4k5u2O9",
          "name": "Google Sheets Trigger account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "38cc8837-c1d7-498d-a28f-4c70ba151286",
      "name": "归档 PDF 文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        960,
        2048
      ],
      "parameters": {
        "name": "={{ $json.name }}.pdf",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultName": "SmartSales"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "fC471es5gk5Mm900",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "26d66c13-fba4-4589-971c-8204407f01c9",
      "name": "发送 BRD 响应邮件",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        960,
        2240
      ],
      "parameters": {
        "subject": "=Business Requirements Document – {{ $('Merge content').item.json.Request.ProjectTitle }} ({{ $('Merge content').item.json.Request.ProjectID }})",
        "toEmail": "={{ $('Merge content').item.json.Request.Email }}",
        "fromName": "={{ $('Configure metadata ').item.json['Sender Name'] }}",
        "resource": "mail",
        "fromEmail": "={{ $('Configure metadata ').item.json['Sender Email'] }}",
        "contentType": "text/html",
        "contentValue": "=<!doctype html>\n<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\n  <title>BRD Delivery</title>\n  <style>\n    /* Clients ignore embedded CSS often—kept minimal. Most styles are inline. */\n    @media screen and (max-width:980px) {\n      .container {\n        width: 100% !important;\n      }\n\n      .stack {\n        display: block !important;\n        width: 100% !important;\n      }\n\n      .px-24 {\n        padding-left: 16px !important;\n        padding-right: 16px !important;\n      }\n    }\n  </style>\n</head>\n\n<body style=\"margin:0;padding:0;background:#f5f7fb;color:#0f172a;\"> <!-- Preheader (hidden in most clients) -->\n  <div style=\"display:none;max-height:0;overflow:hidden;mso-hide:all;\"> BRD for {{ $('Merge content').item.json.Request.ProjectTitle }} ({{ $('Merge content').item.json.Request.ProjectID }}) is attached\n    as PDF. Please review and share feedback. </div>\n  <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" style=\"background:#f5f7fb;\">\n    <tr>\n      <td align=\"center\" style=\"padding:24px;\">\n        <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"980\" class=\"container\"\n          style=\"width:980px;max-width:980px;background:#ffffff;border-radius:12px;overflow:hidden;border:1px solid #e5e7eb;\">\n          <!-- Header -->\n          <tr>\n            <td style=\"background:#0ea5e9;padding:20px 24px;color:#ffffff;font-family:Arial,Helvetica,sans-serif;\">\n              <div style=\"font-size:18px;font-weight:700;line-height:1.2;\">Business Requirements Document (BRD)</div>\n              <div style=\"font-size:13px;opacity:.95;margin-top:4px;\">Project: {{ $('Merge content').item.json.Request.ProjectTitle }} · ID: {{ $('Merge content').item.json.Request.ProjectID }}</div>\n            </td>\n          </tr> <!-- Greeting -->\n          <tr>\n            <td class=\"px-24\" style=\"padding:24px;font-family:Arial,Helvetica,sans-serif;color:#0f172a;\">\n              <p style=\"margin:0 0 12px 0;\">Hi requester,</p>\n              <p style=\"margin:0 0 12px 0;\"> Please find attached the <strong>Business Requirements Document\n                  (BRD)</strong> for <strong>{{ $('Merge content').item.json.Request.ProjectTitle }}</strong> ({{ $('Merge content').item.json.Request.ProjectID }}) in the <strong>{{ $('Merge content').item.json.Request.BusinessDomain }}</strong> domain. It consolidates\n                the scope, requirements, and considerations based on the materials you provided. </p>\n              <p style=\"margin:0 0 16px 0;\"> Kindly review and share any comments or requested changes. </p>\n            </td>\n          </tr> <!-- Project summary -->\n          <tr>\n            <td class=\"px-24\" style=\"padding:0 24px 8px 24px;font-family:Arial,Helvetica,sans-serif;\">\n              <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"\n                style=\"border:1px solid #e5e7eb;border-radius:8px;\">\n                <tr>\n                  <td\n                    style=\"background:#f8fafc;font-weight:bold;padding:10px 12px;font-size:13px;border-bottom:1px solid #e5e7eb;\">\n                    Project Summary</td>\n                </tr>\n                <tr>\n                  <td style=\"padding:12px;\">\n                    <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"\n                      style=\"font-size:13px;color:#0f172a;\">\n                      <tr>\n                        <td class=\"stack\" width=\"35%\" style=\"padding:6px 0;font-weight:bold;\">Project Title</td>\n                        <td class=\"stack\" style=\"padding:6px 0;\">{{ $('Merge content').item.json.Request.ProjectTitle }}</td>\n                      </tr>\n                      <tr>\n                        <td style=\"padding:6px 0;font-weight:bold;\">Project ID</td>\n                        <td style=\"padding:6px 0;\">{{ $('Merge content').item.json.Request.ProjectID }}\n                        </td>\n                      </tr>\n                      <tr>\n                        <td style=\"padding:6px 0;font-weight:bold;\">Business Domain</td>\n                        <td style=\"padding:6px 0;\">{{ $('Merge content').item.json.Request.BusinessDomain }}</td>\n                      </tr>\n                      <tr>\n                        <td style=\"padding:6px 0;font-weight:bold;\">Notes</td>\n                        <td style=\"padding:6px 0;\">{{ $('Merge content').item.json.Request.Notes }}</td>\n                      </tr>\n                    </table>\n                  </td>\n                </tr>\n              </table>\n            </td>\n          </tr> <!-- CTA buttons (optional links) -->\n          <tr>\n            <td align=\"center\" class=\"px-24\" style=\"padding:16px 24px 8px 24px;font-family:Arial,Helvetica,sans-serif;\">\n              <!-- Primary button --> <a href=\"#\" target=\"_blank\"\n                style=\"display:inline-block;background:#0ea5e9;color:#ffffff;text-decoration:none;padding:12px 18px;border-radius:8px;font-weight:bold;font-size:14px;\">\n                View in Google Docs </a> <!-- Spacing --> <span style=\"display:inline-block;width:8px;\"></span>\n              <!-- Secondary button --> <a\n                href=\"mailto:business@yourcompany.com?subject=Feedback%20on%20BRD%20{{ $('Merge content').item.json.Request.ProjectID }}\"\n                style=\"display:inline-block;background:#e2e8f0;color:#0f172a;text-decoration:none;padding:12px 18px;border-radius:8px;font-weight:bold;font-size:14px;\">\n                Send Feedback </a> </td>\n          </tr> <!-- Footer -->\n          <tr>\n            <td class=\"px-24\"\n              style=\"padding:16px 24px 24px 24px;font-family:Arial,Helvetica,sans-serif;font-size:13px;color:#334155;\">\n              <p style=\"margin:0 0 10px 0;\">Best regards,<br> <strong>{{ $('Configure metadata ').item.json['Sender Name'] }}</strong><br> <a href=\"mailto:{{ $('Configure metadata ').item.json['Sender Email'] }}\"\n                  style=\"color:#0ea5e9;text-decoration:none;\">{{ $('Configure metadata ').item.json['Sender Email'] }}</a></p>\n              <p style=\"margin:0;font-size:12px;color:#64748b;\">If you have trouble opening the attachment, use the\n                “View in Google Docs” button above.</p>\n            </td>\n          </tr>\n        </table> <!-- Tiny footer -->\n        <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"980\" class=\"container\"\n          style=\"width:980px;max-width:980px;margin-top:12px;\">\n          <tr>\n            <td align=\"center\" style=\"font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#94a3b8;\"> © {{\n              $now.format('yyyy') }} {{ $('Configure metadata ').item.json['Company Name'] }}. All rights reserved. </td>\n          </tr>\n        </table>\n      </td>\n    </tr>\n  </table>\n</body>\n\n</html>",
        "additionalFields": {
          "attachments": "data"
        }
      },
      "credentials": {
        "sendGridApi": {
          "id": "O1IzegT4JdKjrzrj",
          "name": "SendGrid account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "91bcdc30-b249-4151-ba31-4324716bdbdf",
      "name": "创建文档文件",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        2144
      ],
      "parameters": {
        "url": "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&supportsAllDrives=true",
        "body": "=--foo_bar_baz\nContent-Type: application/json; charset=UTF-8\n\n{\n  \"name\": \"{{ $('Merge content').item.json.Request.ProjectID }} {{ $('Merge content').item.json.Request.ProjectTitle }}\",\n  \"mimeType\": \"application/vnd.google-apps.document\",\n  \"parents\": [\"{{ $json['Drive Folder ID'] }}\"]\n}\n\n--foo_bar_baz\nContent-Type: text/markdown; charset=UTF-8\n\n{{ $('Merge content').item.json.mergedOutput }}\n--foo_bar_baz--",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendQuery": true,
        "contentType": "raw",
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "rawContentType": "multipart/related; boundary=foo_bar_baz",
        "queryParameters": {
          "parameters": [
            {
              "name": "uploadType",
              "value": "multipart"
            },
            {
              "name": "supportsAllDrives",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "boundary",
              "value": "foo_bar_baz"
            }
          ]
        },
        "nodeCredentialType": "googleDriveOAuth2Api"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "fC471es5gk5Mm900",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0408da60-9d11-4307-a110-2f9013d3dc41",
      "name": "配置元数据",
      "type": "n8n-nodes-base.set",
      "position": [
        288,
        2144
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1ff0b9a4-7d60-44ec-b047-e49252f1ace9",
              "name": "Drive Folder ID",
              "type": "string",
              "value": "1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI"
            },
            {
              "id": "6ec91f5c-ca46-438a-9e8d-a525f1a86f1d",
              "name": "Sender Email",
              "type": "string",
              "value": "it@example.com"
            },
            {
              "id": "11485e47-b356-40e6-9d24-5ec4e2b50860",
              "name": "Sender Name",
              "type": "string",
              "value": "R&D Department"
            },
            {
              "id": "a117354f-f90e-4a66-b983-7e7a3071d786",
              "name": "Company Name",
              "type": "string",
              "value": "Amazing Company"
            },
            {
              "id": "11f9f16d-7c23-49e7-983f-56aa974228fe",
              "name": "Document Content",
              "type": "string",
              "value": "={{ $json.mergedOutput }}"
            },
            {
              "id": "0294bc20-ef9c-4504-aff9-a370f1f89eb5",
              "name": "Project ID",
              "type": "string",
              "value": "={{ $json.Request.ProjectID }}"
            },
            {
              "id": "b1b76e83-200b-4e7d-946a-29c5a89b209e",
              "name": "Project Title",
              "type": "string",
              "value": "={{ $json.Request.ProjectTitle }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9e24e5cf-556e-4770-ba85-c15bb57cfb4b",
      "name": "将文档转换为 PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        736,
        2144
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "fC471es5gk5Mm900",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "b05813f5-f489-4427-8adf-8f2c80644c1c",
      "name": "将 BRD 记录添加到跟踪",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -720,
        1152
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "ProjectID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ProjectID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ProjectTitle",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ProjectTitle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "BusinessDomain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "BusinessDomain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "SubmittedAt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "SubmittedAt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit#gid=0",
          "cachedResultName": "Requests"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit?usp=drivesdk",
          "cachedResultName": "BRD"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "L670Nly6gZGo71br",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "52ed0931-fbc5-437d-b062-d9149b28746a",
      "name": "上传支持文件",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -720,
        1344
      ],
      "parameters": {
        "name": "=document-{{ $now.toFormat(\"yyyyLLdd-HHmmss\") }}-{{$binary.data.fileName}}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1IPcko8bzogO3W4mxhrW2Q017QA0Lc5MI",
          "cachedResultName": "SmartSales"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "fC471es5gk5Mm900",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "33aa2adb-608a-449c-be87-4a14d2162ca8",
      "name": "添加支持文档记录",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        64,
        1344
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 341243418,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit#gid=341243418",
          "cachedResultName": "Documents"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ujyhFd8Z02Valtfpi0HFrbbk_HGsGCrZ6Pp05_axkxQ/edit?usp=drivesdk",
          "cachedResultName": "BRD"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "L670Nly6gZGo71br",
          "name": "Google Sheets account 2"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2616cdd7-17f0-4134-8f69-9c753f48563d",
      "name": "创建支持文档记录",
      "type": "n8n-nodes-base.code",
      "position": [
        -256,
        1344
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "return {\n      ProjectID: $('On form submission').item.json['Project ID'],\n      DocumentId: $json.id,\n      DocumentName: $json.name,\n      URL: $json.webContentLink,\n      CreatedTime: $json.createdTime\n    }"
      },
      "typeVersion": 2
    },
    {
      "id": "08e3f9b5-99bb-4fa3-ae4a-0d4e97b71e7f",
      "name": "嵌入",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -304,
        1872
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "PPSwAKeLQYgAPobT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2cae7a1b-1afc-4e8e-b4b5-b4af4a0c911d",
      "name": "查询数据工具1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -624,
        2544
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "knowledge_base",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "vector_store_key"
        },
        "toolDescription": "Use this knowledge base to answer questions from the user"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c096c0c0-1b8e-4588-9f65-e58cd7bf2c96",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -864,
        2560
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "PPSwAKeLQYgAPobT",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3df544a3-91e9-483a-b57a-cbdee200dded",
      "name": "通用 BRD 编写 Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -848,
        1840
      ],
      "parameters": {
        "text": "=Generate a complete Business Requirements Document (BRD) for the following project:\nProject ID:  {{ $json.ProjectID }}\nProject Title:  {{ $json.ProjectTitle }}\nBusiness Domain: {{ $json.BusinessDomain }}\nAdditional Notes: {{ $json.Notes }}\n\nAll supporting details are available in the embedded documents uploaded by the requester.  \nQuery the embedded data to complete each section of the BRD according to the standard structure.",
        "options": {
          "systemMessage": "You are an expert Business Analyst specializing in creating professional, detailed Business Requirements Documents (BRDs) for software projects.\n\nYour responsibilities:\n1. Write informative BRD strictly in markdown format.\n2. Only create the BRD. Do not ask any follow-up questions or request clarification.\n3. Always follow the standard BRD structure provided below.\n4. Use the query data tool to retrieve relevant details from embedded supporting documents before writing.\n5. Keep writing clear, concise, and professional.\n6. If any required information is missing, mark it as **[Information Not Provided]**.\n7. For domain-specific requirements, include \"Industry Best Practice Recommendations\" if relevant and not covered in the provided documents.\n8. Business requirements & functional requirements are most important sections, ensure all business requirements are included\n\n**Standard BRD Structure:**\n\n# Executive Summary\n- Purpose\n- Background / Context\n- Objectives\n\n# Project Overview\n- Project Scope (In-Scope, Out-of-Scope)\n- Assumptions\n- Constraints\n- Stakeholders & Roles (table if possible)\n\n# Non-Functional Requirements\n- Performance\n- Security & Compliance\n- Usability & Accessibility\n- Availability & Reliability\n- Maintainability\n\n# Implementation Considerations\n- Technology Stack\n- Integration Points\n- Training Needs\n- Change Management"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "56596615-1902-4e1e-830d-7ef1566e9b16",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -256,
        2144
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b0955115-d436-4aee-b2cd-85b91b003fbb",
      "name": "业务需求编写 Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -848,
        2336
      ],
      "parameters": {
        "text": "=Generate a complete Business Requirements Document (BRD) for the following project:\nProject ID:  {{ $json.ProjectID }}\nProject Title:  {{ $json.ProjectTitle }}\nBusiness Domain: {{ $json.BusinessDomain }}\nAdditional Notes: {{ $json.Notes }}\n\nAll supporting details are available in the embedded documents uploaded by the requester.  \nQuery the embedded data to complete each section of the BRD according to the standard structure.",
        "options": {
          "systemMessage": "You are an expert Business Analyst specializing in creating professional, detailed Business Requirements Documents (BRDs) for software projects.\n\nYour responsibilities:\n1. Write informative BRD strictly in markdown format.\n2. Only create the BRD. Do not ask any follow-up questions or request clarification.\n3. Always follow the standard BRD structure provided below.\n4. Use the query data tool to retrieve relevant details from embedded supporting documents before writing.\n5. Keep writing clear, concise, and professional.\n6. If any required information is missing, mark it as **[Information Not Provided]**.\n7. For domain-specific requirements, include \"Industry Best Practice Recommendations\" if relevant and not covered in the provided documents.\n8. Business requirements & functional requirements are most important sections, ensure all business requirements are included\n\n**Standard BRD Structure:**\n\n### **# Business Requirements**\n- List **every distinct business requirement** with:\n  - **Requirement ID** (e.g., BR-01, BR-02…)\n  - **Clear, measurable description**.\n  - **Acceptance Criteria** — must be specific, measurable, and testable.\n  - **Sub-requirements** where applicable, to show variations or dependencies.\n  - **Rationale** for each High priority requirement (why it’s critical to the business).\n  - **Link to related Functional Requirements** for traceability.\n\n### **# Functional Requirements**\n- Expand **Use Cases/User Stories** into **detailed templates** with:\n  - **FR ID**\n  - **Title**\n  - **Actors**\n  - **Preconditions**\n  - **Main Flow** (step-by-step)\n  - **Alternate / Exception Flows**\n  - **Postconditions**\n  - **Related Business Requirements**\n- Include **Process Flow descriptions** in step-by-step form; if diagrams are needed, indicate `[To be designed]`.\n- Clearly define **Data Requirements**:\n  - Field names\n  - Data types/formats\n  - Validation rules\n  - Data sources\n- Document **system rules** and **business logic** for each process.\n- Indicate whether each functional requirement is:\n  - **Mandatory for MVP**\n  - **Planned for future phase**\n- Where applicable, specify:\n  - **Integration behavior**\n  - **Expected API interactions**\n  - **Error handling logic**"
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "5b247449-58e0-4cfa-9332-22edaa93044f",
      "name": "合并内容",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        2144
      ],
      "parameters": {
        "jsCode": "// Get the array of items from previous node\nconst items = $input.all(); \n\n// Merge \"output\" fields into one string\nconst mergedOutput = items\n  .map(item => item.json.output) // get each output value\n  .filter(Boolean)               // remove null/empty\n  .join(' ');                     // join with space (or '\\n' for newline)\n\n// Return as single item\nreturn [\n  {\n    json: {\n      mergedOutput,\n      Request: $('Request completed?').first().json\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "39b9cf55-82b8-4db9-b631-2a535b617bc4",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2992,
        1120
      ],
      "parameters": {
        "width": 976,
        "height": 1632,
        "content": "# 用于更智能 BRD(业务需求文档)编写的多 Agent RAG 系统"
      },
      "typeVersion": 1
    },
    {
      "id": "0196411a-6b6b-407a-8d74-e958643e02ce",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        1024
      ],
      "parameters": {
        "width": 768,
        "height": 96,
        "content": "### 1. 捕获 BRD 请求和支持文件"
      },
      "typeVersion": 1
    },
    {
      "id": "22847e03-896e-48ab-bf5f-01beabf0b775",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        1504
      ],
      "parameters": {
        "width": 624,
        "height": 112,
        "content": "### 2. 处理和提取关键信息"
      },
      "typeVersion": 1
    },
    {
      "id": "e0bfbcd7-7f1e-4947-a296-e85a64ffd316",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1648,
        1920
      ],
      "parameters": {
        "width": 704,
        "content": "### 3. 多 Agent BRD 草稿生成"
      },
      "typeVersion": 1
    },
    {
      "id": "3d5e5deb-d9e1-4fc5-8141-8553e96ba0ce",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        1984
      ],
      "parameters": {
        "width": 608,
        "height": 112,
        "content": "### 4. 合并和丰富内容"
      },
      "typeVersion": 1
    },
    {
      "id": "951ab192-1cad-48be-8c1c-8cf22e322fc0",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        1888
      ],
      "parameters": {
        "width": 560,
        "height": 112,
        "content": "### 5. 转换和归档最终 BRD"
      },
      "typeVersion": 1
    },
    {
      "id": "4fe32540-5086-4f5c-8493-06e9bc232c0f",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        2448
      ],
      "parameters": {
        "width": 784,
        "height": 112,
        "content": "### 6. 交付和更新状态"
      },
      "typeVersion": 1
    },
    {
      "id": "ea9a95a6-b90a-4c0a-afd1-050e7d5004ab",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1952,
        864
      ],
      "parameters": {
        "color": 4,
        "width": 540,
        "height": 1012,
        "content": "![替代文本](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Screenshot+2025-08-14+at+8.47.52%E2%80%AFPM.png \"可选标题文本\")"
      },
      "typeVersion": 1
    },
    {
      "id": "a5e9cd7e-02c2-49c9-abaa-1a309d94fb22",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        1984
      ],
      "parameters": {
        "color": 4,
        "width": 1068,
        "height": 564,
        "content": "![替代文本](https://wisestackai.s3.ap-southeast-1.amazonaws.com/Screenshot+2025-08-14+at+8.56.11%E2%80%AFPM.png \"可选标题文本\")"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "867df89f-1f73-4a76-8da2-078ff5092941",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Merge content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Insert Data to Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Query Data Tool",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Query Data Tool1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Merge content": {
      "main": [
        [
          {
            "node": "Configure metadata ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Data Tool": {
      "ai_tool": [
        [
          {
            "node": "General BRD Writer Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Query Data Tool1": {
      "ai_tool": [
        [
          {
            "node": "Business Requirement Writer Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "Insert Data to Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "General BRD Writer Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Archiving PDF File": {
      "main": [
        []
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Handle multiple files",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create BRD request record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Business Requirement Writer Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Request completed?": {
      "main": [
        [
          {
            "node": "General BRD Writer Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Business Requirement Writer Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload supporting ": {
      "main": [
        [
          {
            "node": "Create supporting document record(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure metadata ": {
      "main": [
        [
          {
            "node": "Create document file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Insert Data to Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Create document file": {
      "main": [
        [
          {
            "node": "Convert document to PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handle multiple files": {
      "main": [
        [
          {
            "node": "Upload supporting ",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert document to PDF": {
      "main": [
        [
          {
            "node": "Archiving PDF File",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send BRD response email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send BRD response email": {
      "main": [
        [
          {
            "node": "Create record to update Google Sheet row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "General BRD Writer Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create BRD request record": {
      "main": [
        [
          {
            "node": "Add BRD record to tracking ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mark request as completed": {
      "main": [
        []
      ]
    },
    "Business Requirement Writer Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "New request added to tracking sheet": {
      "main": [
        [
          {
            "node": "Request completed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create supporting document record(s)": {
      "main": [
        [
          {
            "node": "Add supporting document record(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create record to update Google Sheet row": {
      "main": [
        [
          {
            "node": "Mark request as completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - AI RAG 检索增强, 多模态 AI

需要付费吗?

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

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

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

作者
Trung Tran

Trung Tran

@trungtran

Empowering small and medium businesses with smart automation and practical AI, no big tech team required.

外部链接
在 n8n.io 查看

分享此工作流