Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to hide node param from UI #1210

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Adding ability to hide node param from UI #1210

merged 1 commit into from
Nov 17, 2023

Conversation

automaton82
Copy link
Contributor

This feature adds the ability for node params to mark themselves as hidden from the UI.

This is required for nodes which don't have static API credentials, but rather have session context tokens or otherwise that are dependent and change when the chatbot is embedded, and should not be set in the UI.

These params can still be targeted and passed a value through chatflowConfig options. In addition, the i info button continues to show these parameters inside of NodeInfoDialog so that developers know they exist.

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @automaton82 !

@HenryHengZJ
Copy link
Contributor

do you have any nodes params that can leverage this new hidden feature? just to get some idea

@automaton82
Copy link
Contributor Author

There is a node in development and unfortunately not publicly available at this time. However, I will share what I can to give you an idea of why it's required and how it works.

We have an Enterprise application that is able to provide data in multiple ways, and would like a node to help with this. This application has a complicated sign-on infrastructure including single sign-on and federated authentication for N users, however once a user has authenticated they're given a unique session (or token) ID. This ID has a lifetime of the session, but is never fixed.

All of the data provided by the node is always in the context of the session. If user A signs on and uses the chat, they get different data than user B despite using the exact same chatflow. This is because the session ID is different between them, and injected at embed-time.

This is accomplished in multiple ways. First, the parameter itself in the node is marked as hidden like this:

{
    label: 'Application Session ID',
    name: 'ourApplicationSessionId',
    type: 'string',
    description: 'The ID of the session that should be used for accessing data from the application.',
    placeholder: 'Session ID',
    optional: true,
    hidden: true
},

The user never sees this part in the UI, nor do they need to care about it. For the embedded case it's obvious: the example embed code in EmbedChat has been augmented with something like:

chatflowConfig: {
    ourApplicationSessionId: window.getApplicationSessionId()
}

This addresses the embedding. However, for the case where they're using Flowise directly it requires something like:

incomingInput.overrideConfig.ourApplicationSessionId = ourSessionId

The next phase could be to extend Flowise with N users instead of just 1, but that's a much bigger feature.

@HenryHengZJ
Copy link
Contributor

thanks for the detail explanation! another thing I can think of is ssomething like OAuth2 scopes, where you want to get the specified scopes from the node on UI but dont want to display it out on UI.

@HenryHengZJ HenryHengZJ merged commit fadbffc into FlowiseAI:main Nov 17, 2023
2 checks passed
hemati pushed a commit to hemati/Flowise that referenced this pull request Dec 27, 2023
…e-param

Adding ability to hide node param from UI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants