Skip to content

Baseworks n8n CrewAI Architecture

Created 2026-02-18
Updated 2026-03-02
Status archived
Tags agent-systemarchitecturereferencearchived

ARCHIVED — 2026-03-02 This architecture has been superseded. CrewAI and OpenRouter have been replaced by Claude Code running natively on the OpenClaw VPS, authenticated via Patrick’s Claude Max account and Asia’s Claude Pro account. No API keys or OpenRouter usage going forward. See: Claude-Code-VPS-Setup

System paused. CrewAI container stopped, all n8n workflows deactivated. Migrating from CrewAI to OpenClaw. See Deployment-Log.md session 2026-02-25 for full context.

Local Obsidian Git syncs (Patrick + Ksenia → GitHub) are unaffected and running normally.


Patrick's Mac Ksenia's Mac
├── Claude Code ├── Claude Code
├── Claude Desktop (MCP) ├── Claude Desktop (MCP)
├── Obsidian (vault) ├── Obsidian (vault)
└── Browser → n8n UI └── Browser → n8n UI
│ │
└──── both push/pull via Git ─────┘
GitHub (private repo)
p-oancia/baseworks-kb-shared-brain
Hetzner VPS (xCloud)
167.235.236.99
baseworks-agents
├── n8n (Docker)
├── PostgreSQL (Docker)
├── CrewAI (Docker)
├── Remote MCP Server (Docker) [Phase 6]
├── Vault clone (/opt/baseworks-vault)
└── NGINX + Cloudflare Origin SSL
┌───────┴───────┐
Slack claude.ai
┌────────┴────────┐
Patrick's Ksenia's
iPhone iPhone
(Claude iOS) (Claude iOS)
[Phase 6]
PropertyValue
ProviderHetzner via xCloud
Server namebaseworks-agents
IP167.235.236.99
SpecCX33 — 4 vCPU / 8 GB RAM / 80 GB SSD
RegionFalkenstein, DE (Central)
OSUbuntu 24.04 LTS
StackDocker 29.2.1 + Compose v5.0.2 + NGINX 1.28.1
SSHssh patrick@167.235.236.99 (passwordless sudo)
BackupsHetzner auto snapshots (daily) + Backblaze B2 (to be configured)
ContainerImageInternal PortExternalStatus
baseworks-postgrespostgres:16-alpine5432127.0.0.1 onlyRunning
baseworks-n8nn8nio/n8n:latest5678https://n8n.baseworks.comRunning
baseworks-crewaicustom build8000127.0.0.1 only (n8n accesses via crewai:8000)Running

Docker Compose file: /opt/baseworks-vault/03-resources/agent-system/docker/docker-compose.yml Environment file: /opt/baseworks-vault/03-resources/agent-system/docker/.env

SubdomainRecordPoints toCloudflare ProxyPurpose
n8n.baseworks.comA167.235.236.99ONn8n workflow UI
mcp.baseworks.comA167.235.236.99(Phase 6)Remote MCP server

SSL: Cloudflare Origin Certificate (wildcard)

  • Covers: *.baseworks.com and baseworks.com
  • Expires: 2041-02-15
  • Certificate: /etc/ssl/cloudflare/baseworks.com.pem
  • Private key: /etc/ssl/cloudflare/baseworks.com.key
  • SSL mode: Full (strict) — do NOT change (affects all Baseworks sites)
  1. Patrick/Ksenia edits vault file locally
  2. Obsidian Git auto-commits (10 min) and pushes
  3. n8n “Vault Git Sync” workflow pulls every 5 min to /opt/baseworks-vault
  4. CrewAI crews read vault files as knowledge base on next execution

Note: The original root cron job for git sync was removed on 2026-02-20. The n8n Git Sync workflow is now the sole sync mechanism. This avoids root-owned files in .git/ that would break n8n container access.

  1. n8n workflow triggers CrewAI crew
  2. Crew produces output (draft, summary, etc.)
  3. n8n writes file to vault clone on VPS
  4. n8n commits and pushes to GitHub
  5. Both Macs auto-pull via Obsidian Git
  1. Webhook or poll detects new post → n8n
  2. n8n calls CrewAI Forum Response crew
  3. Classifier → Researcher → Drafter (sequential)
  4. n8n posts draft to Slack #forum-responses
  5. Patrick/Ksenia reviews → Approve/Edit/Reject
  6. On approve: n8n posts to forum, logs to vault
  1. Weekly cron (Monday 9 AM) → n8n
  2. n8n reads vault changes (last 7 days)
  3. n8n calls CrewAI Content Strategy crew
  4. Analyst → Strategist → Writer → Editor (sequential)
  5. n8n posts 3 proposals to Slack #content-strategy
  6. Approve/Edit/Reject per item
LayerLocationPurpose
OpenMemory (Qdrant)Patrick’s MacClaude Desktop conversation context
CrewAI memoryVPS Docker volumeAgent learning from task history
Obsidian vaultEverywhere (Git)Business knowledge, the source of truth

These are independent. The vault bridges them all.

Claude mobile apps support remote MCP servers added via claude.ai. This means phone conversations can interact directly with the agent infrastructure.

MethodHow it worksAvailable
Slack #vault-inboxCopy insight from Claude mobile → paste in Slack → auto-filed by CrewAIAfter Phase 3
Remote MCP ServerClaude mobile calls MCP tools directly (vault-capture, trigger-crew)After Phase 6
Conversation syncStart on phone → continue on Claude Desktop (MCP) at computerNow

A lightweight authenticated API on the VPS that exposes vault and crew operations as MCP tools. Registered on claude.ai, automatically available on all mobile devices logged into the same Anthropic account.

Endpoint: https://mcp.baseworks.com

ServiceInternal PortExternal
n8n5678https://n8n.baseworks.com (NGINX)
CrewAI API8000127.0.0.1 only (n8n accesses via Docker service name crewai:8000)
Remote MCP Server8001https://mcp.baseworks.com (NGINX) [Phase 6]
PostgreSQL5432127.0.0.1 only
  • UFW: Only ports 22, 80, 443 open (deny all incoming by default)
  • Fail2Ban: SSH protection (active)
  • SSH: Key-based only (password auth disabled), passwordless sudo for user patrick
  • SSL: Cloudflare Origin Certificate (wildcard, expires 2041)
  • Cloudflare: Proxy ON (DDoS protection, edge SSL)
  • Docker: All ports bound to 127.0.0.1
  • NGINX: Reverse proxy for all external access
  • Unattended upgrades: Enabled (automatic security patches)
  • Git: PAT-based auth (token: “Baseworks-agents-VPS”, expires ~2026-05-19)
  • n8n: Username/password auth (owner: agents@baseworks.com)

Security verified after xCloud reboot on 2026-02-20 — no gaps found.

Important: From within n8n (Docker), access CrewAI at http://crewai:8000 (Docker service name), NOT 127.0.0.1:8000. Localhost inside a container refers to that container only.

GET /health — Service health check
GET /status — List running tasks
POST /crews/forum-response — Draft response to forum post
POST /crews/content-strategy — Generate content proposals
POST /crews/research — Research a topic using vault
POST /crews/vault-capture — Suggest vault filing location
POST /stop — Kill switch (cancel all crews)
#WorkflowIDTriggerUses CrewAIStatus
01WordPress Monitoring1uUisQfjZ0TUqiM4Cron (6h)NoINACTIVE — needs WP_URL + HTTP Basic Auth
02Forum Response PipelineshLtsDHV6zIqySZ0Webhook/PollYesINACTIVE — needs FORUM_API_URL
03Content Creation Pipelineq1eV3z1aQs9VWh67Weekly (Mon 9AM)YesACTIVE
04Kill Switchv4T9Xu39sxR5CJnBSlack message (via Event Router)Yes (stop endpoint)ACTIVE
05Daily Vault Summary3QEX4wna4XMr348KCron (daily 8AM Berlin)NoACTIVE
06Vault Capture via SlackA0hTmPJN38HRe3ChSlack message (via Event Router)YesACTIVE
07Vault Git SyncOh75ZJIJiIZreS06Cron (5min)NoACTIVE
Slack Event RouterfcsJFL21APR2uyV9Slack Event Subscriptions webhookNoACTIVE

Slack only allows one Request URL per app for Event Subscriptions. The Slack Event Router workflow receives all Slack events at https://n8n.baseworks.com/webhook/slack-events and dispatches them to the correct workflow based on channel ID:

Source ChannelRoutes To
#agent-alerts (C0AGFM6AZ09)Kill Switch
#vault-inbox (C0AG0MWBP5L)Vault Capture

The router also handles Slack’s URL verification challenge (responds with the challenge value).