n8n-nodes-claude-chat
v0.2.5
Published
n8n community node for Claude Chat - Conversational AI powered by Claude Agent SDK with skills support
Maintainers
Readme
n8n-nodes-claude-chat
🤖 n8n community node for Claude Chat - Conversational AI powered by Claude Agent SDK
This node enables conversational AI interactions in n8n workflows using Anthropic's Claude models via the official Claude Agent SDK. It supports multi-turn conversations, skill-based personalities (like humorous chat), and advanced features like tool usage and budget management.
Features
- 🎯 Claude Agent SDK Integration - Native SDK support for advanced agentic capabilities
- 😄 Humorous Chat Mode - Built-in skill for witty, fun, and entertaining responses
- 💬 Multi-turn Conversations - Maintain conversation history across workflow executions
- 🛠️ Skills Support - Extensible skill system for custom AI behaviors
- 💰 Budget Management - Set maximum spending limits per execution
- 🔒 Permission Controls - Fine-grained control over AI tool usage
Installation
Via n8n Community Nodes (Recommended)
- Go to Settings > Community Nodes
- Click Install a community node
- Enter
n8n-nodes-claude-chat - Click Install
Manual Installation
cd ~/.n8n/custom
npm install n8n-nodes-claude-chatLocal Development
# Build the package
npm run build
# Link to global
npm link
# In n8n directory, link the package
cd ~/.n8n
npm link n8n-nodes-claude-chat
# Restart n8nSetup
1. Create Anthropic API Credentials
- Go to Anthropic Console
- Create an API key
- In n8n, go to Credentials > New Credential
- Select Anthropic API
- Enter your API key
2. Add the Node to Your Workflow
- Search for "Claude Chat" in the nodes panel
- Drag it into your workflow
- Connect your credentials
- Configure the node settings
Node Configuration
Chat Mode
| Mode | Description | |------|-------------| | Standard | Normal helpful AI assistant | | 😄 Humorous | Fun, witty responses with jokes, puns, and emojis |
Model Selection
| Model | Best For | Cost | |-------|----------|------| | Haiku | Fast responses, simple tasks | $ | | Sonnet 4.5 | Balanced performance (default) | $$ | | Opus 4.5 | Complex reasoning, best quality | $$$ |
Options
| Option | Description | Default | |--------|-------------|---------| | System Prompt | Custom instructions for Claude | Auto based on mode | | Temperature | Response creativity (0-1) | 0.7 | | Max Tokens | Maximum response length | 1024 | | Max Budget (USD) | Cost limit per execution | $1.00 | | Conversation Mode | Maintain chat history | Off | | Enable Skills | Load Claude Agent SDK skills | On | | Permission Mode | Tool access control | Default |
Example Usage
Basic Chat
{
"chatMode": "standard",
"prompt": "What is the capital of France?",
"model": "sonnet"
}Output:
{
"response": "The capital of France is Paris...",
"success": true,
"model": "claude-sonnet-4-5-20250514",
"usage": {
"inputTokens": 15,
"outputTokens": 42,
"totalTokens": 57,
"estimatedCostUsd": 0.0007
}
}Humorous Chat
{
"chatMode": "humorous",
"prompt": "Tell me about JavaScript",
"model": "sonnet"
}Output:
{
"response": "Ah, JavaScript! 🎭 The language that decided 'undefined' and 'null' should both exist, just to keep developers on their toes! ...",
"chatMode": "humorous",
"metadata": {
"skillsEnabled": true,
"availableSkills": ["humorous-chat"]
}
}Multi-turn Conversation
Enable Conversation Mode to maintain context:
Turn 1: "My name is Alice"
Turn 2: "What is my name?"
→ "Your name is Alice!"Skills System
This node leverages the Claude Agent SDK's skill system. Skills are loaded from .claude/skills/ directory.
Included Skills
humorous-chat
Enables witty, playful conversation style with:
- Puns and wordplay
- Emoji usage 😄🎉💡
- Lighthearted self-aware AI humor
- Balanced humor (helpful first, funny second)
Creating Custom Skills
Create a skill in .claude/skills/my-skill/SKILL.md:
---
name: my-skill
description: Brief description of what this skill does and when to use it.
---
# My Skill
Instructions and examples for the skill...API Response
interface ClaudeChatOutput {
response: string; // AI response text
success: boolean; // Whether the request succeeded
chatMode: string; // 'standard' | 'humorous'
model: string; // Full model ID
usage: {
inputTokens: number;
outputTokens: number;
totalTokens: number;
estimatedCostUsd: number;
};
metadata: {
duration: number; // Execution time (ms)
sessionId: string; // Conversation session ID
skillsEnabled: boolean;
availableSkills: string[];
conversationMode: boolean;
turnCount: number; // Number of conversation turns
};
}Error Handling
The node handles various error scenarios:
| Error | Handling | |-------|----------| | Rate Limit | Automatic retry with backoff | | Authentication | Clear error message with guidance | | Budget Exceeded | Stops execution, reports cost | | SDK Unavailable | Falls back to direct API |
Enable Continue On Fail to handle errors gracefully in workflows.
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run dev
# Run tests
npm test
# Create package
npm packPublishing
See NPM_PUBLISHING.md for detailed instructions on publishing to npm registry.
Requirements
- n8n >= 1.0.0
- Node.js >= 18.0.0
- Anthropic API key
License
MIT
