mirror of https://github.com/FlowiseAI/Flowise.git
Merge pull request #1800 from mokeyish/patch-2
Allow default variable values when testing CustomFunctionpull/1832/head
commit
2d9bf585f3
|
|
@ -324,7 +324,10 @@ export class App {
|
|||
// execute custom function node
|
||||
this.app.post('/api/v1/node-custom-function', async (req: Request, res: Response) => {
|
||||
const body = req.body
|
||||
const nodeData = { inputs: body }
|
||||
const functionInputVariables = Object.fromEntries(
|
||||
[...(body?.javascriptFunction ?? '').matchAll(/\$([a-zA-Z0-9_]+)/g)].map((g) => [g[1], undefined])
|
||||
)
|
||||
const nodeData = { inputs: { functionInputVariables, ...body } }
|
||||
if (Object.prototype.hasOwnProperty.call(this.nodesPool.componentNodes, 'customFunction')) {
|
||||
try {
|
||||
const nodeInstanceFilePath = this.nodesPool.componentNodes['customFunction'].filePath as string
|
||||
|
|
|
|||
Loading…
Reference in New Issue