mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Environment Variables: renaming overrideConfig node to envVars
This commit is contained in:
@@ -85,16 +85,16 @@ class CustomTool_Tools implements INode {
|
|||||||
|
|
||||||
// override variables defined in overrideConfig
|
// override variables defined in overrideConfig
|
||||||
// nodeData.inputs.variables is an Object, check each property and override the variable
|
// nodeData.inputs.variables is an Object, check each property and override the variable
|
||||||
if (nodeData?.inputs?.variables) {
|
if (nodeData?.inputs?.envVars) {
|
||||||
for (const propertyName of Object.getOwnPropertyNames(nodeData.inputs.variables)) {
|
for (const propertyName of Object.getOwnPropertyNames(nodeData.inputs.envVars)) {
|
||||||
const foundVar = variables.find((v) => v.name === propertyName)
|
const foundVar = variables.find((v) => v.name === propertyName)
|
||||||
if (foundVar) {
|
if (foundVar) {
|
||||||
// even if the variable was defined as runtime, we override it with static value
|
// even if the variable was defined as runtime, we override it with static value
|
||||||
foundVar.type = 'static'
|
foundVar.type = 'static'
|
||||||
foundVar.value = nodeData.inputs.variables[propertyName]
|
foundVar.value = nodeData.inputs.envVars[propertyName]
|
||||||
} else {
|
} else {
|
||||||
// add it the variables, if not found locally in the db
|
// add it the variables, if not found locally in the db
|
||||||
variables.push({ name: propertyName, type: 'static', value: nodeData.inputs.variables[propertyName] })
|
variables.push({ name: propertyName, type: 'static', value: nodeData.inputs.envVars[propertyName] })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1382,10 +1382,6 @@ export class App {
|
|||||||
const chatflowid = req.params.id
|
const chatflowid = req.params.id
|
||||||
let incomingInput: IncomingInput = req.body
|
let incomingInput: IncomingInput = req.body
|
||||||
|
|
||||||
if (incomingInput.question) {
|
|
||||||
incomingInput.question = await replaceEnvVariables(incomingInput.question, this.AppDataSource)
|
|
||||||
}
|
|
||||||
|
|
||||||
let nodeToExecuteData: INodeData
|
let nodeToExecuteData: INodeData
|
||||||
|
|
||||||
const chatflow = await this.AppDataSource.getRepository(ChatFlow).findOneBy({
|
const chatflow = await this.AppDataSource.getRepository(ChatFlow).findOneBy({
|
||||||
|
|||||||
Reference in New Issue
Block a user