Skip to content

0037: n8n Self-hosted vs Cloud Hosted

Status

Deferred - Reviewed and Approved, though the actual option chosen won't necessarily be implemented until we merge in the ADR for Security Guidelines for Data and AI.

Context

Our organization has been increasingly adopting n8n for workflow automation and integration tasks. As our usage grows, we should make a strategic decision about whether to continue using n8n's cloud-hosted service or migrate to a self-hosted solution on our own infrastructure.

Current Situation

  • We currently use n8n through their cloud platform
  • Usage has been growing steadily across multiple teams
  • We have concerns about data privacy, cost scaling, and vendor lock-in
  • Our AWS infrastructure is well-established and capable of hosting n8n

Decision Drivers

  1. Cost Optimization: Evaluate long-term cost implications as usage scales
  2. Data Privacy & Compliance: Need to ensure sensitive data remains within our control
  3. Performance: Reduce latency for internal integrations
  4. Customization: Ability to modify and extend n8n functionality
  5. Infrastructure Control: Leverage existing AWS expertise and infrastructure

Considered Options

Option 1: Continue with n8n Cloud Hosted

Description: Maintain current cloud-hosted n8n service

  • Pros:
  • Zero infrastructure management
  • Automatic updates and maintenance
  • Built-in monitoring and reliability
  • Quick setup and deployment
  • Cons:
  • Monthly subscription costs that scale with usage
  • Data processed through third-party infrastructure
  • Limited customization options
  • Dependency on external service availability

Option 2: Self-host on AWS using Kubernetes

Description: Deploy n8n using Kubernetes on AWS EKS

  • Pros:
  • Full control over infrastructure and data
  • Scalable and resilient architecture
  • Integration with existing Kubernetes ecosystem
  • Cost-effective for high usage scenarios
  • Cons:
  • Requires Kubernetes expertise
  • More complex initial setup
  • Ongoing maintenance responsibility

Option 3: Self-host on AWS using EC2

Description: Deploy n8n on AWS EC2 instances

  • Pros:
  • Simpler deployment model
  • Direct control over compute resources
  • Familiar infrastructure management
  • Cons:
  • Manual scaling and failover management
  • Higher operational overhead
  • Less resilient than containerized solutions

Option 4: Self-host on AWS using Docker Compose

Description: Deploy n8n using Docker Compose on EC2

  • Pros:
  • Simplified container orchestration
  • Easy local development parity
  • Quick deployment and updates
  • Cons:
  • Limited to single-node deployment
  • Manual scaling challenges
  • Not suitable for high availability requirements

Decision

Host on AWS using Kubernetes

We will migrate from n8n's cloud-hosted service to a self-hosted solution using Kubernetes on AWS EKS.

Consequences

Positive Consequences

Data Privacy and Security

  • Complete data sovereignty: All workflow data, credentials, and execution logs remain within our infrastructure
  • Compliance advantages: Ideal for industries with strict compliance requirements (HIPAA, GDPR, SOC 2)
  • Reduced third-party risk: Eliminates dependency on n8n's security practices and data handling policies
  • Audit trail control: Full visibility into data access and processing

Cost Optimization

  • Eliminated subscription fees: No monthly costs based on workflow count or execution volume
  • Predictable infrastructure costs: AWS costs are more predictable and can be optimized
  • Economies of scale: Cost per execution decreases as usage increases
  • Resource optimization: Ability to right-size infrastructure based on actual needs

Performance and Reliability

  • Reduced latency: Direct access to internal databases, APIs, and services
  • Network optimization: Eliminates external network dependencies
  • Custom monitoring: Integration with existing monitoring and alerting systems
  • High availability: Kubernetes provides built-in redundancy and failover capabilities

Customization and Extensibility

  • Code modifications: Ability to modify n8n source code for custom requirements
  • Custom integrations: Direct integration with existing internal services
  • Version control: Ability to stay on specific versions or apply custom patches
  • Plugin development: Freedom to develop and deploy custom nodes

Operational Benefits

  • Infrastructure consistency: Leverages existing Kubernetes expertise and tooling
  • CI/CD integration: Seamless integration with existing deployment pipelines
  • Backup and recovery: Integration with existing backup strategies
  • Resource management: Better control over compute and storage allocation

Negative Consequences

Operational Overhead

  • Maintenance responsibility: We must handle all updates, security patches, and bug fixes
  • Infrastructure management: Ongoing monitoring, scaling, and troubleshooting
  • Expertise requirements: Need for Kubernetes and n8n operational knowledge
  • Time investment: Additional DevOps time for setup and ongoing maintenance

Complexity and Risk

  • Initial setup complexity: More complex deployment and configuration process
  • Learning curve: Team needs to understand n8n's internal architecture
  • Troubleshooting challenges: More complex debugging without vendor support
  • Integration testing: Need to test all custom modifications and integrations

Resource Requirements

  • Infrastructure costs: AWS EKS, compute, storage, and networking costs
  • Human resources: Dedicated time for maintenance and support
  • Monitoring tools: Additional monitoring and alerting infrastructure
  • Backup systems: Comprehensive backup and disaster recovery planning

Vendor Support Limitations

  • No vendor support: Cannot rely on n8n's support team for issues
  • Community reliance: Dependence on community forums and documentation
  • Update delays: May lag behind latest n8n releases for stability
  • Feature availability: May miss out on cloud-only features

Implementation Plan


Phase 1: Infrastructure Setup

  • Set up Kubernetes cluster on AWS EKS
  • Configure persistent storage and networking
  • Deploy n8n with basic configuration
  • Set up monitoring and logging

Phase 2: Migration Planning

  • Audit current workflows and integrations
  • Plan data migration strategy
  • Test connectivity with internal services
  • Develop rollback procedures

Phase 3: Pilot Deployment

  • Deploy n8n in staging environment
  • Migrate subset of workflows for testing
  • Validate performance and functionality
  • Gather feedback from users

Phase 4: Production Migration

  • Execute full production migration
  • Monitor system performance and stability
  • Provide user training and documentation
  • Establish ongoing maintenance procedures

Notes

Technical Considerations

  • n8n requires PostgreSQL database for production use
  • Kubernetes deployment should include proper resource limits and requests
  • Consider using AWS RDS for managed PostgreSQL
  • Implement proper secrets management for API keys and credentials

Security Considerations

  • Implement network policies to restrict access
  • Use AWS IAM roles for service authentication
  • Encrypt data at rest and in transit
  • Regular security updates and vulnerability scanning

Monitoring and Alerting

  • Set up comprehensive logging with ELK stack or similar
  • Monitor resource usage, performance metrics, and error rates
  • Implement alerting for critical failures
  • Regular backup testing and disaster recovery drills

References

Original Author

Dakota Washok

Approval Date

2025-10-13

Approved By

Team during engineering lead meeting

Pending


Appendix

Cost Comparison Analysis

Component Cloud Hosted (Monthly) Self-Hosted (Monthly)
n8n Subscription $20-200+ $0
AWS EKS - $73.00
EC2 Instances - $150-300
RDS PostgreSQL - $50-100
Load Balancer - $20-30
Storage - $10-20
Total $20-200+ $303-573

Note: Enterprise costs would be much more than $20-200 Note: Self-hosted costs are estimates based on typical usage patterns. Actual costs may vary.

Risk Assessment Matrix

Risk Probability Impact Mitigation
Infrastructure failure Medium High Multi-AZ deployment, monitoring
Data loss Low High Regular backups, testing
Security breach Low High Security scanning, access controls
Performance issues Medium Medium Resource monitoring, scaling
Maintenance overhead High Medium Automation, documentation