mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-28 13:38:36 +07:00
* draft * draft * draft * refine dev docs * almost * update * remove sys.file and sys.query; add sys.timestamp * update the end node to output * modify the introduction section of variable * fix typo * adjust image size * remove unnecessary list * feedback fix * remove example * feedback fix & add en/ja dev docs * correct description * fix typos * replace UI text * refinements & add zh-ja translation * feedback fixes * fix punctuation * refine heading-reference * typo * adjust casing & remove sys.timestamp from chatflow * Docs tools: 2 succeeded, some failed Rename operation failed: - Lang 'zh': File 'dify-docs/plugin-dev-zh/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get' - Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-datasource-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-tool-oauth.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'zh': File 'dify-docs/plugin-dev-zh/0222-trigger-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'en': File 'dify-docs/plugin-dev-en/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get' - Lang 'en': File 'dify-docs/plugin-dev-en/0222-datasource-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'en': File 'dify-docs/plugin-dev-en/0222-tool-oauth.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'en': File 'dify-docs/plugin-dev-en/0222-trigger-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'ja': File 'dify-docs/plugin-dev-ja/0211-getting-started-dify-tool.mdx' - Renaming error: Unexpected error: 'str' object has no attribute 'get' - Lang 'ja': File 'dify-docs/plugin-dev-ja/0222-datasource-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). - Lang 'ja': File 'dify-docs/plugin-dev-ja/0222-trigger-plugin.mdx' - Skipped (non-compliant): Missing/empty critical frontmatter fields for renaming: dimensions.type.primary, dimensions.type.detail, dimensions.level, standard_title, language (expected for metadata, though not used in filename suffix anymore). --------- Co-authored-by: Riskey <riskey47@dify.ai> Co-authored-by: alterxyz <88554920+alterxyz@users.noreply.github.com>
122 lines
4.9 KiB
Plaintext
122 lines
4.9 KiB
Plaintext
---
|
|
title: User Input
|
|
---
|
|
|
|
## 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.
|
|
|
|
<Info>
|
|
Each application canvas can contain only one User Input node.
|
|
</Info>
|
|
|
|
## 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 maintained only for backward compatibility.
|
|
|
|
We recommend using a [custom file input field](#file-input) instead to collect user files.
|
|
</Note>
|
|
|
|
- `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 name `user_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.
|
|
|
|
<Info>
|
|
The **Label Name** is displayed to your end users.
|
|
</Info>
|
|
|
|
<Tip>
|
|
In a chatflow application, you can **Hide** any input variable to make it invisible to the end user while keeping it available for reference within the chatflow.
|
|
</Tip>
|
|
|
|
#### Text Input
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Short Text">
|
|
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.
|
|
</Tab>
|
|
|
|
<Tab title="Paragraph">
|
|
The paragraph field allows long-form text without length restrictions. It gives users a multi-line text area for detailed responses or descriptions.
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
#### Structured Input
|
|
|
|
<Tabs>
|
|
|
|
<Tab title="Select">
|
|
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.
|
|
</Tab>
|
|
|
|
<Tab title="Number">
|
|
The number field restricts input to numerical values only—ideal for quantities, ratings, IDs, or any data requiring mathematical processing.
|
|
</Tab>
|
|
|
|
<Tab title="Checkbox">
|
|
The checkbox field provides a simple yes/no option. When a user checks the box, the output is `true`; otherwise, it's `false`. Use it for confirmations or any case that requires a binary choice.
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
#### File Input
|
|
|
|
<Tabs>
|
|
<Tab title="Single File">
|
|
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.).
|
|
</Tab>
|
|
|
|
<Tab title="File List">
|
|
The file-list field works like single-file but supports multiple file uploads at once. It's useful for handling batches of documents, images, or other files together.
|
|
<Tip>
|
|
You can use a List Operator node to filter, sort, or extract specific files from the uploaded file list for further processing.
|
|
</Tip>
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
**File Processing**
|
|
|
|
Files uploaded through a User Input node must be processed appropriately by subsequent nodes. The User Input node only collects files; it does not read or parse their content.
|
|
|
|
Therefore, you need to connect specific nodes to extract and process the file content. 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 appropriate processing branches.
|
|
</Tip>
|
|
|
|
## 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.
|
|
|
|
{/*
|
|
Contributing Section
|
|
DO NOT edit this section!
|
|
It will be automatically generated by the script.
|
|
*/}
|
|
|
|
---
|
|
|
|
[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/workflow/node/user-input.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
|
|
|