Introduction
The User Input node allows you to define what to collect from end users as inputs for your applications. Applications that start with this node run on demand and can be initiated by direct user interaction or API calls. You can also publish these applications as standalone web apps or MCP servers, expose them through backend service APIs, or use them as tools in other Dify applications.Each application canvas can contain only one User Input node.
Input Variable
Preset
Preset input variables are system-defined and available by default.-
userinput.files: Files uploaded by end users when they run the application.For workflow applications, this preset variable has been considered legacy and kept only for backward compatibility.We recommend using a custom file input field instead to collect user files. -
userinput.query(for chatflows only): The text message automatically captured from the user’s latest chat turn.
Custom
You can configure custom input fields in a User Input node to collect different kinds of user input. Each field becomes a variable that can be referenced by downstream nodes.Label Name is displayed to your end users.
Text Input
- Short Text
- Paragraph
Accepts up to 256 characters. Use it for names, email addresses, titles, or any brief text input that fits on a single line.
Structured Input
- Select
- Number
- Checkbox
Displays a dropdown menu with predefined options. Users can choose only from listed options, ensuring data consistency and preventing invalid inputs.
File Input
- Single File
- File List
Allows users to upload one file of any supported type, either from their device or via a file URL. The uploaded file is available as a variable containing file metadata (name, size, type, etc.).
- Document files can be routed to a Doc Extractor node for text extraction so that LLMs can understand their content.
- Images can be sent to LLM nodes with vision capabilities or specialized image processing tool nodes.
- Structured data files such as CSV or JSON can be processed with Code nodes to parse and transform the data.
What’s Next
After setting up a User Input node, you can connect it to other nodes to process the collected data. Common patterns include:- Send the input to an LLM node for processing.
- Use a Knowledge Retrieval node to find information relevant to the input.
- Create conditional branches based on the input with an If/Else node.