Introduction
The User Input node is a type of Start node where you can define what information to collect from end users when they run your application. Applications that start with this node run on demand, 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 maintained 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 information from end users. Each field becomes a variable that can be referenced by downstream nodes. For example, if you add an input field with the variable nameuser_name, you can reference it as {{user_name}} throughout the workflow.
There are seven types of input fields you can choose from to handle different kinds of user input.
The Label Name is displayed to your end users.
Text Input
- Short Text
- Paragraph
The short-text field 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
The select field displays a dropdown menu with predefined options. Users can choose only from the listed options, ensuring data consistency and preventing invalid inputs.
File Input
- Single File
- File List
The single-file field 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 relevant information based on the input.
- Route the execution path to different branches with conditional logic based on the input.