n8n Integration
Connect Zihin to n8n for no-code LLM automation workflows with intelligent model routing, tool calling, and media processing.
Installation
Community Nodes (Recommended)
- In n8n: Settings → Community Nodes → Install
- Search for
n8n-nodes-zihin - Click Install
npm (Self-hosted)
npm install n8n-nodes-zihin
Requires n8n >= 1.20.0 and Node.js >= 18.
Credential Setup
- Get your API Key at console.zihin.ai → Settings → API Keys
- In n8n: Credentials → Add Credential → Zihin API
- Enter your API Key
The credential is validated automatically against the Zihin API.
Available Nodes
| Node | Type | Purpose |
|---|---|---|
| Zihin Chat Model | AI Sub-node | LLM with tool calling for AI Agent workflows |
| Zihin | App Node | Standalone media processing (image, audio, document) |
| Zihin Image Tool | AI Tool | Vision AI analysis — auto-discovered by AI Agents |
| Zihin Audio Tool | AI Tool | Speech-to-text — auto-discovered by AI Agents |
| Zihin Document Tool | AI Tool | Document parsing — auto-discovered by AI Agents |
Workflow: AI Agent with Tool Calling
The most common pattern — an AI Agent powered by Zihin with access to tools:
[Chat Trigger] → [AI Agent] ← Zihin Chat Model
↑
[Tools]
├── Calculator
├── HTTP Request
├── Zihin Image Tool
└── Zihin Document Tool
Steps:
- Add a Chat Trigger node
- Add an AI Agent node and connect the trigger
- Under Chat Model, select Zihin Chat Model
- Model:
auto(intelligent routing) or a specific model - Task Type: select based on your use case
- Model:
- Under Tools, add any tools the agent should use
- Execute and test
Set Model to auto and select the appropriate Task Type — Zihin automatically picks the best provider and model for the task.
Workflow: Media Processing
Process images, audio, or documents without an AI Agent:
[Webhook Trigger] → [Zihin] → [Set Node] → [Respond to Webhook]
Example — Transcribe uploaded audio:
- Add a Webhook node (receive file URL)
- Add a Zihin node
- Resource: Audio
- Operation: Transcribe
- Audio:
{{ $json.audioUrl }} - Language:
pt
- Process the transcription downstream
The media tools are also auto-discovered by n8n's AI Agent framework — add them under Tools and the agent invokes them when needed.
Task Types
When using model: auto, the task type helps Zihin route to the optimal model:
| Task Type | Value | Best For |
|---|---|---|
| General Chat | chat_general | Conversations, Q&A |
| Writing | write | Content creation, drafting |
| Rewriting | rewrite_edit | Editing, summarizing |
| Extraction | extract_structure | Structured data extraction |
| Reasoning | reasoning_analysis | Complex analysis, math |
| Code | code | Programming, debugging |
| Data Query | data_query | SQL, data questions |
| Research | research | Multi-source research |
Nodes Reference
Zihin Chat Model
LangChain-compatible chat model with intelligent provider routing and tool calling support.
| Parameter | Default | Description |
|---|---|---|
| Model | auto | LLM model or auto for intelligent routing |
| Task Type | chat_general | Routing hint for auto mode |
Options:
| Option | Default | Description |
|---|---|---|
| Temperature | 0.7 | Creativity (0–2) |
| Max Tokens | 4096 | Maximum response tokens (1–128,000) |
| Top P | 1 | Nucleus sampling (0–1) |
| Frequency Penalty | 0 | Reduce repetition (-2 to 2) |
| Presence Penalty | 0 | Encourage new topics (-2 to 2) |
| Timeout | 60,000ms | Request timeout (1–300s) |
| Max Retries | 2 | Retries with exponential backoff (0–5) |
| Stop Sequences | — | Comma-separated generation stop strings |
| Session ID | — | Maintain conversation context across calls |
| JSON Output Schema | — | Force structured JSON responses |
Supported Providers: OpenAI, Anthropic, Google, Grok, OpenRouter. The model list is loaded dynamically from the Zihin API — new models become available automatically.
Zihin Media Processing
Standalone node for image analysis, audio transcription, and document parsing.
| Operation | Required Fields | Supported Formats |
|---|---|---|
| Image — Analyze | Image (URL or base64) | JPEG, PNG, GIF, WebP |
| Audio — Transcribe | Audio (URL or base64) | mp3, wav, ogg, flac, m4a, webm, mp4 |
| Document — Parse | Document (URL or base64) | pdf, xlsx, xls, csv, docx, txt |
AI Tool Nodes
Auto-discovered by n8n's AI Agent framework. Add under Tools in an AI Agent node.
| Tool Node | Operation | Description |
|---|---|---|
| Zihin Image Tool | Analyze | Vision AI analysis with OCR support |
| Zihin Audio Tool | Transcribe | Speech-to-text via Whisper |
| Zihin Document Tool | Parse | Extract content from PDF, Excel, CSV, DOCX |
API Endpoints Used
| Node | Endpoint |
|---|---|
| Zihin Chat Model | POST /api/v3/llm/public/call |
| Zihin Chat Model (models) | GET /api/v3/llm/models |
| Zihin Image | POST /api/v3/media/image/public/analyze |
| Zihin Audio | POST /api/v3/media/audio/public/transcribe |
| Zihin Document | POST /api/v3/media/document/public/parse |
All endpoints authenticated via X-Api-Key header.
Troubleshooting
| Issue | Solution |
|---|---|
| "Invalid API Key" | Verify the key is active at console.zihin.ai |
| Timeout errors | Increase timeout in node options (default: 60s for chat, 120s for media) |
| Model not found | Models are loaded dynamically — check your API key has access |
| SSRF blocked | Media URLs must be public HTTPS. Enable "Allow Localhost" only for development |