Skip to content

Marvin-Cypher/phala-n8n-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n8n on Phala Cloud

Deploy n8n workflow automation platform on Phala Cloud's secure, TEE-protected infrastructure.

What is n8n?

n8n is a powerful workflow automation tool that allows you to connect different services and automate tasks. With n8n, you can:

  • Create complex workflows with a visual interface
  • Connect to 400+ services and APIs
  • Process data, send notifications, and automate business processes
  • Self-host with full control over your data

Why Deploy on Phala Cloud?

  • Confidential Computing: Your workflows run in secure TEE environments
  • Data Privacy: Sensitive API keys and data are protected by hardware-level encryption
  • Always On: Reliable cloud infrastructure with automatic scaling
  • Easy Deployment: One-click deployment with Phala CLI

Quick Start

Prerequisites

  • Phala CLI installed
  • Phala Cloud account with API key
  • Docker installed (for local development)

Deploy to Phala Cloud

  1. Clone this template

    git clone https://github.com/your-repo/phala-n8n-template.git
    cd phala-n8n-template
  2. Configure environment variables

    cp .env.example .env
    # Edit .env with your credentials
  3. Deploy with Phala CLI

    # Login to Phala Cloud
    phala auth login
    
    # Deploy n8n
    phala cvms create --name my-n8n --compose docker-compose.yml --env-file .env
  4. Access your n8n instance

    • Your n8n URL will be provided after deployment
    • Login with the credentials from your .env file
    • Start building workflows!

Configuration

Environment Variables

Variable Description Required
N8N_USER Admin username Yes
N8N_PASSWORD Admin password Yes
N8N_ENCRYPTION_KEY Encryption key for credentials Yes
OPENAI_API_KEY OpenAI API key for AI workflows No
GOOGLE_OAUTH_CLIENT_ID Google OAuth client ID No
GOOGLE_OAUTH_CLIENT_SECRET Google OAuth client secret No

OAuth Setup (Google/Gmail)

For Gmail integration:

  1. Go to Google Cloud Console
  2. Create OAuth 2.0 credentials
  3. Add your n8n URL as authorized redirect URI:
    https://your-instance-domain.dstack-prod10.phala.network/rest/oauth2-credential/callback
    
  4. Add the client ID and secret to your .env file

Management Commands

# List deployments
phala cvms list

# Get deployment details
phala cvms get your-app-id

# Update deployment
phala cvms upgrade your-app-id --compose docker-compose.yml --env-file .env

# Stop deployment
phala cvms stop your-app-id

# Start deployment
phala cvms start your-app-id

# Delete deployment
phala cvms delete your-app-id

Common Use Cases

Email Automation

  • Gmail lead detection and CRM integration
  • Automated email responses
  • Email parsing and data extraction

Communication

  • Slack/Discord notifications
  • Telegram bots
  • SMS alerts via Twilio

Data Processing

  • API data synchronization
  • File processing and conversion
  • Database operations

AI Workflows

  • OpenAI integration for content generation
  • Document analysis and summarization
  • Automated decision making

Security Features

TEE Protection

Your n8n instance runs in Phala Cloud's Trusted Execution Environment (TEE), providing:

  • Hardware-level encryption of sensitive data
  • Isolated execution environment
  • Tamper-proof workflow execution

Credential Security

  • API keys encrypted with TEE protection
  • Secure credential storage in n8n vault
  • No plain-text secrets in logs or memory dumps

Troubleshooting

OAuth Issues

If OAuth callbacks fail:

  1. Verify the redirect URI in your OAuth provider
  2. Ensure it matches your Phala Cloud domain exactly
  3. Check that DSTACK_GATEWAY_DOMAIN is properly set

Workflow Execution Issues

  • Check the execution logs in n8n UI
  • Verify API credentials are correctly configured
  • Ensure required environment variables are set

Performance Optimization

  • Use webhooks instead of polling when possible
  • Implement proper error handling in workflows
  • Monitor execution times and optimize bottlenecks

Support

Contributing

We welcome contributions to improve this template:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This template is released under the MIT License.

About

n8n workflow automation template for Phala Cloud with TEE protection and secure OAuth handling

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages