Claude Managed Agents + N8N: Full Production Tutorial
Bart Slodyczka walks through the complete Claude Managed Agents workflow: building a customer support chatbot in the console, testing it with the built-in testing panel, and deploying it as a live service using N8N as the frontend. The tutorial covers the four API calls required for N8N integration, session management across multiple customers, credential vault setup, and environment configuration.
"Claude Managed Agents Full Tutorial: How to Setup Your First AI Agent" by Bart Slodyczka — Watch on YouTube →
Key Takeaways
- Managed agents use API credits, not Claude subscriptions — billed at $0.08 per session hour, but only while the agent is actively running. Idle time waiting for user replies costs nothing.
- Sessions provide isolation: create one session per customer conversation. Each session holds the full conversation context privately. One agent can serve unlimited concurrent customers this way.
- N8N integration requires 4 API calls in sequence: (1) create session, (2) send message with the customer's text, (3) wait ~15 seconds for processing, (4) list all session messages and extract the latest agent response.
- Store OAuth credentials (ClickUp, Slack, etc.) in the Credential Vault — vault IDs are passed when creating sessions, so the agent can use your connected tools without credentials appearing in the prompt.
- Set network access to Limited and restrict domains when your agent only needs to access specific URLs (e.g., your own product site for FAQ lookups). This improves security and is Anthropic's recommended default.
The N8N Integration Pattern
The core workflow Bart builds routes N8N's native web chat interface through the Claude Managed Agents API:
- Check session database: On each incoming message, look up whether the N8N session ID maps to an existing Claude session ID in your database (SQLite works fine).
- New conversation: If no mapping exists, call the
POST /agents/{agent_id}/sessionsendpoint with your agent ID, environment ID, and vault ID. Store the returned Claude session ID against the N8N session ID. - Existing conversation: If a mapping exists, skip session creation and use the stored Claude session ID directly.
- Send message: Call
POST /sessions/{session_id}/messageswith the user's text as the message body. - Wait and retrieve: Wait ~15 seconds (production systems should use a proper polling loop), then call
GET /sessions/{session_id}/eventsto list all messages. Extract the most recent agent response and return it to the user.
The N8N workflow Bart builds is 10 nodes total. Once session creation is wired up, the existing and new session paths share the same send/wait/retrieve nodes.
Agent Configuration Concepts
Managed agents in the console have four configuration objects to understand:
- Agent: The system prompt, model choice, skills, and MCP server connections. You can have multiple agents for different use cases (customer support, invoice processing, competitor research).
- Environment: The cloud container configuration — network access rules, installed packages, environment variables. One environment can be shared across multiple agents or kept dedicated per agent.
- Session: A single conversation thread. Sessions are the unit of billing; they start running when you send a message and go idle when the agent finishes. Each customer or task run gets its own session.
- Credential Vault: Stores OAuth connections (ClickUp, Slack, GitHub, etc.) that can be shared across agents and team members. Pass vault IDs when creating sessions to give agents access to your connected tools.
Related on OpenClawDatabase
- Claude Cowork Setup Guide — getting started with Claude's official agent interface
- Claude Managed Agents Reviewed — Nate Herk's honest assessment of what managed agents do and don't do well
- OpenClaw Guide — alternative agent runtime for more self-hosted control
← Back to News digest · See also: Claude Cowork guide