From ebc5acd2aabaa97c579b04c71742992ec1c1295d Mon Sep 17 00:00:00 2001 From: mrsaifullah52 Date: Thu, 20 Nov 2025 14:28:53 +0500 Subject: [PATCH] chore(autominator): finalize standalone module and clean up - Remove old autominator files from BMM module - Verify module independence (no BMM dependencies) - All 21 agents validated successfully - All tests pass with new structure - Module ready for standalone distribution --- src/modules/bmm/agents/autominator.agent.yaml | 44 -- .../autominator/_shared/n8n-helpers.md | 201 -------- .../autominator/_shared/n8n-templates.yaml | 299 ------------ .../_shared/platform-mappings.yaml | 282 ----------- .../autominator/create-workflow/checklist.md | 74 --- .../create-workflow/instructions.md | 350 -------------- .../autominator/create-workflow/workflow.yaml | 31 -- .../autominator/migrate-workflow/checklist.md | 110 ----- .../migrate-workflow/instructions.md | 350 -------------- .../migrate-workflow/workflow.yaml | 32 -- .../autominator/modify-workflow/checklist.md | 90 ---- .../modify-workflow/instructions.md | 327 ------------- .../autominator/modify-workflow/workflow.yaml | 30 -- .../optimize-workflow/checklist.md | 130 ----- .../optimize-workflow/instructions.md | 446 ------------------ .../optimize-workflow/workflow.yaml | 29 -- 16 files changed, 2825 deletions(-) delete mode 100644 src/modules/bmm/agents/autominator.agent.yaml delete mode 100644 src/modules/bmm/workflows/autominator/_shared/n8n-helpers.md delete mode 100644 src/modules/bmm/workflows/autominator/_shared/n8n-templates.yaml delete mode 100644 src/modules/bmm/workflows/autominator/_shared/platform-mappings.yaml delete mode 100644 src/modules/bmm/workflows/autominator/create-workflow/checklist.md delete mode 100644 src/modules/bmm/workflows/autominator/create-workflow/instructions.md delete mode 100644 src/modules/bmm/workflows/autominator/create-workflow/workflow.yaml delete mode 100644 src/modules/bmm/workflows/autominator/migrate-workflow/checklist.md delete mode 100644 src/modules/bmm/workflows/autominator/migrate-workflow/instructions.md delete mode 100644 src/modules/bmm/workflows/autominator/migrate-workflow/workflow.yaml delete mode 100644 src/modules/bmm/workflows/autominator/modify-workflow/checklist.md delete mode 100644 src/modules/bmm/workflows/autominator/modify-workflow/instructions.md delete mode 100644 src/modules/bmm/workflows/autominator/modify-workflow/workflow.yaml delete mode 100644 src/modules/bmm/workflows/autominator/optimize-workflow/checklist.md delete mode 100644 src/modules/bmm/workflows/autominator/optimize-workflow/instructions.md delete mode 100644 src/modules/bmm/workflows/autominator/optimize-workflow/workflow.yaml diff --git a/src/modules/bmm/agents/autominator.agent.yaml b/src/modules/bmm/agents/autominator.agent.yaml deleted file mode 100644 index fcd25014..00000000 --- a/src/modules/bmm/agents/autominator.agent.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# Autominator - Arnold the Automation Expert - -agent: - webskip: true - metadata: - id: "{bmad_folder}/bmm/agents/autominator.md" - name: Arnold - title: Arnold the Autominator - icon: 🦾 - module: bmm - - persona: - role: n8n Workflow Automation Specialist - identity: Arnold the Autominator - I'll be back... with your workflows automated! 🦾 Expert in n8n workflow creation, migration, and optimization. Specializes in building automation workflows, migrating from other platforms (Zapier, Make, HubSpot), and optimizing existing n8n workflows using up-to-date documentation via Context7. - communication_style: Automation-first, elicitation-driven, solution-oriented. Presents options as numbered lists for easy selection. Always validates understanding before building. Direct, confident, and results-focused. - principles: | - - Context7 Integration - Always use latest n8n documentation via Context7 MCP server for accurate, up-to-date implementations. - - Elicitation First - Understand requirements thoroughly before suggesting or building solutions. - - Lazy Loading - Load files and documentation only when needed to minimize context pollution. - - Validation - Always validate workflow JSON syntax after creation. - - Platform Agnostic - Support migration from any automation platform with proper mapping. - - Error Recovery - NEVER delete files due to syntax errors, always fix them using error location information. - - Structured Approach - Follow task-specific workflows for different automation scenarios. - - menu: - - trigger: create-workflow - workflow: "{project-root}/{bmad_folder}/bmm/workflows/autominator/create-workflow/workflow.yaml" - description: Create new n8n workflow from scratch based on requirements - - - trigger: modify-workflow - workflow: "{project-root}/{bmad_folder}/bmm/workflows/autominator/modify-workflow/workflow.yaml" - description: Edit or update existing n8n workflow - - - trigger: migrate-workflow - workflow: "{project-root}/{bmad_folder}/bmm/workflows/autominator/migrate-workflow/workflow.yaml" - description: Migrate workflows from other platforms (Zapier, Make, HubSpot, etc.) to n8n - - - trigger: optimize-workflow - workflow: "{project-root}/{bmad_folder}/bmm/workflows/autominator/optimize-workflow/workflow.yaml" - description: Review and improve existing n8n workflows for performance and best practices - - - trigger: party-mode - workflow: "{project-root}/{bmad_folder}/core/workflows/party-mode/workflow.yaml" - description: Bring the whole team in to chat with other expert agents from the party diff --git a/src/modules/bmm/workflows/autominator/_shared/n8n-helpers.md b/src/modules/bmm/workflows/autominator/_shared/n8n-helpers.md deleted file mode 100644 index d46aa1d6..00000000 --- a/src/modules/bmm/workflows/autominator/_shared/n8n-helpers.md +++ /dev/null @@ -1,201 +0,0 @@ -# n8n Workflow Helpers - -## Node Creation Guidelines - -### Basic Node Structure - -```json -{ - "id": "unique-node-id", - "name": "Node Name", - "type": "n8n-nodes-base.nodeName", - "typeVersion": 1, - "position": [x, y], - "parameters": {}, - "credentials": {} -} -``` - -### Node Positioning - -- Start node: [250, 300] -- Horizontal spacing: 220px between nodes -- Vertical spacing: 100px for parallel branches -- Grid alignment: Snap to 20px grid for clean layout - -### Common Node Types - -**Trigger Nodes:** - -- `n8n-nodes-base.webhook` - HTTP webhook trigger -- `n8n-nodes-base.scheduleTrigger` - Cron/interval trigger -- `n8n-nodes-base.manualTrigger` - Manual execution trigger -- `n8n-nodes-base.emailTrigger` - Email trigger - -**Action Nodes:** - -- `n8n-nodes-base.httpRequest` - HTTP API calls -- `n8n-nodes-base.set` - Data transformation -- `n8n-nodes-base.code` - Custom JavaScript/Python code -- `n8n-nodes-base.if` - Conditional branching -- `n8n-nodes-base.merge` - Merge data from multiple branches -- `n8n-nodes-base.splitInBatches` - Process data in batches - -**Integration Nodes:** - -- `n8n-nodes-base.googleSheets` - Google Sheets -- `n8n-nodes-base.slack` - Slack -- `n8n-nodes-base.notion` - Notion -- `n8n-nodes-base.airtable` - Airtable -- `n8n-nodes-base.postgres` - PostgreSQL -- `n8n-nodes-base.mysql` - MySQL - -## Connection Guidelines - -### Connection Structure - -```json -{ - "node": "Source Node Name", - "type": "main", - "index": 0 -} -``` - -### Connection Rules - -1. Each connection has a source node and target node -2. Main connections use type: "main" -3. Index 0 is default output, index 1+ for conditional branches -4. IF nodes have index 0 (true) and index 1 (false) -5. Always validate that referenced node names exist - -### Connection Patterns - -**Linear Flow:** - -``` -Trigger → Action1 → Action2 → End -``` - -**Conditional Branch:** - -``` -Trigger → IF Node → [true: Action1, false: Action2] → Merge -``` - -**Parallel Processing:** - -``` -Trigger → Split → [Branch1, Branch2, Branch3] → Merge -``` - -## Error Handling Best Practices - -### Error Workflow Pattern - -```json -{ - "name": "Error Handler", - "type": "n8n-nodes-base.errorTrigger", - "parameters": { - "errorWorkflows": ["workflow-id"] - } -} -``` - -### Retry Configuration - -```json -{ - "retryOnFail": true, - "maxTries": 3, - "waitBetweenTries": 1000 -} -``` - -## Data Transformation Patterns - -### Using Set Node - -```json -{ - "name": "Transform Data", - "type": "n8n-nodes-base.set", - "parameters": { - "mode": "manual", - "values": { - "string": [ - { - "name": "outputField", - "value": "={{ $json.inputField }}" - } - ] - } - } -} -``` - -### Using Code Node - -```json -{ - "name": "Custom Logic", - "type": "n8n-nodes-base.code", - "parameters": { - "language": "javaScript", - "jsCode": "return items.map(item => ({ json: { ...item.json, processed: true } }));" - } -} -``` - -## Credentials Management - -### Credential Reference - -```json -{ - "credentials": { - "httpBasicAuth": { - "id": "credential-id", - "name": "My API Credentials" - } - } -} -``` - -### Common Credential Types - -- `httpBasicAuth` - Basic authentication -- `oAuth2Api` - OAuth2 -- `httpHeaderAuth` - Header-based auth -- `httpQueryAuth` - Query parameter auth - -## Workflow Metadata - -### Required Fields - -```json -{ - "name": "Workflow Name", - "nodes": [], - "connections": {}, - "active": false, - "settings": { - "executionOrder": "v1" - }, - "tags": [] -} -``` - -## Validation Checklist - -- [ ] All node IDs are unique -- [ ] All node names are unique -- [ ] All connections reference existing nodes -- [ ] Trigger node exists and is properly configured -- [ ] Node positions don't overlap -- [ ] Required parameters are set for each node -- [ ] Credentials are properly referenced -- [ ] Error handling is configured where needed -- [ ] JSON syntax is valid diff --git a/src/modules/bmm/workflows/autominator/_shared/n8n-templates.yaml b/src/modules/bmm/workflows/autominator/_shared/n8n-templates.yaml deleted file mode 100644 index 6e3ee4b1..00000000 --- a/src/modules/bmm/workflows/autominator/_shared/n8n-templates.yaml +++ /dev/null @@ -1,299 +0,0 @@ -# n8n Workflow Templates - -# Basic webhook workflow template -webhook_workflow: - name: "Webhook Workflow" - nodes: - - id: "webhook_trigger" - name: "Webhook" - type: "n8n-nodes-base.webhook" - typeVersion: 1 - position: [250, 300] - parameters: - httpMethod: "POST" - path: "webhook-path" - responseMode: "onReceived" - - id: "process_data" - name: "Process Data" - type: "n8n-nodes-base.set" - typeVersion: 1 - position: [470, 300] - parameters: - mode: "manual" - values: {} - connections: - Webhook: - - - node: "Process Data" - type: "main" - index: 0 - -# Scheduled workflow template -scheduled_workflow: - name: "Scheduled Workflow" - nodes: - - id: "schedule_trigger" - name: "Schedule Trigger" - type: "n8n-nodes-base.scheduleTrigger" - typeVersion: 1 - position: [250, 300] - parameters: - rule: - interval: - - field: "hours" - hoursInterval: 1 - - id: "execute_action" - name: "Execute Action" - type: "n8n-nodes-base.httpRequest" - typeVersion: 1 - position: [470, 300] - parameters: - method: "GET" - url: "" - connections: - Schedule Trigger: - - - node: "Execute Action" - type: "main" - index: 0 - -# Conditional workflow template -conditional_workflow: - name: "Conditional Workflow" - nodes: - - id: "manual_trigger" - name: "Manual Trigger" - type: "n8n-nodes-base.manualTrigger" - typeVersion: 1 - position: [250, 300] - parameters: {} - - id: "if_condition" - name: "IF" - type: "n8n-nodes-base.if" - typeVersion: 1 - position: [470, 300] - parameters: - conditions: - boolean: [] - number: [] - string: [] - - id: "true_branch" - name: "True Branch" - type: "n8n-nodes-base.noOp" - typeVersion: 1 - position: [690, 200] - parameters: {} - - id: "false_branch" - name: "False Branch" - type: "n8n-nodes-base.noOp" - typeVersion: 1 - position: [690, 400] - parameters: {} - connections: - Manual Trigger: - - - node: "IF" - type: "main" - index: 0 - IF: - - - node: "True Branch" - type: "main" - index: 0 - - - node: "False Branch" - type: "main" - index: 0 - -# API integration workflow template -api_integration_workflow: - name: "API Integration Workflow" - nodes: - - id: "webhook_trigger" - name: "Webhook" - type: "n8n-nodes-base.webhook" - typeVersion: 1 - position: [250, 300] - parameters: - httpMethod: "POST" - path: "api-webhook" - responseMode: "onReceived" - - id: "http_request" - name: "HTTP Request" - type: "n8n-nodes-base.httpRequest" - typeVersion: 1 - position: [470, 300] - parameters: - method: "POST" - url: "" - jsonParameters: true - options: {} - - id: "transform_response" - name: "Transform Response" - type: "n8n-nodes-base.set" - typeVersion: 1 - position: [690, 300] - parameters: - mode: "manual" - values: {} - connections: - Webhook: - - - node: "HTTP Request" - type: "main" - index: 0 - HTTP Request: - - - node: "Transform Response" - type: "main" - index: 0 - -# Database workflow template -database_workflow: - name: "Database Workflow" - nodes: - - id: "schedule_trigger" - name: "Schedule Trigger" - type: "n8n-nodes-base.scheduleTrigger" - typeVersion: 1 - position: [250, 300] - parameters: - rule: - interval: - - field: "minutes" - minutesInterval: 15 - - id: "postgres_query" - name: "Postgres" - type: "n8n-nodes-base.postgres" - typeVersion: 1 - position: [470, 300] - parameters: - operation: "executeQuery" - query: "" - - id: "process_results" - name: "Process Results" - type: "n8n-nodes-base.code" - typeVersion: 1 - position: [690, 300] - parameters: - language: "javaScript" - jsCode: "return items;" - connections: - Schedule Trigger: - - - node: "Postgres" - type: "main" - index: 0 - Postgres: - - - node: "Process Results" - type: "main" - index: 0 - -# Error handling workflow template -error_handling_workflow: - name: "Error Handling Workflow" - nodes: - - id: "manual_trigger" - name: "Manual Trigger" - type: "n8n-nodes-base.manualTrigger" - typeVersion: 1 - position: [250, 300] - parameters: {} - - id: "risky_operation" - name: "Risky Operation" - type: "n8n-nodes-base.httpRequest" - typeVersion: 1 - position: [470, 300] - parameters: - method: "GET" - url: "" - continueOnFail: true - retryOnFail: true - maxTries: 3 - waitBetweenTries: 1000 - - id: "check_error" - name: "Check for Error" - type: "n8n-nodes-base.if" - typeVersion: 1 - position: [690, 300] - parameters: - conditions: - boolean: - - value1: "={{ $json.error !== undefined }}" - value2: true - - id: "handle_error" - name: "Handle Error" - type: "n8n-nodes-base.set" - typeVersion: 1 - position: [910, 200] - parameters: - mode: "manual" - values: - string: - - name: "status" - value: "error" - - id: "success_path" - name: "Success Path" - type: "n8n-nodes-base.noOp" - typeVersion: 1 - position: [910, 400] - parameters: {} - connections: - Manual Trigger: - - - node: "Risky Operation" - type: "main" - index: 0 - Risky Operation: - - - node: "Check for Error" - type: "main" - index: 0 - Check for Error: - - - node: "Handle Error" - type: "main" - index: 0 - - - node: "Success Path" - type: "main" - index: 0 - -# Batch processing workflow template -batch_processing_workflow: - name: "Batch Processing Workflow" - nodes: - - id: "manual_trigger" - name: "Manual Trigger" - type: "n8n-nodes-base.manualTrigger" - typeVersion: 1 - position: [250, 300] - parameters: {} - - id: "get_data" - name: "Get Data" - type: "n8n-nodes-base.httpRequest" - typeVersion: 1 - position: [470, 300] - parameters: - method: "GET" - url: "" - - id: "split_batches" - name: "Split In Batches" - type: "n8n-nodes-base.splitInBatches" - typeVersion: 1 - position: [690, 300] - parameters: - batchSize: 10 - - id: "process_batch" - name: "Process Batch" - type: "n8n-nodes-base.code" - typeVersion: 1 - position: [910, 300] - parameters: - language: "javaScript" - jsCode: "return items;" - connections: - Manual Trigger: - - - node: "Get Data" - type: "main" - index: 0 - Get Data: - - - node: "Split In Batches" - type: "main" - index: 0 - Split In Batches: - - - node: "Process Batch" - type: "main" - index: 0 - Process Batch: - - - node: "Split In Batches" - type: "main" - index: 0 diff --git a/src/modules/bmm/workflows/autominator/_shared/platform-mappings.yaml b/src/modules/bmm/workflows/autominator/_shared/platform-mappings.yaml deleted file mode 100644 index 059bed6c..00000000 --- a/src/modules/bmm/workflows/autominator/_shared/platform-mappings.yaml +++ /dev/null @@ -1,282 +0,0 @@ -# Platform Migration Mappings -# Maps common automation platform concepts to n8n equivalents - -# Zapier to n8n mappings -zapier: - triggers: - "New Email": - n8n_node: "n8n-nodes-base.emailTrigger" - notes: "Configure IMAP/POP3 credentials" - "Webhook": - n8n_node: "n8n-nodes-base.webhook" - notes: "Use POST method by default" - "Schedule": - n8n_node: "n8n-nodes-base.scheduleTrigger" - notes: "Convert Zapier schedule format to cron" - "New Row in Google Sheets": - n8n_node: "n8n-nodes-base.googleSheetsTrigger" - notes: "Requires Google OAuth credentials" - "New Slack Message": - n8n_node: "n8n-nodes-base.slackTrigger" - notes: "Configure channel and event type" - - actions: - "Send Email": - n8n_node: "n8n-nodes-base.emailSend" - notes: "Configure SMTP credentials" - "HTTP Request": - n8n_node: "n8n-nodes-base.httpRequest" - notes: "Map method, URL, headers, and body" - "Create Google Sheets Row": - n8n_node: "n8n-nodes-base.googleSheets" - parameters: - operation: "append" - "Send Slack Message": - n8n_node: "n8n-nodes-base.slack" - parameters: - operation: "post" - resource: "message" - "Delay": - n8n_node: "n8n-nodes-base.wait" - notes: "Convert delay duration to milliseconds" - "Filter": - n8n_node: "n8n-nodes-base.if" - notes: "Convert filter conditions to IF node logic" - "Formatter": - n8n_node: "n8n-nodes-base.set" - notes: "Use Set node for data transformation" - "Code": - n8n_node: "n8n-nodes-base.code" - notes: "JavaScript or Python code execution" - - concepts: - "Multi-step Zap": - n8n_equivalent: "Linear workflow with connected nodes" - "Paths": - n8n_equivalent: "IF node with multiple branches" - "Filters": - n8n_equivalent: "IF node with conditions" - "Formatter": - n8n_equivalent: "Set node or Code node" - "Looping": - n8n_equivalent: "Split In Batches node" - -# Make (Integromat) to n8n mappings -make: - triggers: - "Webhook": - n8n_node: "n8n-nodes-base.webhook" - notes: "Direct equivalent" - "Watch Records": - n8n_node: "n8n-nodes-base.scheduleTrigger" - notes: "Combine with polling logic in Code node" - "Custom Webhook": - n8n_node: "n8n-nodes-base.webhook" - notes: "Configure response mode" - - actions: - "HTTP Request": - n8n_node: "n8n-nodes-base.httpRequest" - notes: "Map all HTTP parameters" - "Router": - n8n_node: "n8n-nodes-base.switch" - notes: "Multiple conditional branches" - "Iterator": - n8n_node: "n8n-nodes-base.splitInBatches" - notes: "Process array items individually" - "Aggregator": - n8n_node: "n8n-nodes-base.merge" - notes: "Combine data from multiple sources" - "Data Store": - n8n_node: "n8n-nodes-base.redis" - notes: "Use Redis or database node for storage" - "JSON Parser": - n8n_node: "n8n-nodes-base.code" - notes: "Parse JSON in Code node" - "Text Parser": - n8n_node: "n8n-nodes-base.set" - notes: "Use expressions for text manipulation" - - concepts: - "Scenario": - n8n_equivalent: "Workflow" - "Module": - n8n_equivalent: "Node" - "Route": - n8n_equivalent: "Connection" - "Filter": - n8n_equivalent: "IF node" - "Router": - n8n_equivalent: "Switch node or multiple IF nodes" - "Iterator": - n8n_equivalent: "Split In Batches node" - "Aggregator": - n8n_equivalent: "Merge node" - -# HubSpot Workflows to n8n mappings -hubspot: - triggers: - "Contact Property Change": - n8n_node: "n8n-nodes-base.hubspotTrigger" - notes: "Configure webhook for property updates" - "Deal Stage Change": - n8n_node: "n8n-nodes-base.hubspotTrigger" - notes: "Monitor deal pipeline changes" - "Form Submission": - n8n_node: "n8n-nodes-base.hubspotTrigger" - notes: "Webhook for form submissions" - "List Membership": - n8n_node: "n8n-nodes-base.scheduleTrigger" - notes: "Poll HubSpot API for list changes" - - actions: - "Update Contact Property": - n8n_node: "n8n-nodes-base.hubspot" - parameters: - resource: "contact" - operation: "update" - "Create Deal": - n8n_node: "n8n-nodes-base.hubspot" - parameters: - resource: "deal" - operation: "create" - "Send Email": - n8n_node: "n8n-nodes-base.hubspot" - parameters: - resource: "email" - operation: "send" - "Add to List": - n8n_node: "n8n-nodes-base.hubspot" - parameters: - resource: "contact" - operation: "addToList" - "Create Task": - n8n_node: "n8n-nodes-base.hubspot" - parameters: - resource: "task" - operation: "create" - - concepts: - "Enrollment Trigger": - n8n_equivalent: "Trigger node (webhook or schedule)" - "If/Then Branch": - n8n_equivalent: "IF node" - "Delay": - n8n_equivalent: "Wait node" - "Goal": - n8n_equivalent: "IF node checking completion criteria" - "Re-enrollment": - n8n_equivalent: "Workflow settings with loop detection" - -# Microsoft Power Automate to n8n mappings -power_automate: - triggers: - "When an item is created": - n8n_node: "n8n-nodes-base.webhook" - notes: "Configure webhook for item creation events" - "Recurrence": - n8n_node: "n8n-nodes-base.scheduleTrigger" - notes: "Convert recurrence pattern to cron" - "When a HTTP request is received": - n8n_node: "n8n-nodes-base.webhook" - notes: "Direct equivalent" - - actions: - "HTTP": - n8n_node: "n8n-nodes-base.httpRequest" - notes: "Map all HTTP parameters" - "Condition": - n8n_node: "n8n-nodes-base.if" - notes: "Convert condition logic" - "Apply to each": - n8n_node: "n8n-nodes-base.splitInBatches" - notes: "Process array items" - "Compose": - n8n_node: "n8n-nodes-base.set" - notes: "Data transformation" - "Parse JSON": - n8n_node: "n8n-nodes-base.code" - notes: "Parse JSON in Code node" - "Delay": - n8n_node: "n8n-nodes-base.wait" - notes: "Convert delay duration" - - concepts: - "Flow": - n8n_equivalent: "Workflow" - "Action": - n8n_equivalent: "Node" - "Condition": - n8n_equivalent: "IF node" - "Switch": - n8n_equivalent: "Switch node" - "Scope": - n8n_equivalent: "Error handling with try/catch in Code node" - "Apply to each": - n8n_equivalent: "Split In Batches node" - -# Common patterns across platforms -common_patterns: - conditional_logic: - description: "If/then/else branching" - n8n_implementation: "IF node with true/false branches" - - loops: - description: "Iterate over array items" - n8n_implementation: "Split In Batches node" - - data_transformation: - description: "Transform, format, or map data" - n8n_implementation: "Set node or Code node" - - error_handling: - description: "Handle errors and retries" - n8n_implementation: "Node settings: continueOnFail, retryOnFail, maxTries" - - delays: - description: "Wait before next action" - n8n_implementation: "Wait node with duration" - - webhooks: - description: "Receive HTTP requests" - n8n_implementation: "Webhook node with response configuration" - - api_calls: - description: "Make HTTP requests to APIs" - n8n_implementation: "HTTP Request node" - - parallel_execution: - description: "Execute multiple actions simultaneously" - n8n_implementation: "Multiple connections from single node" - - merge_data: - description: "Combine data from multiple sources" - n8n_implementation: "Merge node" - -# Migration considerations -migration_notes: - authentication: - - "Recreate all credentials in n8n" - - "OAuth flows may need re-authorization" - - "API keys and tokens must be securely stored" - - scheduling: - - "Convert platform-specific schedules to cron expressions" - - "Consider timezone differences" - - "Test schedule triggers before going live" - - data_formats: - - "Verify JSON structure compatibility" - - "Check date/time format conversions" - - "Validate data type mappings" - - error_handling: - - "Implement retry logic where needed" - - "Add error notification workflows" - - "Test failure scenarios" - - testing: - - "Test with sample data first" - - "Verify all integrations work correctly" - - "Monitor initial executions closely" - - "Compare outputs with original platform" diff --git a/src/modules/bmm/workflows/autominator/create-workflow/checklist.md b/src/modules/bmm/workflows/autominator/create-workflow/checklist.md deleted file mode 100644 index dcd96098..00000000 --- a/src/modules/bmm/workflows/autominator/create-workflow/checklist.md +++ /dev/null @@ -1,74 +0,0 @@ -# Create n8n Workflow - Validation Checklist - -## Workflow Structure - -- [ ] Workflow has a valid name -- [ ] Workflow contains at least one trigger node -- [ ] All nodes have unique IDs -- [ ] All nodes have unique names -- [ ] Workflow JSON is valid and parseable - -## Node Configuration - -- [ ] Trigger node is properly configured -- [ ] All action nodes have required parameters set -- [ ] Node types are valid n8n node types -- [ ] Node positions are set and don't overlap -- [ ] TypeVersion is set for all nodes (usually 1) - -## Connections - -- [ ] All nodes are connected (no orphaned nodes except trigger) -- [ ] All connections reference existing node names -- [ ] Connection types are set correctly (usually "main") -- [ ] Connection indices are correct (0 for default, 0/1 for IF nodes) -- [ ] No circular dependencies (unless intentional loops) - -## Error Handling - -- [ ] Error handling strategy matches requirements -- [ ] Critical nodes have retry logic if needed -- [ ] continueOnFail is set appropriately -- [ ] maxTries and waitBetweenTries are configured if retries enabled - -## Data Flow - -- [ ] Data transformations are properly configured -- [ ] Set nodes have correct value mappings -- [ ] Code nodes have valid JavaScript/Python code -- [ ] Expressions use correct n8n syntax (={{ }}) - -## Integrations - -- [ ] All required integrations are included -- [ ] Credential placeholders are set for authenticated services -- [ ] API endpoints and methods are correct -- [ ] Request/response formats are properly configured - -## Best Practices - -- [ ] Workflow follows n8n naming conventions -- [ ] Nodes are logically organized and positioned -- [ ] Complex logic is broken into manageable steps -- [ ] Workflow is documented (node names are descriptive) - -## Testing Readiness - -- [ ] Workflow can be imported into n8n without errors -- [ ] All required credentials are identified -- [ ] Test data requirements are clear -- [ ] Expected outputs are defined - -## File Output - -- [ ] File is saved to correct location -- [ ] File has .json extension -- [ ] File is valid JSON (passes JSON.parse) -- [ ] File size is reasonable (not corrupted) - -## Documentation - -- [ ] User has been informed how to import workflow -- [ ] Credential requirements have been communicated -- [ ] Testing instructions have been provided -- [ ] Any special configuration notes have been shared diff --git a/src/modules/bmm/workflows/autominator/create-workflow/instructions.md b/src/modules/bmm/workflows/autominator/create-workflow/instructions.md deleted file mode 100644 index 161ddb27..00000000 --- a/src/modules/bmm/workflows/autominator/create-workflow/instructions.md +++ /dev/null @@ -1,350 +0,0 @@ -# Create n8n Workflow - 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 creates a new n8n workflow from scratch based on user requirements. - - - - - Before asking any questions, analyze what the user has already told you - - Review the user's initial request and conversation history - Extract any mentioned: workflow type, trigger, integrations, complexity, requirements - - - Summarize your understanding - Skip directly to Step 2 (Check Context7 MCP) - - - - Note what you already know - Only ask about missing information in Step 1 - - - - Proceed with full elicitation in Step 1 - - - - - Ask Question 1: "What type of automation workflow do you need?" - Present numbered options: - 1. Webhook-based - Receive HTTP requests and process data - 2. Scheduled - Run on a schedule (cron/interval) - 3. Event-driven - Trigger from external service events - 4. Manual - Execute on demand - 5. Database-driven - Trigger from database changes - 6. Other - Describe your specific trigger needs - - WAIT for user selection (1-6) - Store selection in {{workflow_type}} - - - Ask: "Please describe your trigger requirements" - WAIT for user input - Store in {{workflow_type}} - - - Ask Question 2: "What integrations or services will this workflow use?" - Present numbered options: - 1. HTTP/REST APIs - Generic API calls - 2. Databases - PostgreSQL, MySQL, MongoDB, etc. - 3. Cloud Services - Google Sheets, Slack, Notion, Airtable - 4. Email - Send/receive emails - 5. CRM - HubSpot, Salesforce, etc. - 6. Custom Code - JavaScript/Python logic - 7. Multiple - Combination of above - 8. Other - Specify integrations - - WAIT for user selection (1-8) - Store selection in {{integrations}} - - - Ask: "Please list all integrations needed (comma-separated)" - WAIT for user input - Store in {{integrations}} - - - Ask Question 3: "How complex is your workflow logic?" - Present numbered options: - 1. Simple (3-5 nodes) - Linear flow with minimal logic - 2. Medium (6-10 nodes) - Some conditional logic or branching - 3. Complex (11-20 nodes) - Multiple branches, loops, or error handling - 4. Very Complex (20+ nodes) - Advanced logic with parallel processing - - WAIT for user selection (1-4) - Store selection in {{complexity}} - - Ask Question 4: "Do you need error handling and retry logic?" - Present numbered options: - 1. No - Simple workflow without error handling - 2. Basic - Retry failed operations automatically - 3. Advanced - Custom error handling with notifications - 4. Comprehensive - Full error workflow with logging and alerts - - WAIT for user selection (1-4) - Store selection in {{error_handling}} - - Ask Question 5: "What should the workflow be named?" - WAIT for user input - Store in {{workflow_name}} - - Ask Question 6: "Where should the workflow file be saved?" - Present numbered options: - 1. Default location - workflows/[workflow-name].json - 2. Custom path - Specify your own file path - 3. Project root - Save in main project directory - 4. Specific folder - Choose from existing folders - - WAIT for user selection (1-4) - - Ask for specific path - WAIT for user input - - Store final path in {{save_location}} - - Ask Question 7: "Any additional requirements or specific logic needed?" - Present numbered options: - 1. No - Proceed with current requirements - 2. Yes - Describe additional requirements - - WAIT for user selection (1-2) - - Ask: "Please describe additional requirements" - WAIT for user input - Store in {{additional_requirements}} - - - - - Check if Context7 MCP server is configured - Try to list available MCP tools - - - Store true in {{context7_available}} - Proceed to Step 3 - - - - Store false in {{context7_available}} - Inform user: "Context7 MCP server is not configured. This provides up-to-date n8n documentation." - Ask: "Would you like help setting up Context7 MCP? (yes/no)" - WAIT for user response - - - Guide user through Context7 MCP setup: - 1. Inform user: "Context7 MCP requires the 'uvx' command (part of uv Python package manager)" - 2. Ask: "Do you have 'uv' installed? (yes/no/not sure)" - WAIT for response - - - Provide installation guidance: - - macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh - - Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" - - Or via pip: pip install uv - Ask user to install and confirm when ready - WAIT for confirmation - - - 3. Inform user: "Please configure Context7 MCP in your IDE's MCP settings with:" - - Server name: context7 - Command: uvx - Args: ["context7"] - Auto-approve tools: ["resolve-library-id", "get-library-docs"] - - 4. Ask user to reconnect/restart MCP servers in their IDE - 5. Wait for user confirmation that MCP is reconnected - 6. Verify Context7 is now available - Store result in {{context7_available}} - - - - Inform: "Proceeding without Context7. Using built-in n8n knowledge." - Proceed to Step 4 - - - - - - - Resolve n8n library ID using Context7 - Query Context7 for relevant n8n documentation based on: - - Workflow type: {{workflow_type}} - - Integrations: {{integrations}} - - Complexity: {{complexity}} - Store relevant documentation snippets for reference - - - - Skip Context7 query - Use built-in knowledge and templates - - - - - Based on gathered requirements, plan the workflow structure: - 1. Identify trigger node type - 2. List all action nodes needed - 3. Identify conditional logic (IF nodes) - 4. Plan data transformations (Set/Code nodes) - 5. Design error handling strategy - 6. Map node connections - - Present the planned structure to user in clear format: - - Trigger: [trigger type] - - Nodes: [list of nodes with descriptions] - - Logic: [conditional branches, loops] - - Error Handling: [strategy] - - Ask: "Does this structure meet your needs?" - Present numbered options: - 1. Yes - Proceed with this structure - 2. No - Adjust the structure - 3. Add more details - Provide additional requirements - - WAIT for user selection (1-3) - - - Ask: "What changes or additions are needed?" - WAIT for user input - Adjust structure based on feedback - Repeat this step - - - - - Load {{templates}} file - Identify closest matching template based on workflow type - Load {{helpers}} for node creation guidelines - Extract relevant template sections - - - - Follow guidelines from {{helpers}} for proper node creation - - Initialize workflow structure: - - { - "name": "{{workflow_name}}", - "nodes": [], - "connections": {}, - "active": false, - "settings": { - "executionOrder": "v1" - }, - "tags": [] - } - - - Build nodes ONE at a time following these rules: - - For Each Node: - 1. Generate unique node ID - 2. Set node name (unique, descriptive) - 3. Set node type (e.g., n8n-nodes-base.webhook) - 4. Set typeVersion (usually 1) - 5. Calculate position: - - First node (trigger): [250, 300] - - Subsequent nodes: add 220 to x for each step - - Branches: adjust y by ±100 - 6. Configure parameters based on node type - 7. Add credentials if needed - 8. Set error handling options if required: - - continueOnFail: true/false - - retryOnFail: true/false - - maxTries: number - - waitBetweenTries: milliseconds - - - For Each Connection: - 1. Identify source node name - 2. Identify target node name - 3. Create connection entry in connections object: - "Source Node Name": [ - [ - { - "node": "Target Node Name", - "type": "main", - "index": 0 - } - ] - ] - 4. For IF nodes: - - index 0 = true branch - - index 1 = false branch - 5. Validate all referenced nodes exist - - - Node Building Order: - 1. Trigger node - 2. Main flow action nodes - 3. Conditional nodes (IF/Switch) - 4. Branch nodes - 5. Merge nodes - 6. Final action nodes - 7. Connect all nodes - - - Apply error handling based on {{error_handling}} selection - Validate all node IDs are unique - Validate all node names are unique - Validate all connections reference existing nodes - - - - Review workflow for optimization: - - Remove any unused nodes - - Verify node positions don't overlap - - Ensure proper spacing and alignment - - Validate all required parameters are set - - Save workflow to {{save_location}} - - - - NEVER delete the file if validation fails - always fix syntax errors - - Run: node -e "JSON.parse(require('fs').readFileSync('{{save_location}}', 'utf8')); console.log('✓ Valid JSON')" - - - Read the error message carefully - it shows the syntax error and position - Open the file and navigate to the error location - Fix the syntax error (add missing comma, bracket, or quote as indicated) - Save the file - Re-run validation with the same command - Repeat until validation passes - - - Once validation passes, confirm with user: "n8n workflow created at {{save_location}}" - - - - Inform user how to use the workflow: - 1. Import the JSON file into n8n - 2. Configure credentials for integrated services - 3. Test the workflow with sample data - 4. Activate the workflow when ready - - Ask: "Would you like me to explain any part of the workflow?" - Present numbered options: - 1. No - I'm good to go - 2. Yes - Explain specific nodes - 3. Yes - Explain the overall flow - 4. Yes - Explain how to test it - - WAIT for user selection (1-4) - - - Provide requested explanation - - - - - Validate against checklist at {{validation}} using {{bmad_folder}}/core/tasks/validate-workflow.xml - - - -``` diff --git a/src/modules/bmm/workflows/autominator/create-workflow/workflow.yaml b/src/modules/bmm/workflows/autominator/create-workflow/workflow.yaml deleted file mode 100644 index 63ad6e15..00000000 --- a/src/modules/bmm/workflows/autominator/create-workflow/workflow.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: create-workflow -description: "Create new n8n workflow from scratch based on requirements" -author: "Saif" - -# Workflow components -installed_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/create-workflow" -shared_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/_shared" -instructions: "{installed_path}/instructions.md" -validation: "{installed_path}/checklist.md" - -# Shared resources -helpers: "{shared_path}/n8n-helpers.md" -templates: "{shared_path}/n8n-templates.yaml" -platform_mappings: "{shared_path}/platform-mappings.yaml" - -# Variables -variables: - workflow_type: "" # Will be elicited - trigger_type: "" # Will be elicited - integrations: [] # Will be elicited - complexity: "" # Will be elicited - error_handling: "" # Will be elicited - save_location: "" # Will be elicited - workflow_name: "" # Will be elicited - additional_requirements: "" # Will be elicited - context7_available: false # Will be checked - -default_output_file: "{project-root}/workflows/workflow-{timestamp}.json" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/autominator/migrate-workflow/checklist.md b/src/modules/bmm/workflows/autominator/migrate-workflow/checklist.md deleted file mode 100644 index 22e6e675..00000000 --- a/src/modules/bmm/workflows/autominator/migrate-workflow/checklist.md +++ /dev/null @@ -1,110 +0,0 @@ -# Migrate Workflow to n8n - Validation Checklist - -## Source Analysis - -- [ ] Source platform was identified -- [ ] Source workflow details were gathered -- [ ] Trigger type was identified -- [ ] All integrations were identified -- [ ] Workflow complexity was assessed - -## Platform Mapping - -- [ ] Platform mappings were loaded -- [ ] Source trigger was mapped to n8n trigger -- [ ] All source actions were mapped to n8n nodes -- [ ] Conditional logic was mapped correctly -- [ ] Loops/iterations were mapped correctly -- [ ] Data transformations were identified - -## Workflow Structure - -- [ ] n8n workflow has valid JSON structure -- [ ] Workflow name is set -- [ ] Migration tag is added (migrated-from-[platform]) -- [ ] All nodes have unique IDs -- [ ] All nodes have unique names -- [ ] Trigger node is properly configured - -## Node Configuration - -- [ ] All mapped nodes are created -- [ ] Node types are valid n8n types -- [ ] Node parameters are configured -- [ ] Credentials placeholders are set -- [ ] Node positions are calculated correctly -- [ ] No overlapping nodes - -## Data Mappings - -- [ ] Field mappings from source to n8n are correct -- [ ] Data type conversions are handled -- [ ] Date/time format differences are addressed -- [ ] Expressions use correct n8n syntax (={{ }}) -- [ ] Set nodes are used for simple transformations -- [ ] Code nodes are used for complex transformations - -## Conditional Logic - -- [ ] IF nodes are created for conditional branches -- [ ] Switch nodes are created for multiple conditions -- [ ] Conditions are properly configured -- [ ] True/false branches are correct (index 0/1) -- [ ] All branches are connected - -## Connections - -- [ ] All nodes are connected properly -- [ ] Trigger connects to first action -- [ ] Actions are connected in sequence -- [ ] Conditional branches are connected -- [ ] Merge points are connected -- [ ] All connections reference existing nodes -- [ ] No orphaned nodes (except trigger) - -## Error Handling - -- [ ] Error handling strategy is defined -- [ ] Critical nodes have retry logic if needed -- [ ] continueOnFail is set appropriately -- [ ] Error handling matches or improves on source - -## Migration Notes - -- [ ] Source platform is documented -- [ ] Migration date is recorded -- [ ] Credentials needed are listed -- [ ] Platform-specific differences are noted -- [ ] Testing considerations are documented - -## Validation - -- [ ] Workflow passes JSON validation -- [ ] All required parameters are set -- [ ] Workflow structure is logical -- [ ] Migration matches source workflow functionality - -## Credentials & Authentication - -- [ ] All services requiring credentials are identified -- [ ] Credential types are correct for n8n -- [ ] OAuth requirements are noted -- [ ] API key requirements are noted -- [ ] Authentication differences from source are documented - -## Testing Readiness - -- [ ] Workflow can be imported into n8n -- [ ] Test data requirements are clear -- [ ] Expected outputs are defined -- [ ] Comparison approach with source is defined -- [ ] Initial monitoring plan is suggested - -## Documentation - -- [ ] User has import instructions -- [ ] Credential setup guidance provided -- [ ] Data mapping explanations provided -- [ ] Testing approach explained -- [ ] Platform differences highlighted -- [ ] Post-migration checklist provided diff --git a/src/modules/bmm/workflows/autominator/migrate-workflow/instructions.md b/src/modules/bmm/workflows/autominator/migrate-workflow/instructions.md deleted file mode 100644 index 17ffd53d..00000000 --- a/src/modules/bmm/workflows/autominator/migrate-workflow/instructions.md +++ /dev/null @@ -1,350 +0,0 @@ -# Migrate Workflow to n8n - 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 migrates automation workflows from other platforms to n8n. - - - - - Before asking any questions, analyze what the user has already told you - - Review the user's initial request and conversation history - Extract any mentioned: source platform, workflow details, integrations, file paths - - - Summarize your understanding - Skip directly to Step 2 (Check Context7 MCP) - - - - Note what you already know - Only ask about missing information in Step 1 - - - - Proceed with full elicitation in Step 1 - - - - - Ask Question 1: "Which platform are you migrating from?" - Present numbered options: - 1. Zapier - Migrate Zapier Zaps to n8n - 2. Make (Integromat) - Migrate Make scenarios to n8n - 3. HubSpot Workflows - Migrate HubSpot workflows to n8n - 4. Microsoft Power Automate - Migrate Power Automate flows to n8n - 5. IFTTT - Migrate IFTTT applets to n8n - 6. Other - Specify another automation platform - - WAIT for user selection (1-6) - Store selection in {{source_platform}} - - - Ask: "Please specify the platform you're migrating from" - WAIT for user input - Store in {{source_platform}} - - - Ask Question 2: "How will you provide the workflow to migrate?" - Present numbered options: - 1. Describe it - Explain what the workflow does - 2. Provide export file - Upload/paste workflow export file - 3. Provide screenshots - Share workflow screenshots - 4. Provide documentation - Share workflow documentation - - WAIT for user selection (1-4) - - - Ask: "Please describe what the workflow does (trigger, actions, logic)" - WAIT for user input - Store in {{workflow_description}} - - - - Ask: "Please provide the workflow export file path or paste the content" - WAIT for user input - Store in {{workflow_file}} or {{workflow_content}} - - - - Ask: "Please share the workflow screenshots and describe the flow" - WAIT for user input - Store in {{workflow_description}} - - - - Ask: "Please provide the workflow documentation" - WAIT for user input - Store in {{workflow_description}} - - - Ask Question 3: "What is the trigger for this workflow?" - Present numbered options: - 1. Webhook/HTTP Request - Triggered by incoming HTTP requests - 2. Schedule/Cron - Runs on a schedule - 3. Form Submission - Triggered by form submissions - 4. Database Change - Triggered by database events - 5. Email - Triggered by incoming emails - 6. Service Event - Triggered by external service (Slack, Google Sheets, etc.) - 7. Not sure - Will determine from workflow details - - WAIT for user selection (1-7) - Store selection in {{trigger_type}} - - Ask Question 4: "What integrations/services does this workflow use?" - Ask: "Please list all services (e.g., Slack, Google Sheets, HubSpot, etc.)" - WAIT for user input - Store in {{integrations_used}} - - Ask Question 5: "How complex is the workflow?" - Present numbered options: - 1. Simple - Linear flow with 3-5 steps - 2. Medium - Some conditional logic, 6-10 steps - 3. Complex - Multiple branches, loops, 11-20 steps - 4. Very Complex - Advanced logic, 20+ steps - - WAIT for user selection (1-4) - Store selection in {{complexity}} - - Ask Question 6: "What should the migrated workflow be named?" - WAIT for user input - Store in {{workflow_name}} - - Ask Question 7: "Where should the n8n workflow file be saved?" - Present numbered options: - 1. Default location - workflows/[workflow-name].json - 2. Custom path - Specify your own file path - 3. Project root - Save in main project directory - - WAIT for user selection (1-3) - - Ask for specific path - WAIT for user input - - Store final path in {{save_location}} - - - - Check if Context7 MCP server is configured - Try to list available MCP tools - - - Store true in {{context7_available}} - Proceed to Step 3 - - - - Store false in {{context7_available}} - Inform user: "Context7 MCP not configured. Proceeding with built-in n8n knowledge." - Proceed to Step 4 - - - - - - Resolve n8n library ID using Context7 - Query Context7 for relevant n8n documentation based on: - - Integrations used: {{integrations_used}} - - Trigger type: {{trigger_type}} - - Source platform: {{source_platform}} - Store relevant documentation snippets for reference - - - - - Load {{platform_mappings}} file - Extract mappings for {{source_platform}} - Identify equivalent n8n nodes for source platform components - - - - - Parse source workflow file/content - Extract workflow structure - - - Analyze workflow based on description and details: - 1. Identify trigger type and configuration - 2. List all actions/steps in order - 3. Identify conditional logic (if/then branches) - 4. Identify loops or iterations - 5. Identify data transformations - 6. Identify error handling - 7. Map integrations to n8n nodes - - Present analysis to user: - - Source trigger: [platform-specific trigger] - - n8n trigger: [mapped n8n node] - - Source actions: [list with platform names] - - n8n actions: [list with n8n node types] - - Logic: [conditional branches, loops] - - Transformations: [data mapping needs] - - - - Load {{helpers}} for node creation guidelines - Load {{templates}} for reference - - Design n8n workflow structure: - 1. Map source trigger to n8n trigger node - 2. Map each source action to n8n node(s) - 3. Convert conditional logic to IF/Switch nodes - 4. Convert loops to Split In Batches nodes - 5. Add Set/Code nodes for data transformations - 6. Plan node connections - 7. Add error handling where needed - - Present migration plan to user: - - n8n Trigger: [node type and configuration] - - n8n Nodes: [list with descriptions] - - Connections: [flow diagram] - - Data Mappings: [field mappings] - - Credentials Needed: [list of integrations requiring auth] - - Ask: "Does this migration plan look correct?" - Present numbered options: - 1. Yes - Proceed with migration - 2. No - Adjust the plan - 3. Add more details - Provide additional information - - WAIT for user selection (1-3) - - - Ask: "What changes or additions are needed?" - WAIT for user input - Adjust plan based on feedback - Repeat this step - - - - - Follow guidelines from {{helpers}} for proper node creation - - Initialize workflow structure: - - { - "name": "{{workflow_name}}", - "nodes": [], - "connections": {}, - "active": false, - "settings": { - "executionOrder": "v1" - }, - "tags": [ - { - "name": "migrated-from-{{source_platform}}" - } - ] - } - - - Build nodes ONE at a time: - - For Each Mapped Node: - 1. Generate unique node ID - 2. Set node name (descriptive, unique) - 3. Set node type from platform mappings - 4. Set typeVersion (usually 1) - 5. Calculate position (220px spacing) - 6. Configure parameters based on source workflow - 7. Map data fields from source to n8n format - 8. Add credentials placeholder if needed - 9. Set error handling if required - - - For Data Transformations: - 1. Identify field mappings needed - 2. Create Set nodes for simple mappings - 3. Create Code nodes for complex transformations - 4. Use n8n expressions: ={{ $json.fieldName }} - 5. Handle data type conversions - 6. Handle date/time format differences - - - For Conditional Logic: - 1. Create IF nodes for if/then branches - 2. Create Switch nodes for multiple conditions - 3. Map source conditions to n8n condition format - 4. Set up true/false branches (index 0/1) - - - For Connections: - 1. Connect trigger to first action - 2. Connect actions in sequence - 3. Connect conditional branches - 4. Connect merge points - 5. Validate all connections - - - Add migration notes as workflow tags - Validate all node IDs are unique - Validate all connections reference existing nodes - - - - Add comment nodes or documentation: - - Source platform: {{source_platform}} - - Migration date: {timestamp} - - Credentials to configure: [list] - - Testing notes: [important considerations] - - Platform-specific differences: [notes] - - - - Save workflow to {{save_location}} - - - - NEVER delete the file if validation fails - always fix syntax errors - - Run: node -e "JSON.parse(require('fs').readFileSync('{{save_location}}', 'utf8')); console.log('✓ Valid JSON')" - - - Read the error message carefully - it shows the syntax error and position - Open the file and navigate to the error location - Fix the syntax error (add missing comma, bracket, or quote as indicated) - Save the file - Re-run validation with the same command - Repeat until validation passes - - - Once validation passes, confirm with user: "Workflow migrated successfully to {{save_location}}" - - - - Provide post-migration instructions: - 1. Import the JSON file into n8n - 2. Configure credentials for these services: [list] - 3. Review and update these data mappings: [list] - 4. Test with sample data before activating - 5. Compare outputs with original platform - 6. Monitor initial executions closely - - Highlight platform-specific differences: - - Authentication: [differences] - - Data formats: [differences] - - Scheduling: [differences] - - Error handling: [differences] - - Ask: "Would you like help with any specific part of the migration?" - Present numbered options: - 1. No - I'm ready to test - 2. Yes - Explain credential setup - 3. Yes - Explain data mappings - 4. Yes - Explain testing approach - - WAIT for user selection (1-4) - - - Provide requested explanation - - - - - Validate against checklist at {{validation}} using {{bmad_folder}}/core/tasks/validate-workflow.xml - - - -``` diff --git a/src/modules/bmm/workflows/autominator/migrate-workflow/workflow.yaml b/src/modules/bmm/workflows/autominator/migrate-workflow/workflow.yaml deleted file mode 100644 index 7344191e..00000000 --- a/src/modules/bmm/workflows/autominator/migrate-workflow/workflow.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: migrate-workflow -description: "Migrate workflows from other platforms (Zapier, Make, HubSpot, etc.) to n8n" -author: "Saif" - -# Workflow components -installed_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/migrate-workflow" -shared_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/_shared" -instructions: "{installed_path}/instructions.md" -validation: "{installed_path}/checklist.md" - -# Shared resources -helpers: "{shared_path}/n8n-helpers.md" -templates: "{shared_path}/n8n-templates.yaml" -platform_mappings: "{shared_path}/platform-mappings.yaml" - -# Variables -variables: - source_platform: "" # Will be elicited - workflow_description: "" # Will be elicited - workflow_file: "" # Will be elicited (optional) - workflow_content: "" # Will be elicited (optional) - integrations_used: [] # Will be elicited - trigger_type: "" # Will be elicited - complexity: "" # Will be elicited - save_location: "" # Will be elicited - workflow_name: "" # Will be elicited - context7_available: false # Will be checked - -default_output_file: "{project-root}/workflows/migrated-workflow-{timestamp}.json" - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/autominator/modify-workflow/checklist.md b/src/modules/bmm/workflows/autominator/modify-workflow/checklist.md deleted file mode 100644 index 9534b32b..00000000 --- a/src/modules/bmm/workflows/autominator/modify-workflow/checklist.md +++ /dev/null @@ -1,90 +0,0 @@ -# Modify n8n Workflow - Validation Checklist - -## Pre-Modification - -- [ ] Original workflow file was successfully loaded -- [ ] Workflow JSON was valid before modifications -- [ ] Backup was created before making changes -- [ ] User requirements were clearly understood - -## Workflow Structure - -- [ ] Workflow maintains valid JSON structure -- [ ] Workflow name is preserved (unless intentionally changed) -- [ ] All nodes still have unique IDs -- [ ] All nodes still have unique names -- [ ] Workflow settings are preserved - -## Node Modifications - -- [ ] Added nodes have unique IDs -- [ ] Added nodes have unique names -- [ ] Added nodes have valid node types -- [ ] Added nodes have required parameters set -- [ ] Modified nodes preserve their IDs -- [ ] Modified nodes have valid parameter values -- [ ] Removed nodes are completely removed from nodes array - -## Connections - -- [ ] All connections reference existing nodes -- [ ] Connections to/from added nodes are properly configured -- [ ] Connections affected by removed nodes are updated -- [ ] No orphaned connections remain -- [ ] Connection indices are correct (0 for default, 0/1 for IF nodes) -- [ ] No circular dependencies (unless intentional) - -## Node Positioning - -- [ ] New nodes have valid positions -- [ ] New nodes don't overlap with existing nodes -- [ ] Node positions follow spacing guidelines (220px horizontal) -- [ ] Branch nodes have appropriate vertical spacing (±100px) - -## Error Handling - -- [ ] Error handling modifications are applied correctly -- [ ] Retry logic is properly configured if added -- [ ] continueOnFail settings are appropriate -- [ ] maxTries and waitBetweenTries are set if retries enabled - -## Data Flow - -- [ ] Data flow is maintained after modifications -- [ ] New transformations are properly configured -- [ ] Expressions use correct n8n syntax (={{ }}) -- [ ] No data flow breaks introduced - -## Integration Changes - -- [ ] New integrations are properly configured -- [ ] Credential requirements are identified -- [ ] API configurations are correct -- [ ] Existing integrations still work - -## Validation - -- [ ] Modified workflow passes JSON validation -- [ ] All modifications match user requirements -- [ ] No unintended changes were made -- [ ] Workflow structure is still logical - -## Backup & Recovery - -- [ ] Backup file was created successfully -- [ ] Backup location was communicated to user -- [ ] Original workflow can be restored if needed - -## Testing Readiness - -- [ ] Modified workflow can be imported into n8n -- [ ] Changes are testable -- [ ] Expected behavior is clear -- [ ] Any new credentials needed are identified - -## Documentation - -- [ ] Changes made are summarized for user -- [ ] User understands what was modified -- [ ] Testing recommendations provided if needed -- [ ] Backup location shared with user diff --git a/src/modules/bmm/workflows/autominator/modify-workflow/instructions.md b/src/modules/bmm/workflows/autominator/modify-workflow/instructions.md deleted file mode 100644 index 5f086d95..00000000 --- a/src/modules/bmm/workflows/autominator/modify-workflow/instructions.md +++ /dev/null @@ -1,327 +0,0 @@ -# Modify n8n Workflow - 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 modifies an existing n8n workflow based on user requirements. - - - - - Before asking any questions, analyze what the user has already told you - - Review the user's initial request and conversation history - Extract any mentioned: workflow file path, changes needed, specific nodes - - - Summarize your understanding - Skip directly to Step 2 (Load Existing Workflow) - - - - Note what you already know - Only ask about missing information in Step 1 - - - - Proceed with full elicitation in Step 1 - - - - - Ask Question 1: "Which workflow file do you want to modify?" - Present numbered options: - 1. Provide file path - Specify exact path to workflow JSON - 2. Search in workflows folder - List available workflows - 3. Paste workflow JSON - Provide workflow content directly - - WAIT for user selection (1-3) - - - Ask: "Please provide the file path to the workflow JSON" - WAIT for user input - Store in {{workflow_file}} - - - - List all .json files in workflows/ directory - Present as numbered list - WAIT for user selection - Store selected file path in {{workflow_file}} - - - - Ask: "Please paste the workflow JSON content" - WAIT for user input - Create temporary file with content - Store temp file path in {{workflow_file}} - - - Ask Question 2: "What type of modification do you need?" - Present numbered options: - 1. Add new nodes - Add functionality to existing workflow - 2. Modify existing nodes - Change node parameters or configuration - 3. Remove nodes - Delete nodes from workflow - 4. Change connections - Modify how nodes are connected - 5. Update error handling - Add or modify retry/error logic - 6. Optimize workflow - Improve performance or structure - 7. Multiple changes - Combination of above - - WAIT for user selection (1-7) - Store selection in {{modification_type}} - - Ask Question 3: "Please describe the changes you want to make" - WAIT for user input - Store in {{changes_description}} - - - Ask: "What nodes do you want to add? (describe functionality)" - WAIT for user input - Store in {{nodes_to_add}} - - - - Ask: "Which nodes do you want to modify? (provide node names or descriptions)" - WAIT for user input - Store in {{nodes_to_modify}} - - - - Ask: "Which nodes do you want to remove? (provide node names)" - WAIT for user input - Store in {{nodes_to_remove}} - - - - - Only load the workflow file when user provides it - never preload - - Read workflow file from {{workflow_file}} - Parse JSON content - Validate JSON structure - - - Inform user: "The workflow file has invalid JSON syntax" - Show error details - Ask: "Would you like me to fix the JSON syntax first? (yes/no)" - WAIT for user response - - - Fix JSON syntax errors - Save corrected file - Proceed with loading - - - - Exit workflow with error - - - - Extract workflow structure: - - Workflow name - - List of nodes (names, types, IDs) - - Connections map - - Current settings - - Display workflow summary to user: - - Name: [workflow name] - - Nodes: [count] nodes - - Node list: [node names and types] - - Connections: [connection count] - - - - Create backup of original workflow - Save backup to: {{workflow_file}}.backup-{timestamp} - Store true in {{backup_created}} - Inform user: "Backup created at {{workflow_file}}.backup-{timestamp}" - - - - Check if Context7 MCP server is configured - Try to list available MCP tools - - - Store true in {{context7_available}} - Proceed to Step 5 - - - - Store false in {{context7_available}} - Inform user: "Context7 MCP not configured. Proceeding with built-in knowledge." - Proceed to Step 6 - - - - - - Resolve n8n library ID using Context7 - Query Context7 for relevant n8n documentation based on: - - Modification type: {{modification_type}} - - Nodes to add: {{nodes_to_add}} - - Changes description: {{changes_description}} - Store relevant documentation snippets for reference - - - - - Load {{helpers}} for node creation guidelines - Analyze current workflow structure - Plan modifications based on requirements: - - - 1. Identify where new nodes should be inserted - 2. Determine node types needed - 3. Plan connections to/from new nodes - 4. Calculate positions for new nodes - - - - 1. Identify nodes to modify by name or ID - 2. Determine what parameters to change - 3. Validate new parameter values - - - - 1. Identify nodes to remove by name or ID - 2. Identify connections that will be affected - 3. Plan how to reconnect remaining nodes - - - - 1. Identify connections to modify - 2. Validate new connection targets exist - 3. Update connection indices if needed - - - Present modification plan to user: - - Changes to be made: [detailed list] - - Nodes affected: [list] - - New connections: [list] - - Removed connections: [list] - - Ask: "Does this modification plan look correct?" - Present numbered options: - 1. Yes - Proceed with modifications - 2. No - Adjust the plan - 3. Add more changes - Include additional modifications - - WAIT for user selection (1-3) - - - Ask: "What changes or additions are needed?" - WAIT for user input - Adjust plan based on feedback - Repeat this step - - - - - Follow guidelines from {{helpers}} for proper node creation - - Load current workflow JSON into memory - - If Adding Nodes: - 1. Generate unique node IDs (check against existing IDs) - 2. Create node objects with proper structure - 3. Calculate positions (avoid overlaps with existing nodes) - 4. Add nodes to workflow.nodes array - 5. Create connections to/from new nodes - 6. Update connections object - - - If Modifying Nodes: - 1. Find nodes by name or ID - 2. Update parameters as specified - 3. Preserve node ID and other unchanged properties - 4. Validate new parameter values - 5. Update node in workflow.nodes array - - - If Removing Nodes: - 1. Find nodes by name or ID - 2. Remove from workflow.nodes array - 3. Remove all connections to/from removed nodes - 4. Update connections object - 5. Reconnect remaining nodes if needed - - - If Changing Connections: - 1. Update connections object - 2. Validate all referenced nodes exist - 3. Ensure connection indices are correct - 4. Remove orphaned connections - - - If Updating Error Handling: - 1. Find affected nodes - 2. Add or update error handling properties: - - continueOnFail - - retryOnFail - - maxTries - - waitBetweenTries - 3. Validate error handling configuration - - - Validate modified workflow: - - All node IDs are unique - - All node names are unique - - All connections reference existing nodes - - No orphaned nodes (except trigger) - - Node positions don't overlap - - - - Save modified workflow to {{workflow_file}} - Preserve original file location - - - - NEVER delete the file if validation fails - always fix syntax errors - - Run: node -e "JSON.parse(require('fs').readFileSync('{{workflow_file}}', 'utf8')); console.log('✓ Valid JSON')" - - - Read the error message carefully - it shows the syntax error and position - Open the file and navigate to the error location - Fix the syntax error (add missing comma, bracket, or quote as indicated) - Save the file - Re-run validation with the same command - Repeat until validation passes - - - Once validation passes, confirm with user: "Workflow modified successfully at {{workflow_file}}" - - - - Provide summary of changes made: - - Nodes added: [count and names] - - Nodes modified: [count and names] - - Nodes removed: [count and names] - - Connections changed: [count] - - Backup location: {{workflow_file}}.backup-{timestamp} - - Ask: "Would you like to make additional changes?" - Present numbered options: - 1. No - I'm done - 2. Yes - Make more modifications - 3. Revert - Restore from backup - - WAIT for user selection (1-3) - - - Return to Step 1 with current workflow - - - - Restore workflow from backup - Confirm restoration to user - - - - - Validate against checklist at {{validation}} using {{bmad_folder}}/core/tasks/validate-workflow.xml - - - -``` diff --git a/src/modules/bmm/workflows/autominator/modify-workflow/workflow.yaml b/src/modules/bmm/workflows/autominator/modify-workflow/workflow.yaml deleted file mode 100644 index d829b7db..00000000 --- a/src/modules/bmm/workflows/autominator/modify-workflow/workflow.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: modify-workflow -description: "Edit or update existing n8n workflow" -author: "Saif" - -# Workflow components -installed_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/modify-workflow" -shared_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/_shared" -instructions: "{installed_path}/instructions.md" -validation: "{installed_path}/checklist.md" - -# Shared resources -helpers: "{shared_path}/n8n-helpers.md" -templates: "{shared_path}/n8n-templates.yaml" -platform_mappings: "{shared_path}/platform-mappings.yaml" - -# Variables -variables: - workflow_file: "" # Will be elicited - modification_type: "" # Will be elicited - changes_description: "" # Will be elicited - nodes_to_add: [] # Will be elicited - nodes_to_modify: [] # Will be elicited - nodes_to_remove: [] # Will be elicited - backup_created: false # Will be set - context7_available: false # Will be checked - -default_output_file: "" # Will use existing file location - -standalone: true -web_bundle: false diff --git a/src/modules/bmm/workflows/autominator/optimize-workflow/checklist.md b/src/modules/bmm/workflows/autominator/optimize-workflow/checklist.md deleted file mode 100644 index a5bbd1f2..00000000 --- a/src/modules/bmm/workflows/autominator/optimize-workflow/checklist.md +++ /dev/null @@ -1,130 +0,0 @@ -# Optimize n8n Workflow - Validation Checklist - -## Pre-Optimization - -- [ ] Original workflow was successfully loaded -- [ ] Workflow JSON was valid before optimization -- [ ] Optimization focus areas were identified -- [ ] Backup was created before making changes -- [ ] User requirements were clearly understood - -## Analysis Completeness - -- [ ] Performance analysis was conducted -- [ ] Error handling was reviewed -- [ ] Code quality was assessed -- [ ] Structure was evaluated -- [ ] Best practices were checked -- [ ] Security was reviewed -- [ ] All issues were documented - -## Recommendations Quality - -- [ ] Recommendations are specific and actionable -- [ ] Recommendations are prioritized correctly -- [ ] Impact of each recommendation is clear -- [ ] Implementation steps are provided -- [ ] Expected improvements are quantified -- [ ] No breaking changes are recommended - -## Performance Optimizations - -- [ ] Unnecessary nodes were identified/removed -- [ ] Data transformations were optimized -- [ ] Batch processing opportunities were identified -- [ ] Redundant API calls were consolidated -- [ ] Parallel execution opportunities were identified -- [ ] Node execution order was optimized - -## Error Handling Improvements - -- [ ] Critical nodes have retry logic -- [ ] continueOnFail is set appropriately -- [ ] Error workflows are configured where needed -- [ ] Timeout configurations are appropriate -- [ ] Error notifications are set up -- [ ] Error handling doesn't mask real issues - -## Code Quality Improvements - -- [ ] Set nodes are properly configured -- [ ] Code nodes are optimized -- [ ] Expressions use correct syntax -- [ ] Data types are handled correctly -- [ ] Hardcoded values are replaced with variables -- [ ] Node names are descriptive and consistent - -## Structure Improvements - -- [ ] Node positions are logical and organized -- [ ] Complex branches are simplified where possible -- [ ] Duplicate logic is eliminated -- [ ] Merge points are optimized -- [ ] Connection patterns are clean -- [ ] Workflow flow is easy to follow - -## Best Practices Applied - -- [ ] Credentials are used correctly -- [ ] Security issues are addressed -- [ ] Node types are appropriate -- [ ] Node versions are up to date -- [ ] Data handling follows best practices -- [ ] Workflow settings are optimal - -## Security Improvements - -- [ ] No credentials are exposed -- [ ] Sensitive data is handled properly -- [ ] No hardcoded secrets remain -- [ ] Authentication is properly configured -- [ ] Data is sanitized where needed -- [ ] Security best practices are followed - -## Workflow Integrity - -- [ ] All node IDs remain unique -- [ ] All node names remain unique -- [ ] All connections are valid -- [ ] No functionality is lost -- [ ] Workflow still achieves original purpose -- [ ] No breaking changes introduced - -## Validation - -- [ ] Optimized workflow passes JSON validation -- [ ] All optimizations were applied correctly -- [ ] No unintended changes were made -- [ ] Workflow structure is still logical -- [ ] All improvements are documented - -## Backup & Recovery - -- [ ] Backup file was created successfully -- [ ] Backup location was communicated to user -- [ ] Original workflow can be restored if needed - -## Testing Readiness - -- [ ] Optimized workflow can be imported into n8n -- [ ] Test scenarios are identified -- [ ] Expected improvements are measurable -- [ ] Comparison approach is defined -- [ ] Monitoring plan is suggested - -## Documentation - -- [ ] Analysis report is comprehensive -- [ ] All findings are documented -- [ ] Recommendations are clearly explained -- [ ] Expected improvements are quantified -- [ ] Testing recommendations are provided -- [ ] User understands all changes made - -## Expected Improvements - -- [ ] Performance improvements are quantified -- [ ] Reliability improvements are identified -- [ ] Maintainability improvements are clear -- [ ] Security improvements are documented -- [ ] Cost savings are estimated (if applicable) diff --git a/src/modules/bmm/workflows/autominator/optimize-workflow/instructions.md b/src/modules/bmm/workflows/autominator/optimize-workflow/instructions.md deleted file mode 100644 index b8823d11..00000000 --- a/src/modules/bmm/workflows/autominator/optimize-workflow/instructions.md +++ /dev/null @@ -1,446 +0,0 @@ -# Optimize n8n Workflow - 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 analyzes and optimizes existing n8n workflows for performance and best practices. - - - - - Before asking any questions, analyze what the user has already told you - - Review the user's initial request and conversation history - Extract any mentioned: workflow file path, performance issues, optimization goals - - - Summarize your understanding - Skip directly to Step 2 (Load Workflow) - - - - Note what you already know - Only ask about missing information in Step 1 - - - - Proceed with full elicitation in Step 1 - - - - - Ask Question 1: "Which workflow do you want to optimize?" - Present numbered options: - 1. Provide file path - Specify exact path to workflow JSON - 2. Search in workflows folder - List available workflows - 3. Paste workflow JSON - Provide workflow content directly - - WAIT for user selection (1-3) - - - Ask: "Please provide the file path to the workflow JSON" - WAIT for user input - Store in {{workflow_file}} - - - - List all .json files in workflows/ directory - Present as numbered list - WAIT for user selection - Store selected file path in {{workflow_file}} - - - - Ask: "Please paste the workflow JSON content" - WAIT for user input - Create temporary file with content - Store temp file path in {{workflow_file}} - - - Ask Question 2: "What aspects do you want to optimize?" - Present numbered options (can select multiple): - 1. Performance - Improve execution speed and efficiency - 2. Error Handling - Add or improve error handling and retries - 3. Code Quality - Improve node configuration and data transformations - 4. Structure - Improve workflow organization and readability - 5. Best Practices - Apply n8n best practices and patterns - 6. Security - Improve credential handling and data security - 7. All - Comprehensive optimization review - - WAIT for user selection (1-7 or multiple) - Store selections in {{optimization_focus}} - - Ask Question 3: "Are there specific issues or pain points?" - Present numbered options: - 1. No - Just general optimization - 2. Yes - Describe specific issues - - WAIT for user selection (1-2) - - - Ask: "Please describe the issues (slow execution, errors, etc.)" - WAIT for user input - Store in {{specific_issues}} - - - - - Only load the workflow file when user provides it - never preload - - Read workflow file from {{workflow_file}} - Parse JSON content - Validate JSON structure - - - Inform user: "The workflow file has invalid JSON syntax" - Show error details - Ask: "Would you like me to fix the JSON syntax first? (yes/no)" - WAIT for user response - - - Fix JSON syntax errors - Save corrected file - Proceed with loading - - - - Exit workflow with error - - - - Extract workflow structure: - - Workflow name and settings - - Node count and types - - Connection patterns - - Error handling configuration - - Credential usage - - Display workflow summary to user: - - Name: [workflow name] - - Nodes: [count] nodes - - Complexity: [simple/medium/complex] - - Integrations: [list of services] - - - - Check if Context7 MCP server is configured - Try to list available MCP tools - - - Store true in {{context7_available}} - Proceed to Step 4 - - - - Store false in {{context7_available}} - Inform user: "Context7 MCP not configured. Using built-in n8n best practices." - Proceed to Step 5 - - - - - - Resolve n8n library ID using Context7 - Query Context7 for n8n best practices documentation - Query for optimization techniques - Query for performance tips - Store relevant documentation for reference - - - - - Load {{helpers}} for best practices reference - - Perform comprehensive analysis based on {{optimization_focus}}: - - Performance Analysis: - - Check for unnecessary nodes - - Identify inefficient data transformations - - Look for missing batch processing opportunities - - Check for redundant API calls - - Analyze node execution order - - Identify parallel execution opportunities - - - Error Handling Analysis: - - Check if critical nodes have retry logic - - Verify continueOnFail settings - - Look for missing error workflows - - Check timeout configurations - - Verify error notification setup - - - Code Quality Analysis: - - Review Set node configurations - - Review Code node implementations - - Check expression syntax and efficiency - - Verify data type handling - - Check for hardcoded values - - Review node naming conventions - - - Structure Analysis: - - Check node positioning and layout - - Verify logical flow organization - - Look for overly complex branches - - Check for duplicate logic - - Verify proper use of merge nodes - - Check connection patterns - - - Best Practices Analysis: - - Verify proper credential usage - - Check for security issues - - Verify proper use of node types - - Check for deprecated node versions - - Verify proper data handling - - Check workflow settings - - - Security Analysis: - - Check credential exposure - - Verify sensitive data handling - - Check for hardcoded secrets - - Verify proper authentication - - Check data sanitization - - - Store all findings in {{issues_found}} - - - - For each issue found, generate specific recommendations: - - Categorize recommendations by priority: - - Critical: Security issues, major performance problems - - High: Error handling gaps, significant inefficiencies - - Medium: Code quality improvements, minor optimizations - - Low: Cosmetic improvements, nice-to-haves - - For each recommendation, provide: - 1. Issue description - 2. Impact explanation - 3. Specific solution - 4. Implementation steps - 5. Expected improvement - - Store recommendations in {{recommendations}} - - - - Present comprehensive optimization report: - - ## Workflow Analysis Report - Workflow: {{workflow_name}} - Analysis Date: {timestamp} - Optimization Focus: {{optimization_focus}} - - ### Summary - - Total Issues Found: [count] - - Critical: [count] - - High Priority: [count] - - Medium Priority: [count] - - Low Priority: [count] - - ### Detailed Findings - Present each issue with: - - Priority level - - Issue description - - Current state - - Recommended solution - - Expected impact - - ### Performance Opportunities - List specific performance improvements with estimated impact - - ### Best Practice Violations - List n8n best practices not being followed - - Ask: "Would you like me to apply these optimizations?" - Present numbered options: - 1. Yes - Apply all recommendations - 2. Yes - Apply only critical and high priority - 3. Yes - Let me choose which to apply - 4. No - Just provide the report - 5. Explain more - I need more details first - - WAIT for user selection (1-5) - - - Ask: "Which recommendations would you like explained?" - WAIT for user input - Provide detailed explanation - Repeat this step - - - - Present recommendations as numbered list - Ask: "Select recommendations to apply (comma-separated numbers)" - WAIT for user input - Store selected recommendations - - - - Store true in {{apply_changes}} - Proceed to Step 8 - - - - Store false in {{apply_changes}} - Skip to Step 11 (provide report only) - - - - - - Create backup of original workflow - Save backup to: {{workflow_file}}.backup-{timestamp} - Store true in {{backup_created}} - Inform user: "Backup created at {{workflow_file}}.backup-{timestamp}" - - - - - Follow guidelines from {{helpers}} for proper node configuration - - Load current workflow JSON into memory - - Apply each selected recommendation: - - Performance Optimizations: - - Remove unnecessary nodes - - Optimize data transformations - - Add batch processing where applicable - - Consolidate redundant API calls - - Optimize node execution order - - Add parallel execution where possible - - - Error Handling Improvements: - - Add retry logic to critical nodes - - Set appropriate continueOnFail values - - Add error workflows if needed - - Configure timeouts - - Add error notifications - - - Code Quality Improvements: - - Refactor Set node configurations - - Optimize Code node implementations - - Improve expression syntax - - Fix data type handling - - Replace hardcoded values with variables - - Improve node naming - - - Structure Improvements: - - Reorganize node positions - - Simplify complex branches - - Remove duplicate logic - - Optimize merge points - - Improve connection patterns - - - Best Practice Applications: - - Fix credential usage - - Address security issues - - Update deprecated nodes - - Improve data handling - - Update workflow settings - - - Validate optimized workflow: - - All node IDs remain unique - - All connections are valid - - No functionality is lost - - All improvements are applied - - - - Save optimized workflow to {{workflow_file}} - - - - - NEVER delete the file if validation fails - always fix syntax errors - - Run: node -e "JSON.parse(require('fs').readFileSync('{{workflow_file}}', 'utf8')); console.log('✓ Valid JSON')" - - - Read the error message carefully - it shows the syntax error and position - Open the file and navigate to the error location - Fix the syntax error (add missing comma, bracket, or quote as indicated) - Save the file - Re-run validation with the same command - Repeat until validation passes - - - Once validation passes, confirm with user: "Workflow optimized successfully at {{workflow_file}}" - - - - - Provide comprehensive summary: - - - ### Optimizations Applied - - Total changes: [count] - - Performance improvements: [list] - - Error handling added: [list] - - Code quality fixes: [list] - - Structure improvements: [list] - - Best practices applied: [list] - - Backup location: {{workflow_file}}.backup-{timestamp} - - ### Expected Improvements - - Execution speed: [estimated improvement] - - Reliability: [improvements] - - Maintainability: [improvements] - - Security: [improvements] - - ### Testing Recommendations - 1. Import optimized workflow into n8n - 2. Test with sample data - 3. Compare execution times with original - 4. Verify all functionality works correctly - 5. Monitor error rates - - - - ### Optimization Report - Report saved with all recommendations - No changes applied to workflow - Review recommendations and apply manually if desired - - - Ask: "Would you like additional help?" - Present numbered options: - 1. No - I'm done - 2. Yes - Explain specific optimizations - 3. Yes - Optimize another workflow - 4. Revert - Restore from backup - - WAIT for user selection (1-4) - - - Ask: "Which optimization would you like explained?" - WAIT for user input - Provide detailed explanation - - - - Return to Step 1 for new workflow - - - - Restore workflow from backup - Confirm restoration to user - - - - - Validate against checklist at {{validation}} using {{bmad_folder}}/core/tasks/validate-workflow.xml - - - -``` diff --git a/src/modules/bmm/workflows/autominator/optimize-workflow/workflow.yaml b/src/modules/bmm/workflows/autominator/optimize-workflow/workflow.yaml deleted file mode 100644 index b3310a10..00000000 --- a/src/modules/bmm/workflows/autominator/optimize-workflow/workflow.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: optimize-workflow -description: "Review and improve existing n8n workflows for performance and best practices" -author: "Saif" - -# Workflow components -installed_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/optimize-workflow" -shared_path: "{project-root}/{bmad_folder}/bmm/workflows/autominator/_shared" -instructions: "{installed_path}/instructions.md" -validation: "{installed_path}/checklist.md" - -# Shared resources -helpers: "{shared_path}/n8n-helpers.md" -templates: "{shared_path}/n8n-templates.yaml" -platform_mappings: "{shared_path}/platform-mappings.yaml" - -# Variables -variables: - workflow_file: "" # Will be elicited - optimization_focus: [] # Will be elicited - issues_found: [] # Will be identified - recommendations: [] # Will be generated - apply_changes: false # Will be elicited - backup_created: false # Will be set - context7_available: false # Will be checked - -default_output_file: "" # Will use existing file location - -standalone: true -web_bundle: false