Skip to main content

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.
In a chatflow application, you can Hide any user input field to make it invisible to end users while keeping it available for reference within the chatflow.Note that a Required field cannot be hidden.

Text Input

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

Displays a dropdown menu with predefined options. Users can choose only from listed options, ensuring data consistency and preventing invalid inputs.

File Input

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.).
File Processing Since the User Input node only collects files—it does not read or parse their content—uploaded files must be processed appropriately by subsequent nodes. For example:
  • 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.
When users upload multiple files with mixed types (e.g., images and documents), you can use a List Operator node to separate them by file type before routing them to different processing branches.

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.