Overview
Codika workflows use n8n’s LangChain integration nodes to run AI operations. The two main node types for LLM processing are:| Node | Use when | Why |
|---|---|---|
chainLlm | Structured output (classification, extraction, JSON) | Direct response, no reasoning noise |
agent | Multi-step reasoning, tool usage | Planning and iteration capability |
chainLlm when you need structured JSON output. The agent node adds verbose reasoning before the final answer, which breaks structured output parsers.
Architecture
Both node types follow the same wiring pattern:Basic chainLlm example
This classifies an email as “newsletter”, “action_item”, or “spam”:LLM Model node
Output Parser node
Chain LLM node
Connections
Accessing LLM output
After the chainLlm node executes, the parsed output is available at:outputParserStructured, the parsed JSON is in the output field of the chain’s result.
Available Claude models
| Model | ID | Best for |
|---|---|---|
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | Fast classification, simple extraction |
| Claude Sonnet 4.6 | claude-sonnet-4-6-20250514 | Complex analysis, generation |
| Claude Opus 4.6 | claude-opus-4-6-20250527 | Most capable, multi-step reasoning |
Multi-step processing pattern
For workflows that need to process multiple items (e.g., classify each email in a batch):SplitInBatches or Loop Over Items node to iterate, with the chainLlm inside the loop.
Temperature guidelines
| Task | Temperature | Why |
|---|---|---|
| Classification | 0.0 - 0.3 | Deterministic, consistent results |
| Extraction | 0.0 - 0.2 | Accurate data extraction |
| Summarization | 0.3 - 0.5 | Some creative flexibility |
| Generation | 0.5 - 0.8 | Creative, varied output |
Common mistakes
- Credentials on chainLlm instead of lmChatAnthropic — credentials must be on the model node
- Using
agentfor JSON output — agent adds reasoning text that breaks structured parsers - Missing
hasOutputParser: trueon chainLlm — required when using outputParserStructured - Accessing output incorrectly — use
$('Node Name').first().json.output, not.jsondirectly