LLM Node
Sends a prompt to a large language model and returns the reply: summarise an email, classify a ticket, extract fields from free text, translate or draft a reply. Type: llm_node.
For a model that calls your APIs as tools or remembers a conversation, use the AI Agent node.
Providers
Pick a provider and store its key in an API key credential (the key is encrypted and never appears in output or logs).
provider | Connects to | Also needs |
|---|---|---|
openai | OpenAI | API key |
anthropic | Anthropic (Claude) | API key |
azure | Azure OpenAI | API key, base_url (deployment URL), api_version |
gemini | Google Gemini (OpenAI-compatible endpoint) | API key |
groq, openrouter | Groq, OpenRouter | API key |
ollama | Ollama | Optional key; base_url defaults to http://localhost:11434/v1 |
custom | Any OpenAI-compatible API (vLLM, LM Studio, LiteLLM, an internal LLM service) | base_url; optional key |
bedrock | AWS Bedrock | API key (Bedrock API key), region |
vertex | Google Vertex AI | Service-account JSON as the credential value, region |
zerq | The Zerq AI Gateway | A Zerq AI key (see below) |
Direct providers are called straight from the workflow: Zerq budgets, guardrails and AI Logs do not apply. Choose Zerq AI Gateway for governed calls: the request goes to this server's AI Gateway with a Zerq AI key, so the key's client must be allowed to use the model, guardrails, budgets, routing, fallbacks and caching apply, and every call is in AI Logs. To set it up, grant the client the models, turn on AI access on one of its profiles, issue an AI key (zk_…), and store it in an API key credential (Access and AI keys).
Nodes saved before the provider option existed have no provider and keep using the Zerq AI Gateway.
Config
provider,credentials_id,model: see above.modelis the provider's model name (for examplegpt-4o-mini,claude-sonnet-4-5,gemini-2.0-flash,llama3.1); forzerqit is an AI Gateway model and may be empty to use the client's default.base_url,api_version,region: provider-specific (table above).base_urlcan override any provider's default endpoint.response_format:text(default) orjson. Withjsonthe node asks for a JSON object and parses the reply into thejsonoutput; a reply that is not JSON goes toerror(the raw reply is still intext). A reply wrapped in a Markdown code fence is accepted.temperature(0–2) andmax_tokens: optional; empty uses the model's defaults.timeout_ms: how long to wait, 1,000–300,000 (default 60,000).
Inputs
system(optional): instructions sent as the system message.prompt: the user message. Objects are sent as compact JSON.messages(optional): a whole conversation, an array of{role, content}(or an expression returning one). When set,systemandpromptare ignored.user(optional): an end-user ID, sent to the Zerq AI Gateway (recorded in AI Logs) and OpenAI.
All inputs accept expressions, for example {{ $json['http_trigger_1'].request.body.message }}.
Outputs
| Field | Description |
|---|---|
matched_output | success or error |
text | The model's reply |
json | The parsed reply (response_format: json) |
model, provider | The model and provider that answered |
usage | prompt_tokens, completion_tokens, total_tokens |
finish_reason | For example stop or length |
request_id | The provider's response ID, or the AI Gateway request ID (zerq) to find the call in AI Logs |
status_code, error_type, error | On error: the HTTP status, a type such as provider_auth, rate_limited, timeout, provider_error, bad_request, context_length (and for zerq: guardrail_blocked, budget_exceeded, model_not_allowed, upstream_unavailable), and the message |
Example: classify a support ticket
{
"id": "classify",
"type": "llm_node",
"data": {
"config": {
"provider": "openai",
"credentials_id": "<api key credential id>",
"model": "gpt-4o-mini",
"response_format": "json",
"temperature": 0
},
"inputs": {
"system": "Classify the support ticket. Reply as JSON: {\"category\": \"billing|shipping|other\", \"urgent\": true|false}.",
"prompt": "{{ $json['http_trigger_1'].request.body.text }}"
}
}
}
Connect success to a switch_node on {{ $json['classify'].json.category }}, and error to a fallback (for example a default queue or a 502 response).
Guardrail workflows
A workflow guardrail can use this node as an LLM judge. If, through the Zerq AI Gateway, the judge calls a model whose guardrail runs the same workflow, the calls would loop; nested calls stop after three levels and the node returns error with nested AI calls exceed the limit of 3. Use a direct provider or a model without that guardrail for the judge.
Common pitfalls
provider_auth: the API key is wrong or belongs to another provider.the credential does not hold a Zerq AI key(zerq): the credential must contain a Zerq AI key, not a provider key.model_not_allowed(zerq): grant the model to the key's client (and profile, if it narrows the list).- Ollama from a container:
localhostis the backend container itself; pointbase_urlat the Ollama host. - Streaming is not used; raise
timeout_msor setmax_tokensfor long replies.