Skip to main content

Overview

Codika workflows use n8n’s LangChain integration nodes to run AI operations. The two main node types for LLM processing are: Critical rule: Use 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:
Credentials go on the model node, not on the chain/agent node.

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:
For outputParserStructured, the parsed JSON is in the output field of the chain’s result.

Available Claude models

Use FLEXCRED placeholders for AI provider credentials — they automatically handle org-owned vs. Codika-provided API keys.

Multi-step processing pattern

For workflows that need to process multiple items (e.g., classify each email in a batch):
Use n8n’s SplitInBatches or Loop Over Items node to iterate, with the chainLlm inside the loop.

Temperature guidelines

Common mistakes

  1. Credentials on chainLlm instead of lmChatAnthropic — credentials must be on the model node
  2. Using agent for JSON output — agent adds reasoning text that breaks structured parsers
  3. Missing hasOutputParser: true on chainLlm — required when using outputParserStructured
  4. Accessing output incorrectly — use $('Node Name').first().json.output, not .json directly