| name | workflow-node-llm |
| description | Builds or updates frontend LLM-node data with model capability selection. |
| allowed-tools | ["execute_node_skill_script","update_current_graph"] |
Workflow LLM Node
Use type: llm for semantic understanding, classification, extraction, and content generation.
Node Schema
build_node.data only contains business fields. Do not provide id, type,
position, or status; the script generates or fills them. New LLM node IDs
follow the frontend rule: llm-<uuid> with a uniqueness suffix only if needed.
| Field | Type | Required | Meaning | Notes |
|---|
title | string | no | Display title | Defaults to 大模型 |
description | string | no | Node description | |
inputs | array | no | Variables referenced by prompts | Defaults to one input string |
outputs | array | no | Values generated by the model | Defaults to one result string |
config | object | no | Model, prompt, and mapping settings | Defaults match frontend LLM node |
Each input/output item has:
| Field | Type | Required | Meaning |
|---|
name | string | yes | Stable variable name |
type | string | yes | Such as String, Object, Image, or Array |
description | string | no | Business meaning |
Config fields:
| Field | Type | Required | Meaning | Notes |
|---|
prompt | string | no | Compatible prompt field | Prefer userPrompt |
systemPrompt | string | no | Stable role and policy | |
userPrompt | string | yes | Task prompt | Variables use {{name}} |
model | string | no | Configured model name | Defaults to empty; obtain through scripts below |
modelProvider | string | no | Model provider | Defaults to deerflow |
temperature | number | no | Sampling temperature | Low for deterministic tasks |
maxTokens | integer | no | Output-token limit | Positive |
enabled | boolean | no | Whether node runs | Defaults to true |
responseMode | string | yes | text or json | |
outputKey | string | no | Main output variable | Leave empty to use the first non-reasoning output |
reasoningKey | string | no | Reasoning output variable | Only with thinking |
thinkingEnabled | boolean | no | Enable model reasoning | Model must support it |
reasoningEffort | string | no | Reasoning effort | Only when supported |
inputMappings | array | no | Input source mappings | Full ordered array |
Each inputMappings item contains field, sourceType, source, and
valueType. field must correspond to an input.
Input Variables
Inputs expose exactly two user-facing modes:
- Custom string:
{"field": "instruction", "sourceType": "literal", "source": "summarize", "valueType": "String"}.
- Upstream reference:
{"field": "input", "sourceType": "node", "source": "start.input", "valueType": "String"}.
context is a legacy runtime source type, not a Skill input mode. Do not emit
it. The start-node input is referenced as a normal node output, such as
start.input.
Before building or changing any node-reference input, execute
list_input_sources. For a new node pass the IDs of its intended direct
predecessors from the confirmed topology. For an existing node pass node_id.
Only use an exact source returned by that script. The script includes all
reachable ancestors, checks Graph direction, and returns source types.
For a node mapping, copy the returned source type into both the input type
and mapping valueType. For a literal mapping, the input and valueType
must both be String.
Output Variables
Supported output types are:
String, Integer, Number, Boolean, Time, Object, Image, Video,
Array, Array<String>, Array<Integer>, Array<Number>,
Array<Boolean>, Array<Time>, Array<Object>, Array<Image>, and
Array<Video>.
Output names must be unique identifiers using letters, numbers, and
underscores, and must not start with a number.
responseMode: text: declare one primary output. Its type is normally
String. outputKey may be empty to select the first non-reasoning output.
responseMode: json: declare every expected top-level JSON field as an
output with its exact type. Set outputKey only when one declared field is
the primary output.
- When thinking is enabled, add
reasoning_content as a String output and
set reasoningKey to the same name.
Default LLM node generated by build_node:
{
"id": "llm-<uuid>",
"title": "大模型",
"type": "llm",
"description": "调用大语言模型,基于输入变量和提示词生成回复。",
"inputs": [
{
"name": "input",
"type": "String",
"description": ""
}
],
"outputs": [
{
"name": "result",
"type": "String",
"description": ""
}
],
"config": {
"prompt":
Dynamic Model Selection
Execute list_models before choosing a model:
requires_vision: true when any input is Image, ImageList, Video, or VideoList.
requires_thinking: true only when the task needs explicit reasoning.
Never choose a model that lacks a required capability.
Then execute resolve_model_config with the selected model,
capability requirements, enable_thinking, and reasoning_effort. Merge its
result into the candidate node config.
Scripts
list_input_sources
- Path:
workflow-node-llm/scripts/node.py
- Entry:
list_input_sources
- Description: list valid upstream variables for input mappings.
- New-node arguments:
{"upstream_node_ids": ["intended-direct-predecessor-id"]}
- Existing-node arguments:
{"node_id": "existing-id"}
- Returns:
{"sources": [{"source": "node-id.field", "nodeTitle": "...", "field": "...", "type": "...", "description": "..."}], "allowed_source_values": [...]}
list_models
- Path:
workflow-node-llm/scripts/node.py
- Entry:
list_models
- Description: return configured models matching vision/thinking requirements.
- Arguments:
{"requirements": {"requires_vision": bool, "requires_thinking": bool}}
- Returns:
{"models": [...], "recommended_model": "name"}
resolve_model_config
- Path:
workflow-node-llm/scripts/node.py
- Entry:
resolve_model_config
- Description: resolve the exact model and reasoning config.
- Arguments:
{"request": {"model": "name", "requires_vision": bool, "requires_thinking": bool, "enable_thinking": bool, "reasoning_effort": "medium"}}
- Returns: model configuration fields to merge into
data.config.
build_node
- Path:
workflow-node-llm/scripts/node.py
- Entry:
build_node
- Description: build a complete new LLM node and generate
id and type.
- Arguments:
{"data": <Node Schema business fields>, "upstream_node_ids": ["direct-predecessor-id"]}
- Returns:
{"node": <complete node>}
update_node
- Path:
workflow-node-llm/scripts/node.py
- Entry:
update_node
- Description: find the current LLM node by ID and apply changed fields.
- Arguments:
{"node_id": "existing-id", "changes": <changed fields>}
- Returns:
{"node": <complete updated node>}
Objects merge recursively; arrays replace the entire old array; scalars replace
directly; omitted fields stay unchanged. To modify one input or mapping, submit
the complete new inputs or config.inputMappings array. Never submit only the
changed array item.
Rules
- When thinking is disabled, do not declare
reasoning_content as an output.
- Every prompt variable must have a matching input or input mapping.
- Never invent a
node mapping source. Use list_input_sources.
inputs and config.inputMappings must have one complete matching entry per
input field.
- Keep
outputKey empty when the node should use its first non-reasoning output
(result by default); set it only when an explicitly planned output variable
is required.
- Use only models returned by
list_models.
- The runtime caches the node returned by
build_node or update_node; pass
only its related edges to update_current_graph.
- Do not add
position or runtime status.