Last edited by Allen, Dify Technical Writer
sys.
Workflow
Workflow type application provides the system variables below:
Variables name | Data Type | Description | Remark |
---|---|---|---|
| Array[File] | File Parameter: Stores images uploaded by users | The image upload function needs to be enabled in the ‘Features’ section in the upper right corner of the application orchestration page |
sys.user_id | String | User ID: A unique identifier automatically assigned by the system to each user when they use a workflow application. It is used to distinguish different users | |
sys.app_id | String | App ID: A unique identifier automatically assigned by the system to each App. This parameter is used to record the basic information of the current application. | This parameter is used to differentiate and locate distinct Workflow applications for users with development capabilities |
sys.workflow_id | String | Workflow ID: This parameter records information about all nodes information in the current Workflow application. | This parameter can be used by users with development capabilities to track and record information about the nodes contained within a Workflow |
sys.workflow_run_id | String | Workflow Run ID: Used to record the runtime status and execution logs of a Workflow application. | This parameter can be used by users with development capabilities to track the application’s historical execution records |
Variables name | Data Type | Description | Remark |
---|---|---|---|
sys.query | String | Content entered by the user in the chatting box. | |
sys.files | Array[File] | File Parameter: Stores images uploaded by users | The image upload function needs to be enabled in the ‘Features’ section in the upper right corner of the application orchestration page |
sys.dialogue_count | Number | The number of conversations turns during the user’s interaction with a Chatflow application. The count automatically increases by one after each chat round and can be combined with if-else nodes to create rich branching logic. For example, LLM will review the conversation history at the X conversation turn and automatically provide an analysis. | |
sys.conversation_id | String | A unique ID for the chatting box interaction session, grouping all related messages into the same conversation, ensuring that the LLM continues the chatting on the same topic and context. | |
sys.user_id | String | A unique ID is assigned for each application user to distinguish different conversation users. Note: The Service API does not share conversations created by the WebApp. This means users with the same ID will have separate conversation histories between API and WebApp interfaces. | |
sys.workflow_id | String | Workflow ID: This parameter records information about all nodes information in the current Workflow application. | This parameter can be used by users with development capabilities to track and record information about the nodes contained within a Workflow |
sys.workflow_run_id | String | Workflow Run ID: Used to record the runtime status and execution logs of a Workflow application. | This parameter can be used by users with development capabilities to track the application’s historical execution records |
Conversation variables are only applicable to Chatflow App.Conversation variables allow application developers to specify particular information that needs to be temporarily stored within the same Chatflow session, ensuring that this information can be referenced across multiple rounds of chatting within the current chatflow. This can include context, files uploaded to the chatting box(coming soon), user preferences input during the conversation, etc. It’s like providing a “memo” for the LLM that can be checked at any time, avoiding information bias caused by LLM memory errors. For example, you can store the language preference input by the user in the first round of chatting in a conversation variable. The LLM will refer to the information in the conversation variable when answering and use the specified language to reply to the user in subsequent chats.