{ "name": "n8n (Codespaces agent sessions)", "dockerComposeFile": "docker-compose.yml", "service": "n8n", // Codespaces clones the repo into /workspaces/, unlike the laptop config "workspaceFolder": "/workspaces/n8n", "hostRequirements": { "cpus": 8, "memory": "32gb", "storage": "64gb" }, "features": { "ghcr.io/devcontainers/features/github-cli:1": {}, // gh codespace ssh needs an SSH server inside the container "ghcr.io/devcontainers/features/sshd:1": {}, // Docker for testcontainers and `pnpm --filter n8n-containers services`; // needs `privileged: true` on the n8n service (compose-based config) "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, "forwardPorts": [8080, 5678, 8787], "portsAttributes": { "8787": { "label": "agent-broker" } }, // Runs in prebuilds, so a fresh codespace starts with deps installed and the build warm "onCreateCommand": "corepack install && pnpm install && (pnpm build > /tmp/build.log 2>&1 || tail -n 50 /tmp/build.log) && pnpm --filter=n8n-playwright exec playwright install chromium", // Start the broker on each container start. `bash -lc` loads the secrets shim, so the // broker gets AGENT_BROKER_TOKEN. tmux detaches it, so it does not block startup. "postStartCommand": "tmux new-session -d -s broker 'bash -lc \"node /workspaces/n8n/.devcontainer/codespaces/agent-broker.mjs >> /tmp/agent-broker.log 2>&1\"' || true", "secrets": { "ANTHROPIC_API_KEY": { "description": "Anthropic API key for Claude Code / OpenCode sessions" }, "AGENT_BROKER_TOKEN": { "description": "Bearer token the agent broker requires on every request (see .devcontainer/codespaces/agent-broker.mjs)" }, "CLAUDE_CODE_OAUTH_TOKEN": { "description": "Alternative to an API key: token from `claude setup-token` (Max subscription)" }, // Both set at the repository level — team members get them automatically "FLAKY_MCP_TOKEN": { "description": "Bearer token for the Flaky (QA assistant) MCP endpoint" }, "FLAKY_MCP_URL": { "description": "URL of the Flaky MCP endpoint on the internal n8n instance" } } }