Add Hidden Variables Support for Workflows/Conversation Flows #14828

Closed
opened 2026-02-21 19:18:57 -05:00 by yindo · 1 comment
Owner

Originally created by @Angus221 on GitHub (Jun 23, 2025).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Current user-visible variables cannot cover system integration scenarios (e.g., passing page IDs or user roles implicitly via URL parameters). We need hidden variables with traits:

  1. Passed only via URL/API, invisible and unmodifiable by end-users
  2. Usable as system parameters in workflows (e.g., __menu_id)
  3. Functional Requirements:

Variable Definition

Add a "Hidden Variables" section in workflow configuration (separate from user input)

Properties: Name (enforced prefix like __), default value, description (admin-only)

Example: Define __menu_id with default value home

Value Injection

URL Parameters: https://app.dify.ai/token?__menu_id=settings&__user_role=admin

API Requests: Pass via Header/Body (e.g., X-Dify-Hidden-Vars: {"__menu_id":"settings"})

Priority: Injected value > Default value

Frontend Constraints

Hidden variables are never displayed in chat/input UI

End-users cannot view or modify these variables

Workflow Usage

Directly referenceable in nodes (e.g., {{__menu_id}})

Values visible in debug mode (admin-only)

Security Rules

Enforce __ prefix in names (prevent conflicts with user variables)

Automatically filter non-prefixed params when passed via URL

Use Cases:

Embedded AI assistant switches page context via URL (e.g., __current_page=user_profile)

Implicitly pass user identity (e.g., __org_id=123) without manual input

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @Angus221 on GitHub (Jun 23, 2025). ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Current user-visible variables cannot cover system integration scenarios (e.g., passing page IDs or user roles implicitly via URL parameters). We need hidden variables with traits: 1. Passed only via URL/API, invisible and unmodifiable by end-users 2. Usable as system parameters in workflows (e.g., __menu_id) 3. Functional Requirements: Variable Definition Add a "Hidden Variables" section in workflow configuration (separate from user input) Properties: Name (enforced prefix like __), default value, description (admin-only) Example: Define __menu_id with default value home Value Injection URL Parameters: https://app.dify.ai/token?__menu_id=settings&__user_role=admin API Requests: Pass via Header/Body (e.g., X-Dify-Hidden-Vars: {"__menu_id":"settings"}) Priority: Injected value > Default value Frontend Constraints Hidden variables are never displayed in chat/input UI End-users cannot view or modify these variables Workflow Usage Directly referenceable in nodes (e.g., {{__menu_id}}) Values visible in debug mode (admin-only) Security Rules Enforce __ prefix in names (prevent conflicts with user variables) Automatically filter non-prefixed params when passed via URL Use Cases: Embedded AI assistant switches page context via URL (e.g., __current_page=user_profile) Implicitly pass user identity (e.g., __org_id=123) without manual input ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement🌊 feat:workflow labels 2026-02-21 19:18:57 -05:00
yindo closed this issue 2026-02-21 19:18:57 -05:00
Author
Owner

@crazywoola commented on GitHub (Jul 11, 2025):

https://github.com/langgenius/dify/pull/21922

@crazywoola commented on GitHub (Jul 11, 2025): https://github.com/langgenius/dify/pull/21922
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14828