You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Entry point for workflow and chatflow applications"
3
+
description: "Collects user inputs to start workflow and chatflow applications"
4
4
icon: "input-text"
5
5
---
6
6
## Introduction
7
7
8
-
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.
8
+
The User Input node allows you to define what to collect from end users as inputs for your applications.
9
9
10
-
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.
10
+
Applications that start with this node run *on demand* and can be initiated by direct user interaction or API calls.
11
+
12
+
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.
11
13
12
14
<Info>
13
15
Each application canvas can contain only one User Input node.
@@ -22,7 +24,7 @@ Preset input variables are system-defined and available by default.
22
24
-`userinput.files`: Files uploaded by end users when they run the application.
23
25
24
26
<Note>
25
-
For workflow applications, this preset variable has been considered *legacy* and maintained only for backward compatibility.
27
+
For workflow applications, this preset variable has been considered *legacy* and kept only for backward compatibility.
26
28
27
29
We recommend using a [custom file input field](#file-input) instead to collect user files.
28
30
</Note>
@@ -31,28 +33,28 @@ Preset input variables are system-defined and available by default.
31
33
32
34
### Custom
33
35
34
-
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.
35
-
36
-
There are seven types of input fields you can choose from to handle different kinds of user input.
36
+
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.
37
37
38
38
<Info>
39
-
The **Label Name** is displayed to your end users.
39
+
**Label Name** is displayed to your end users.
40
40
</Info>
41
41
42
42
<Tip>
43
-
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.
43
+
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.
44
+
45
+
Note that a **Required** field cannot be hidden.
44
46
</Tip>
45
47
46
48
#### Text Input
47
49
48
50
<Tabs>
49
51
50
52
<Tabtitle="Short Text">
51
-
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.
53
+
Accepts up to 256 characters. Use it for names, email addresses, titles, or any brief text input that fits on a single line.
52
54
</Tab>
53
55
54
56
<Tabtitle="Paragraph">
55
-
The paragraph field allows long-form text without length restrictions. It gives users a multi-line text area for detailed responses or descriptions.
57
+
Allows long-form text without length restrictions. It gives users a multi-line text area for detailed responses or descriptions.
56
58
</Tab>
57
59
</Tabs>
58
60
@@ -61,51 +63,60 @@ There are seven types of input fields you can choose from to handle different ki
61
63
<Tabs>
62
64
63
65
<Tabtitle="Select">
64
-
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.
66
+
Displays a dropdown menu with predefined options. Users can choose only from listed options, ensuring data consistency and preventing invalid inputs.
65
67
</Tab>
66
68
67
69
<Tabtitle="Number">
68
-
The number field restricts input to numerical values only—ideal for quantities, ratings, IDs, or any data requiring mathematical processing.
70
+
Restricts input to numerical values only—ideal for quantities, ratings, IDs, or any data requiring mathematical processing.
69
71
</Tab>
70
72
71
73
<Tabtitle="Checkbox">
72
-
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.
74
+
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.
75
+
</Tab>
76
+
77
+
<Tabtitle="JSON Code">
78
+
Accepts structured data in JSON format as an object, ideal for passing complex, nested data structures into your application.
79
+
80
+
You can optionally define a JSON schema to validate the input and guide users on the expected structure. This also allows you to reference individual properties of the object in other nodes.
73
81
</Tab>
74
82
</Tabs>
75
83
76
84
#### File Input
77
85
78
86
<Tabs>
79
87
<Tabtitle="Single File">
80
-
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.).
88
+
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.).
81
89
</Tab>
82
90
83
91
<Tabtitle="File List">
84
-
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.
92
+
Supports multiple file uploads at once. It's useful for handling batches of documents, images, or other files together.
93
+
85
94
<Tip>
86
-
You can use a List Operator node to filter, sort, or extract specific files from the uploaded file list for further processing.
95
+
Use a List Operator node to filter, sort, or extract specific files from the uploaded file list for further processing.
87
96
</Tip>
88
97
</Tab>
89
98
</Tabs>
90
99
91
100
**File Processing**
92
101
93
-
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.
94
-
95
-
Therefore, you need to connect specific nodes to extract and process the file content. For example:
102
+
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:
96
103
97
104
- Document files can be routed to a Doc Extractor node for text extraction so that LLMs can understand their content.
105
+
98
106
- Images can be sent to LLM nodes with vision capabilities or specialized image processing tool nodes.
107
+
99
108
- Structured data files such as CSV or JSON can be processed with Code nodes to parse and transform the data.
100
109
101
110
<Tip>
102
-
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.
111
+
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.
103
112
</Tip>
104
113
105
114
## What's Next
106
115
107
116
After setting up a User Input node, you can connect it to other nodes to process the collected data. Common patterns include:
108
117
109
118
- Send the input to an LLM node for processing.
110
-
- Use a Knowledge Retrieval node to find relevant information based on the input.
111
-
- Route the execution path to different branches with conditional logic based on the input.
119
+
120
+
- Use a Knowledge Retrieval node to find information relevant to the input.
121
+
122
+
- Create conditional branches based on the input with an If/Else node.
0 commit comments