diff --git a/packages/server/src/utils/buildChatflow.ts b/packages/server/src/utils/buildChatflow.ts index 90297076f..3257f0a8a 100644 --- a/packages/server/src/utils/buildChatflow.ts +++ b/packages/server/src/utils/buildChatflow.ts @@ -184,6 +184,9 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals fs.unlinkSync(file.path) } + if (overrideConfig.vars && typeof overrideConfig.vars === 'string') { + overrideConfig.vars = JSON.parse(overrideConfig.vars) + } incomingInput = { question: req.body.question ?? 'hello', overrideConfig diff --git a/packages/server/src/utils/upsertVector.ts b/packages/server/src/utils/upsertVector.ts index 044716e74..c0e5e4d98 100644 --- a/packages/server/src/utils/upsertVector.ts +++ b/packages/server/src/utils/upsertVector.ts @@ -89,6 +89,9 @@ export const upsertVector = async (req: Request, isInternal: boolean = false) => fs.unlinkSync(file.path) } + if (overrideConfig.vars && typeof overrideConfig.vars === 'string') { + overrideConfig.vars = JSON.parse(overrideConfig.vars) + } incomingInput = { question: req.body.question ?? 'hello', overrideConfig,