From 82b4f1dcb4e81feea570f290a8fc2ec4d0639293 Mon Sep 17 00:00:00 2001 From: mrsaifullah52 Date: Sat, 22 Nov 2025 12:22:42 +0500 Subject: [PATCH] feat(autominator): add gather-requirements workflow for requirement gathering - Create gather-requirements workflow with interactive elicitation - Add web search integration after each question - Research EXACT node types, typeVersions, and parameter structures from docs.n8n.io - Store all research findings in requirements file - Generate requirement documents with research sections - Add template.md with research findings sections - Add instructions.md with comprehensive elicitation steps - Add checklist.md for validation --- .../gather-requirements/checklist.md | 25 +++ .../gather-requirements/instructions.md | 190 ++++++++++++++++++ .../workflows/gather-requirements/template.md | 75 +++++++ .../gather-requirements/workflow.yaml | 34 ++++ 4 files changed, 324 insertions(+) create mode 100644 src/modules/autominator/workflows/gather-requirements/checklist.md create mode 100644 src/modules/autominator/workflows/gather-requirements/instructions.md create mode 100644 src/modules/autominator/workflows/gather-requirements/template.md create mode 100644 src/modules/autominator/workflows/gather-requirements/workflow.yaml diff --git a/src/modules/autominator/workflows/gather-requirements/checklist.md b/src/modules/autominator/workflows/gather-requirements/checklist.md new file mode 100644 index 00000000..d56d9dc2 --- /dev/null +++ b/src/modules/autominator/workflows/gather-requirements/checklist.md @@ -0,0 +1,25 @@ +# Gather Requirements - Validation Checklist + +## Requirements Completeness + +- [ ] Problem statement is clear and specific +- [ ] Trigger type is defined +- [ ] Data requirements are documented +- [ ] Desired outcome is clear +- [ ] All integrations are listed +- [ ] Conditional logic is documented (or marked as not needed) +- [ ] Criticality level is set +- [ ] Workflow name is descriptive + +## Document Quality + +- [ ] Requirements file is saved to correct location +- [ ] All template fields are filled +- [ ] No placeholder text remains +- [ ] Change log is initialized + +## Readiness + +- [ ] Requirements are sufficient to create workflow +- [ ] User has confirmed requirements are correct +- [ ] File is ready for use by create-workflow diff --git a/src/modules/autominator/workflows/gather-requirements/instructions.md b/src/modules/autominator/workflows/gather-requirements/instructions.md new file mode 100644 index 00000000..3530d56a --- /dev/null +++ b/src/modules/autominator/workflows/gather-requirements/instructions.md @@ -0,0 +1,190 @@ +# Gather Requirements - Workflow Instructions + +```xml +The workflow execution engine is governed by: {project_root}/{bmad_folder}/core/tasks/workflow.xml +You MUST have already loaded and processed: {installed_path}/workflow.yaml +This workflow gathers requirements for n8n workflow creation. + + + + + Resolve variables from config_source: requirements_folder, output_folder, user_name, communication_language + Create {{requirements_folder}} directory if it does not exist + Load template from {{template}} + + + + Ask questions ONE AT A TIME and WAIT for user response after each question + + Question 1: What problem are you trying to solve with this automation? + +Describe the current manual process, pain points, and desired outcome. + WAIT for user input + Store response in {{problem_description}} + + Perform web search to understand the use case: + - "n8n workflow for [problem description] site:docs.n8n.io" + - "n8n automation [problem description] best practices" + Store findings in {{use_case_research}} + + Question 2: What triggers this process? When should the automation run? + +Options: +1. When data arrives - Webhook, form submission, API call +2. On a schedule - Every hour, daily, weekly, custom cron +3. When something changes - Database update, file change, service event +4. Manually - On-demand execution +5. Multiple triggers - Combination of above +6. Not sure - Help me decide based on my problem + +Enter your selection (1-6): + WAIT for user input + Store response in {{trigger_type}} + + + Analyze {{problem_description}} and suggest appropriate trigger + Based on your problem, I recommend [trigger type]. Does this make sense? (yes/no) + WAIT for confirmation + Store final trigger in {{trigger_type}} + + + Question 3: What data or information does this workflow need to work with? + +Examples: Customer data, order details, form responses, API data, etc. + WAIT for user input + Store response in {{data_requirements}} + + Question 4: What should happen with this data? What's the desired outcome? + +Examples: Send to Slack, update database, create invoice, notify team, etc. + WAIT for user input + Store response in {{desired_outcome}} + + Question 5: What services or systems are involved? + +Examples: Slack, Google Sheets, PostgreSQL, HubSpot, custom API, etc. + WAIT for user input + Store response in {{integrations}} + + Research EXACT n8n node types for each integration: + For each service in {{integrations}}: + 1. Search: "n8n [service] node documentation site:docs.n8n.io" + 2. Extract EXACT node type string (e.g., "n8n-nodes-base.webhook") + 3. Extract typeVersion (e.g., 2.1) + 4. Extract available parameters structure + 5. Extract example usage from docs + 6. Note if trigger node or action node + Store all findings in {{node_research}} + + Question 6: Are there any conditions or decision points in this process? + +Examples: If amount > $1000, notify manager; If status = 'urgent', send immediately + +Options: +1. No - Straight-through processing +2. Yes - Describe the conditions + +Enter your selection (1-2): + WAIT for user input + + Describe the conditions and what should happen in each case: + WAIT for user input + Store response in {{conditional_logic}} + + + Store "No conditional logic required" in {{conditional_logic}} + + + Question 7: How critical is this workflow? What happens if it fails? + +Options: +1. Low - Can retry manually if needed +2. Medium - Should retry automatically, notify on failure +3. High - Must succeed, need alerts and logging +4. Critical - Business-critical, need comprehensive error handling + +Enter your selection (1-4): + WAIT for user input + Store selection in {{criticality}} + + Question 8: What should the workflow be named? + WAIT for user input + Store response in {{workflow_name}} + Generate {{workflow_slug}} from {{workflow_name}} (lowercase, hyphens, no spaces) + + Display summary: +- Problem: {{problem_description}} +- Trigger: {{trigger_type}} +- Data: {{data_requirements}} +- Outcome: {{desired_outcome}} +- Services: {{integrations}} +- Conditions: {{conditional_logic}} +- Criticality: {{criticality}} +- Name: {{workflow_name}} + + + Does this capture your requirements correctly? + +Options: +1. Yes - Save requirements +2. No - Let me clarify or add details + +Enter your selection (1-2): + WAIT for user input + + What needs to be clarified or added? + WAIT for user input + Update relevant variables based on feedback + Repeat summary and confirmation + + + + + Perform comprehensive web search for workflow pattern: + - "n8n workflow pattern [trigger_type] to [desired_outcome] site:docs.n8n.io" + - "n8n [integrations] workflow example site:docs.n8n.io" + - "n8n best practices [use case] site:docs.n8n.io" + Store findings in {{workflow_pattern_research}} + + Research parameter structures for each node type: + For each node type in {{node_research}}: + 1. Search: "n8n [node type] parameters documentation site:docs.n8n.io" + 2. Extract EXACT parameter structure from docs + 3. Extract required vs optional parameters + 4. Extract parameter data types + 5. Extract example values + Store in {{parameter_structures}} + + + + Resolve output path: {{default_output_file}} using {{workflow_slug}} + Fill template with all gathered variables AND research findings + Include in document: + - Problem description and requirements + - Use case research findings + - EXACT node types with typeVersions + - EXACT parameter structures from docs + - Workflow pattern recommendations + - Best practices from research + Save document to {{default_output_file}} + Report saved file path to user + + ✅ Requirements Saved Successfully! + +**File:** {{default_output_file}} + +**Next Steps:** +1. Review the requirements file +2. Run `*create-workflow` to generate the n8n workflow + (The create-workflow will automatically load this requirements file) + +**Note:** You can edit the requirements file manually before creating the workflow. + + + + + Validate against checklist at {{validation}} using {{bmad_folder}}/core/tasks/validate-workflow.xml + + + +``` diff --git a/src/modules/autominator/workflows/gather-requirements/template.md b/src/modules/autominator/workflows/gather-requirements/template.md new file mode 100644 index 00000000..2a58e61a --- /dev/null +++ b/src/modules/autominator/workflows/gather-requirements/template.md @@ -0,0 +1,75 @@ +# Workflow Requirements: {{workflow_name}} + +**Created:** {{date}} +**Status:** Requirements Gathered +**Criticality:** {{criticality}} + +--- + +## Problem Statement + +{{problem_description}} + +--- + +## Workflow Overview + +**Trigger:** {{trigger_type}} + +**Desired Outcome:** {{desired_outcome}} + +--- + +## Data Requirements + +{{data_requirements}} + +--- + +## Integrations + +{{integrations}} + +--- + +## Conditional Logic + +{{conditional_logic}} + +--- + +## Research Findings + +### Use Case Research + +{{use_case_research}} + +### Node Types (From n8n Documentation) + +{{node_research}} + +### Parameter Structures (From n8n Documentation) + +{{parameter_structures}} + +### Workflow Pattern Recommendations + +{{workflow_pattern_research}} + +--- + +## Technical Notes + +- Requirements gathered: {{date}} +- Research completed from n8n documentation +- All node types and parameters verified from docs.n8n.io +- Ready for workflow creation +- Use this file as input for `*create-workflow` + +--- + +## Change Log + +| Date | Change | Author | +| -------- | ----------------------------- | ------------- | +| {{date}} | Initial requirements gathered | {{user_name}} | diff --git a/src/modules/autominator/workflows/gather-requirements/workflow.yaml b/src/modules/autominator/workflows/gather-requirements/workflow.yaml new file mode 100644 index 00000000..3762961c --- /dev/null +++ b/src/modules/autominator/workflows/gather-requirements/workflow.yaml @@ -0,0 +1,34 @@ +name: gather-requirements +description: "Gather and document workflow requirements before creating n8n workflow" +author: "Saif" + +# Critical variables from config +config_source: "{project-root}/{bmad_folder}/autominator/config.yaml" +output_folder: "{config_source}:output_folder" +user_name: "{config_source}:user_name" +communication_language: "{config_source}:communication_language" +requirements_folder: "{config_source}:requirements_folder" +date: system-generated + +# Workflow components +installed_path: "{project-root}/{bmad_folder}/autominator/workflows/gather-requirements" +template: "{installed_path}/template.md" +instructions: "{installed_path}/instructions.md" +validation: "{installed_path}/checklist.md" + +# Variables +variables: + workflow_name: "" # Will be elicited + workflow_slug: "" # Generated from workflow_name + problem_description: "" # Will be elicited + trigger_type: "" # Will be elicited + data_requirements: "" # Will be elicited + desired_outcome: "" # Will be elicited + integrations: "" # Will be elicited + conditional_logic: "" # Will be elicited + criticality: "" # Will be elicited + +default_output_file: "{requirements_folder}/req-{workflow_slug}.md" + +standalone: true +web_bundle: false