mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 19:01:16 +03:00
Bugfix/execute custom function to worker (#4440)
* pass execute custom function to worker * update execute function
This commit is contained in:
@@ -17,9 +17,10 @@ export const executeCustomNodeFunction = async ({
|
||||
}) => {
|
||||
try {
|
||||
const body = data
|
||||
const functionInputVariables = Object.fromEntries(
|
||||
[...(body?.javascriptFunction ?? '').matchAll(/\$([a-zA-Z0-9_]+)/g)].map((g) => [g[1], undefined])
|
||||
)
|
||||
const jsFunction = typeof body?.javascriptFunction === 'string' ? body.javascriptFunction : ''
|
||||
const matches = jsFunction.matchAll(/\$([a-zA-Z0-9_]+)/g)
|
||||
const matchesArray: RegExpMatchArray[] = Array.from(matches)
|
||||
const functionInputVariables = Object.fromEntries(matchesArray.map((g) => [g[1], undefined]))
|
||||
if (functionInputVariables && Object.keys(functionInputVariables).length) {
|
||||
for (const key in functionInputVariables) {
|
||||
if (key.includes('vars')) {
|
||||
|
||||
Reference in New Issue
Block a user