Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dify-6c0370d8-docs-hide-variables.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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.
If a field’s value is something you already know (like a product identifier or tenant ID) and doesn’t have to come from end users, mark it as Hidden & Pre-Filled and supply it yourself. See Hide and Pre-Fill Input Fields for details.

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.

Hide and Pre-Fill Input Fields

Sometimes the workflow needs an input you already know, and asking end users to type it would be friction. Mark such a field as Hidden & Pre-Filled: you supply the value, end users never see the field, and the workflow still receives it. Imagine your company runs landing pages for many different products, each featuring an AI chatbot. The workflow behind every chatbot is essentially the same; only the product identifier differs. Rather than maintain a separate workflow per product, you keep just one (with a hidden productName field) and pre-fill a different value on each landing page. End users perceive each page as having its own product-specific chatbot, but behind the scenes, every page passes a different productName into the same workflow.
Hidden fields are not secret. Values travel in the URL query string and are visible in the browser address bar, browser history, and network traffic. For credentials and API keys, use Environment Variables instead.
Single File and File List fields do not support this feature.
1

Enable the Feature

  1. In the Edit Input Field window, uncheck Required if it’s checked. These two options are mutually exclusive.
  2. Check Hidden & Pre-Filled. Optionally set a default value as a fallback when no value is pre-filled at runtime.
Hidden fields still appear in the Preview panel so you can test the flow without publishing.
2

Pre-Fill the Field

  1. Publish your app.
  2. Choose the method that fits how your end users reach the app.