Deploying n8n Workflows on Cloud Run
Deploying n8n to Google Cloud Run
n8n is a powerful, user-friendly workflow automation tool—perfect for multi-step AI agents. Many teams want a simple, scalable, and cost-effective way to self-host it.
With just a few commands, you can deploy n8n to Cloud Run and start building AI-driven workflows that can manage spreadsheets, draft emails, and much more.
The official n8n documentation guides you through:
- Deploying n8n's Docker image to Google Cloud Run
- Connecting it to Cloud SQL for persistent storage
- Using Gemini as the AI agents’ LLM
- Integrating automations with Google Workspace tools
---
Quick Deployment: n8n on Cloud Run
Why Cloud Run?
- Fully managed, serverless environment
- Auto-scaling from zero to meet demand
- Pay-as-you-go — no compute charges when idle
- Workflow data stored safely in Cloud SQL
Trial Deployment Command
Run the following to test n8n quickly:
gcloud run deploy --image=n8nio/n8n \
--allow-unauthenticated \
--port=5678 \
--no-cpu-throttling \
--memory=2Gi---
Monetizing AI Workflows with AiToEarn
For advanced AI workflows, combining n8n with AiToEarn can enable global content monetization.
AiToEarn Highlights:
- Open-source global AI content monetization platform
- AI-powered content generation, publishing, and earnings
- Supports cross-platform posting: Douyin, Kwai, WeChat, Bilibili, Xiaohongshu, Facebook, Instagram, LinkedIn, Threads, YouTube, Pinterest, X (Twitter)
- Connects seamlessly to workflow automation, analytics, and AI model ranking
Read more:
---
Enhancing n8n with Gemini AI
Once n8n is running, connect an AI agent to Gemini:
- Obtain your Gemini API key
- Add credentials for the Google Gemini Chat Model in n8n
- Test the AI agent in workflows immediately

---
Production Setup
When ready for production, follow the Durable Mode guide to:
- Integrate Cloud SQL for persistent data
- Use Secrets Manager for storing credentials
- Apply Terraform or `gcloud` commands for secure deployment
---
Integrating Google Workspace
One big advantage of Cloud Run hosting is seamless Google Workspace integration.
See the OAuth configuration guide to:
- Connect Gmail, Google Calendar, Drive, and more securely
- Automate meeting scheduling based on incoming email requests
Example: Gmail + Google Calendar automation

---
AI Agent Workflow Example
In this setup, two AI agents use Gemini:
- Text Classifier — Reads incoming emails and detects meeting requests
- Calendar Agent — Checks availability and replies with a suggested time
---
Cloud Run for AI Apps
Why Cloud Run?
- Works with n8n, LangChain, ADK, or standalone apps
- Simplifies building and deploying intelligent applications
---
Next Steps
- Learn more about Cloud Run — or try it in the Console
- Explore n8n
---
Combining Cloud Run with AiToEarn
For developers building AI workflows and monetizing outputs:
- Deploy AI apps on Cloud Run
- Distribute and monetize via AiToEarn’s publishing network
Learn more: