Ep 28: Git Collaboration — Workflow Version Control & Multi-Env Deployment
Version Control Is Essential
Workflows are code — no version control = flying blind.
graph LR
Dev["🟢 Dev"] -->|"git push"| Staging["🟡 Staging"]
Staging -->|"git push"| Prod["🔴 Production"]
style Dev fill:#22c55e,stroke:#16a34a,color:#fff
style Staging fill:#f59e0b,stroke:#d97706,color:#fff
style Prod fill:#ef4444,stroke:#dc2626,color:#fff1. Source Control Setup
# Settings → Source Control:
# Repository: [email protected]:your-org/n8n-workflows.git
# Branch: main (or dev/staging/prod)
# Actions: Push (n8n → Git), Pull (Git → n8n)
2. Environment Variable Isolation
// ❌ Hardcoded: const apiUrl = "https://api.company.com"
// ✅ Environment: const apiUrl = $env.API_URL
// Dev: gpt-4o-mini (cheap) → Prod: gpt-4o (powerful)
3. Team Workflow
sequenceDiagram
Dev1->>Git: Push feature branch
Dev2->>Git: Review & Approve PR
Git->>Staging: Auto-deploy
Note over Staging: Integration tests pass
Staging->>Prod: Manual Pull → Canary → Full release4. Naming Conventions
// Format: [domain]_[function]_[version]
// crm_lead_scoring_v2, ai_rag_knowledge_query
// _sub_email_sender (underscore prefix = sub-workflow)
// Tags: "production", "ai-agent", "owner:alice"
Next Episode
Ep 29: Multi-Agent collaboration — Supervisor Agent managing specialist Agent teams.