Overview
Guide for configuring Output nodes in Dify workflows to properly reference LLM output variables.
Adding Output Variable
- Click the Output node in the workflow canvas
- In the settings panel, find "output variable *" section
- Click the "+" icon to add a new variable
- Two fields appear:
- Variable name: Input field for the output variable name
- Set variable: Clickable area to select source variable
Selecting LLM Output
- Click on the "Set variable" area (NOT the trash icon on the right)
- A "Search variable" textbox appears with autocomplete dropdown
- The dropdown shows available variables grouped by node:
- LLM: text, reasoning_content, usage
- User Input: files
- SYSTEM: sys.user_id, sys.app_id, etc.
- Click "LLM" to expand, then click "text" to select
Variable Reference Format
After selection, the Output node shows the variable reference:
- Display format:
LLM / text String - This connects the LLM node's text output to the workflow's API response
Common Mistakes
- Clicking the trash icon instead of "Set variable" area
- Not clicking the "+" button first to add variable form
- Using wrong variable syntax in LLM node (use
{{query}}not{{#sys.query#}})
Test Before Publishing
- Click "Test Run" to verify workflow execution
- Check that all nodes complete successfully:
- User Input → LLM → Output
- Verify output contains LLM response text