8
n8n 中文网amn8n.com

PRD测试用例

中级

这是一个Document Extraction, Multimodal AI领域的自动化工作流,包含 9 个节点。主要使用 Set, Form, FormTrigger, ApiTemplateIo, ChainLlm 等节点。 使用GPT/Claude生成产品需求文档和测试场景,并导出PDF

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Dg9akaNziOBwgNu0",
  "meta": {
    "instanceId": "70273a2379644db63ce659827cfd8abac2d0b189210eafa02dd5376e3a62cd1d",
    "templateCredsSetupCompleted": true
  },
  "name": "PRD_测试用例",
  "tags": [],
  "nodes": [
    {
      "id": "7aa1d0eb-a145-4713-b12c-72d757924ef1",
      "name": "OpenRouter聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        0,
        64
      ],
      "parameters": {
        "model": "openai/gpt-4",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "brVP9oNL9perdfeq",
          "name": "learnby-openrouther"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "450b4fb9-26b5-4622-94ca-ca41761137b6",
      "name": "OpenRouter聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        448,
        48
      ],
      "parameters": {
        "model": "anthropic/claude-3.7-sonnet",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "id": "brVP9oNL9perdfeq",
          "name": "learnby-openrouther"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "bc40e4ea-8bdd-4a60-88c9-aa4167640f08",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -368
      ],
      "parameters": {
        "width": 480,
        "height": 944,
        "content": "### 📒 使用 OpenRouter 和 APITemplate.io 从输入生成**产品需求文档(PRD)**和**测试场景**并导出为 PDF"
      },
      "typeVersion": 1
    },
    {
      "id": "4c5c5daa-2ec9-451e-a827-b1d4cb21aecf",
      "name": "PRD LLM 链",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        0,
        -192
      ],
      "parameters": {
        "text": "=Product Name - {{ $json['Product Name'] || 'Not Available'}}\nProduct Overview  - {{ $json['Product Overview'] || 'Not Available' }}\nTarget Audience - {{ $json['Target Audience'] || 'Not Available' }}\nGoal & Objective - {{ $json['Goals & Objectives'] || 'Not Available' }}\nFunctional Requirements - {{ $json['Functional Requirements'] || 'Not Available' }}\nDate: {{ $json.submittedAt.split(\"T\")[0] }}\nCreated By - {{ $json['Created By'] || 'Not Available' }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are an expert product manager and technical writer.  \nYour task is to generate a clear, structured **Product Requirements Document (PRD)** in **Markdown format**.  \nThe PRD should be professional, concise, and easy to share with engineers, designers, and stakeholders.  \n\nUse Information provided by User prompt to Understand the requirement and try to go deep in filing all section.\n\n### Formatting Rules\n- Use proper Markdown headers (`#`, `##`, `###`) for sections.  \n- Use bullet points or numbered lists where appropriate.  \n- Keep language clear and action-oriented.  \n- Do not include explanations of what a PRD is.\n\n### PRD Template\n# Product Requirements Document (PRD)\n\n## 1. Overview\n- **Project Name:** \n- **Document Owner:** (leave blank if not provided)\n- **Last Updated:** (user created date provided by user)\n\n## 2. Problem Statement\n\n## 3. Goals\n\n## 4. Non-Goals\n- (list if provided, else mark as “N/A”)\n\n## 5. Target Audience / Users\n  - Pain Points Solved:\n\n## 6. Key Features / Requirements\n  -Primary Users:\n  -Secondary Users:\n  - (expand if needed)\n\n## 7. Key Features\n(expand if missing)\n\n## 8. Functional Requirements\n(expand if missing)\n\n## 8. Technical Constraints\n(expand if missing)\n\n## 9. Success Metrics\n- (expand if missing)\n\n## 10. Risks & Assumptions\n\n---\n"
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "b6f3b365-d277-4917-bb39-6c44a3c9d29b",
      "name": "测试用例 LLM 链",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        448,
        -192
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "Using the user input PRD document create Test scenario and test case in gherkin language. "
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "dba5e475-96b8-4505-96bb-ec736af91aa9",
      "name": "获取用户输入",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -288,
        -192
      ],
      "webhookId": "0a0d6c63-a806-4bb8-a9b6-f29c184a59b7",
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Technical Document Requirement",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Product Name",
              "placeholder": "Fitness Guru"
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Product Overview",
              "placeholder": "An app that helps gym-goers track workouts, find classes, and stay motivated",
              "requiredField": true
            },
            {
              "fieldLabel": "Target Audience",
              "placeholder": "gym members, personal trainers, gym owners"
            },
            {
              "fieldLabel": "Goals & Objectives",
              "placeholder": "Increase gym member engagement, streamline trainer-client interaction"
            },
            {
              "fieldLabel": "Functional Requirements",
              "placeholder": "Workout logging → select exercise → enter sets/reps → save → progress updates on dashboard."
            }
          ]
        },
        "responseMode": "lastNode"
      },
      "typeVersion": 2.2
    },
    {
      "id": "df78c5c0-2394-4fc4-b04b-da34bd07b7db",
      "name": "合并 PRD 和测试用例",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        -192
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "afee93c8-7b59-40b8-975a-55e4a3c9d35a",
              "name": "text",
              "type": "string",
              "value": "={{ $('PRD LLM Chain').item.json.text }}\n{{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2352e0ea-0f51-4b62-9dd1-b7af7a2a1628",
      "name": "创建 PDF 文档",
      "type": "n8n-nodes-base.apiTemplateIo",
      "position": [
        1040,
        -192
      ],
      "parameters": {
        "options": {
          "fileName": "PRD_abc.pdf"
        },
        "download": true,
        "resource": "pdf",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "markdown",
              "value": "={{ $json.text }}"
            }
          ]
        },
        "pdfTemplateId": "=e1277b23d41c334e"
      },
      "credentials": {
        "apiTemplateIoApi": {
          "id": "wve3UL6j52R45XJI",
          "name": "learnbyalok_APITemplate.io account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c1b7dcee-035e-46f3-8cfc-985cc7920839",
      "name": "让用户下载",
      "type": "n8n-nodes-base.form",
      "position": [
        1280,
        -192
      ],
      "webhookId": "a3e6b03b-d6a8-4390-9884-bfe08fb8cebd",
      "parameters": {
        "options": {},
        "operation": "completion",
        "respondWith": "returnBinary",
        "completionTitle": "PRD Document is ready",
        "completionMessage": "Process completed file will be downloaded! ",
        "inputDataFieldName": "=data"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a11c8289-d0f2-430d-995b-004ea59f10d9",
  "connections": {
    "PRD LLM Chain": {
      "main": [
        [
          {
            "node": "Test Case LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get User Input": {
      "main": [
        [
          {
            "node": "PRD LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Let User Download": {
      "main": [
        []
      ]
    },
    "Test Case LLM Chain": {
      "main": [
        [
          {
            "node": "Merge PRD and Test Case",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "PRD LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Document in PDF": {
      "main": [
        [
          {
            "node": "Let User Download",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Test Case LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge PRD and Test Case": {
      "main": [
        [
          {
            "node": "Create Document in PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 文档提取, 多模态 AI

需要付费吗?

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

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

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

作者
Alok Kumar

Alok Kumar

@alokkumar

I am a Principal Software Engineer based in Ireland with a deep passion for AI and emerging technologies. With extensive experience in designing and implementing scalable software solutions, I focus on leveraging artificial intelligence to solve real-world problems. I enjoy exploring innovative applications of AI, from intelligent automation to data-driven insights, and I’m dedicated to building systems that are both efficient and impactful.

外部链接
在 n8n.io 查看

分享此工作流