Skip to main content

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.

Info

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.

    Note

    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.

Info

Label Name is displayed to your end users.

Tip

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.

Tip

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.

Warning

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.

Info

Single File and File List fields do not support this feature.

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.

Pre-Fill the Field

  1. Publish your app.

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

    Use this when end users open the web app directly from its link.

    1. On the app’s Access Point tab, click Configure on the Web App card.
    2. Fill in the hidden fields and click Launch. The web app opens with your values applied as URL query parameters.
    3. Copy the URL from the address bar to share the web app.

    To generate many links with different values, use the same pattern to write more yourself, or have a system fill in the values automatically:

    Note

    URL-encode any values that contain spaces or special characters (for example, Acme Corp becomes Acme%20Corp).

    Example: A CRM Auto-Fills the Customer ID

    A support team using a CRM can add ?customerId={{customer.id}} to the end of the web app URL in their ticket-response templates.

    The CRM substitutes the real customer ID when the rep sends the link, so the chatbot knows which customer it’s talking to without having to ask.