LLM Inference
Execute multi-provider LLM inference via saved Workspace or Project LLM Presets with system/user prompts, multimodal FileRef inputs, and bounded JSON Schema output.
About this Node
Executes a single-turn LLM completion using a saved Workspace or Project LLM Preset across Google Gemini, OpenAI, Azure OpenAI, Anthropic Claude, and xAI (Grok). Supports inline prompt templates (`{{key}}`) or upstream state-key prompts, multimodal `FileRef` attachments, and strict JSON Schema structured outputs.
Ports & Branches
inPort 0Inbound execution flowoutPort 1Outbound execution flow after model responseHow this Node Reads Data
| Input | Access | Field | Example | Description |
|---|---|---|---|---|
| Prompt State Key | State Key | input_key |
rendered_prompt |
When `prompt_source` is `state_key`, reads the prompt text from the workflow state key named by `input_key`. |
| Prompt Template | {{Template}} | prompt_template |
Summarize this ticket for {{customer_tier}}: {{ticket_body}} |
When `prompt_source` is `template`, interpolates `{{key}}` placeholders from the node's scoped state. |
| Multimodal Attachments | FileRef | file_input_keys |
["invoice_pdf"] |
State keys holding `FileRef` objects (images, PDFs, audio, or text files from Dataset Read or HTTP Request) attached to the model request. |
State Keys Written (Outputs)
| Key Pattern | Type | Role | Description |
|---|---|---|---|
{output_key} |
string | object |
Primary | Generated completion text (in `text` mode) or parsed JSON object (in `json` / `json_schema` mode). |
{output_key}_metadata |
object |
Secondary | Provider, model, finish reason, and token usage summary for this completion. |
Tips & Best Practices
- Configure provider credentials and model presets in Settings → LLM, then bind nodes to a saved preset (`llm_preset_id`) without pasting credentials into workflow settings.
- For multi-turn tool use with Agent Skills, datasets, or sub-workflows, use the AI Agent (`maf_agent`) node.
Commonly Paired With
Settings Parameters (24)
Configuration schema synchronized with the workflow catalog
| Field | Type | Default | Allowed Options | Description |
|---|---|---|---|---|
llm_preset_id |
string |
— |
— | Required saved Workspace or Project LLM Preset UUID |
llm_preset_name |
string |
— |
— | Display name of the bound LLM Preset |
llm_preset_model |
string |
— |
— | Selected model ID from the preset's available models (defaults to the preset's Default Model) |
use_preset_generation_defaults |
boolean |
true |
— | When true, use the bound preset's default temperature, max tokens, and Top-P |
provider |
string |
vertex_gemini |
vertex_gemini, openai, azure_openai, anthropic, xai | Target LLM provider identifier hydrated from the selected preset |
model |
string |
gemini-2.5-flash |
— | Provider model identifier or Azure deployment name resolved from the selected preset |
secret_name |
string |
— |
— | Server-hydrated provider credential name from the selected LLM Preset |
secret_kind |
string |
llm_provider |
llm_provider | — |
azure_endpoint |
string |
— |
— | Azure OpenAI HTTPS endpoint URL (required for azure_openai) |
azure_api_version |
string |
2024-10-21 |
— | Azure OpenAI REST API version |
gcp_project |
string |
— |
— | Optional Google Cloud project ID override for Vertex service account secrets |
gcp_location |
string |
us-central1 |
— | Vertex region when authenticating via service account credentials |
prompt_source |
string |
state_key |
state_key, template | — |
system_prompt |
string |
— |
— | Optional system prompt with {{variable}} interpolation |
prompt_template |
string |
— |
— | User prompt template with {{variable}} interpolation |
input_key |
string |
rendered_prompt |
— | — |
output_key |
string |
content |
— | — |
file_input_keys |
array |
— |
— | Up to 20 state keys holding FileRef multimodal attachments |
temperature |
number |
0.7 |
— | — |
max_tokens |
integer |
— |
— | Optional maximum generated output tokens |
top_p |
number |
— |
— | Optional nucleus sampling probability |
response_format_mode |
string |
text |
text, json_schema | — |
response_schema_name |
string |
llm_response |
— | — |
response_schema_json |
string |
— |
— | JSON Schema object string (<= 64 KiB, max depth 16) when response_format_mode is 'json_schema' |
Structured JSON Classification (Preset Gemini)
Classify an incoming support ticket using a saved LLM Preset and strict JSON Schema so downstream Router or Condition nodes can branch reliably.
Node Configuration
{
"Id": "llm_1",
"Type": "llm",
"Config": {
"llm_preset_id": "11111111-1111-4111-8111-111111111111",
"llm_preset_model": "gemini-2.5-flash",
"use_preset_generation_defaults": true,
"provider": "vertex_gemini",
"model": "gemini-2.5-flash",
"prompt_source": "template",
"system_prompt": "Classify customer tickets accurately.",
"prompt_template": "Classify ticket: {{ticket_text}}",
"output_key": "classification",
"response_format_mode": "json_schema",
"response_schema_name": "ticket_classification",
"response_schema_json": "{\u0022type\u0022:\u0022object\u0022,\u0022properties\u0022:{\u0022queue\u0022:{\u0022type\u0022:\u0022string\u0022},\u0022confidence\u0022:{\u0022type\u0022:\u0022number\u0022}},\u0022required\u0022:[\u0022queue\u0022,\u0022confidence\u0022]}"
}
}Sample Input State
{
"ticket_text": "Double charge on invoice INV-8812"
}Expected Output State
{
"classification": { "queue": "billing", "confidence": 0.96 },
"classification_metadata": { "provider": "vertex_gemini", "model": "gemini-2.5-flash" }
}Tip: Pair `response_format_mode: "json_schema"` with a Condition or Router node using JMESPath like `classification.queue`.
Multimodal Invoice Extraction from Dataset FileRef
Attach a PDF `FileRef` produced by Dataset Read or HTTP Request and extract structured line items using a saved preset.
Node Configuration
{
"Id": "llm_1",
"Type": "llm",
"Config": {
"llm_preset_id": "22222222-2222-4222-8222-222222222222",
"llm_preset_model": "gpt-4o",
"use_preset_generation_defaults": true,
"provider": "openai",
"model": "gpt-4o",
"prompt_source": "template",
"prompt_template": "Extract invoice number, vendor, and total from the attached document.",
"file_input_keys": [
"invoice_file"
],
"output_key": "extracted_invoice",
"response_format_mode": "json_schema",
"response_schema_name": "invoice_extract",
"response_schema_json": "{\u0022type\u0022:\u0022object\u0022,\u0022properties\u0022:{\u0022invoice_number\u0022:{\u0022type\u0022:\u0022string\u0022},\u0022total\u0022:{\u0022type\u0022:\u0022number\u0022}},\u0022required\u0022:[\u0022invoice_number\u0022,\u0022total\u0022]}"
}
}Sample Input State
{
"invoice_file": { "type": "file_ref", "filename": "inv-102.pdf", "mime_type": "application/pdf" }
}Expected Output State
{
"extracted_invoice": { "invoice_number": "INV-102", "total": 1250.00 }
}