# 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 (Research n8n Documentation for Migration)
Note what you already know
Only ask about missing information in Step 1
Proceed with full elicitation in Step 1
Understand the BUSINESS PURPOSE of the workflow being migrated, not just technical details
Ask Question 1: "What does this workflow do? What problem does it solve?"
Encourage business context: "Describe the business process, not just the technical steps"
WAIT for user input
Store in {{business_purpose}}
Ask Question 2: "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 3: "Why are you migrating to n8n?"
Examples: "Cost savings", "More flexibility", "Self-hosting", "Better integrations"
WAIT for user input
Store in {{migration_reason}}
Ask Question 4: "How will you provide the workflow details?"
Present numbered options:
1. Describe the process - Explain what happens step by step
2. Provide export file - Upload/paste workflow export file
3. Provide screenshots - Share workflow screenshots
4. Combination - Multiple sources
WAIT for user selection (1-4)
Ask: "Describe the workflow step by step:"
- What triggers it?
- What data does it process?
- What actions does it take?
- What's the final outcome?
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 what each part does"
WAIT for user input
Store in {{workflow_screenshots}}
Ask Question 5: "What services/integrations does this workflow connect to?"
Ask: "List all services (e.g., Slack, Google Sheets, HubSpot, custom APIs, etc.)"
WAIT for user input
Store in {{integrations_used}}
Ask Question 6: "Are there any pain points or issues with the current workflow?"
Examples: "Slow execution", "Unreliable", "Missing features", "Hard to maintain"
Present numbered options:
1. No - Works fine, just migrating platform
2. Yes - Describe the issues
WAIT for user selection (1-2)
Ask: "What issues should we fix during migration?"
WAIT for user input
Store in {{issues_to_fix}}
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}}
Search for n8n documentation relevant to migration requirements
Inform user: "Researching n8n documentation for migration from {{source_platform}}..."
Perform web search for:
1. n8n equivalents for {{source_platform}} features
2. Integration nodes: {{integrations_used}}
3. Migration best practices
4. Platform-specific considerations
Search queries to use:
- "n8n migrate from [source_platform]"
- "n8n [integration] node documentation"
- "n8n vs [source_platform] comparison"
- "n8n workflow migration guide"
Focus on official n8n documentation at docs.n8n.io
Store relevant migration patterns and node configurations
Summarize migration strategy based on documentation:
- n8n equivalents for {{source_platform}} features
- Required node types and configurations
- Data transformation needs
- Any migration challenges or limitations
Inform user: "Based on n8n documentation, I've identified the migration path from {{source_platform}}."
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
```