Skip to content

n8n Automation

Access

URL https://automate.camlab.dev
Container n8n
Port 127.0.0.1:5678
Image n8n-claude:latest (custom — n8n + Docker CLI)

Note: The URL is automate.camlab.dev, not n8n.camlab.dev. Chrome flags the n8n subdomain.

Workflows

Three Writer's Room workflows, one per blog, staggered to avoid resource contention:

Workflow Blog Schedule (UTC) Runner Container
Cam4 Writer's Room Cam4 6:00 AM runner-cam4
Cam4Models Writer's Room Cam4Models 8:00 AM runner-cam4models
Cam4Pays Writer's Room Cam4Pays 10:00 AM runner-cam4pays

Pipeline (16 nodes per workflow)

graph LR
    S["Schedule<br>Trigger"] --> R["Researcher"]
    R --> B["Blogger"]
    B --> P["Photographer"]
    P --> O["Optimizer"]
    O --> H["Humanizer"]
    H --> Pub["Publisher"]

Each agent node uses the Claude Code community node to docker exec into the appropriate runner container.

Data Flow: Trigger to Published Post

graph LR
    cron["n8n Schedule<br>Trigger"] --> exec["docker exec<br>into runner"]
    exec --> research["Researcher<br>reddit-mcp"]
    research --> write["Blogger<br>writes article"]
    write --> images["Photographer<br>runware-mcp"]
    images --> seo["Optimizer<br>SEO pass"]
    seo --> polish["Humanizer<br>natural tone"]
    polish --> publish["Publisher<br>ghost-mcp → Ghost"]

Custom Docker Image

The n8n image is built from ./n8n/Dockerfile.claude:

FROM docker:29-cli AS docker-cli
FROM n8nio/n8n:latest
USER root
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker

This adds the Docker CLI so n8n can docker exec into runner containers via the mounted Docker socket.

Data Persistence

n8n data (database, credentials, workflow state) persists at:

/opt/camlab/n8n/data/ → /root/.n8n (inside container)

Important: The container runs as user: root, so the data path is /root/.n8n, not /home/node/.n8n.

Ghost Image Access

n8n has direct write access to Ghost image directories (no SSH needed):

./ghost/cam4/images      → /ghost-images/cam4
./ghost/cam4models/images → /ghost-images/cam4models
./ghost/cam4pays/images   → /ghost-images/cam4pays

Credentials

Workflow credentials are stored encrypted in the n8n database (encrypted with N8N_ENCRYPTION_KEY).

All 27 Claude Code nodes (9 per workflow) are mapped to their respective credentials in n8n.

Environment Variables

Variable Purpose
N8N_HOST Public hostname (automate.camlab.dev)
N8N_PORT Internal port (5678)
N8N_PROTOCOL https
WEBHOOK_URL Webhook base URL
N8N_ENCRYPTION_KEY Encrypts stored credentials
N8N_API_KEY REST API authentication
N8N_LOG_LEVEL Log verbosity (default: info)
N8N_PROXY_HOPS Trust Caddy reverse proxy headers (1 hop)

Common Operations

cd /opt/camlab

# View logs
docker compose logs --tail 100 n8n

# Restart
docker compose restart n8n

# Export a workflow
docker exec n8n n8n export:workflow --id=<id> --output=/projects/export.json

# Import a workflow
docker exec n8n n8n import:workflow --input=/projects/workflow.json

# List workflows
docker exec n8n n8n list:workflow

# Activate a workflow
docker exec n8n n8n update:workflow --id=<id> --active=true

Community Node

The n8n-nodes-claude-code community node is installed for Claude Code integration. It provides the "Claude Code" node type used in all workflows.

Install location: /root/.n8n/nodes/ inside the container.