mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Add functionality to evaluate expression
This commit is contained in:
@@ -897,10 +897,14 @@ export class Workflow {
|
||||
|
||||
// Generate a data proxy which allows to query workflow data
|
||||
const dataProxy = new WorkflowDataProxy(this, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData);
|
||||
const data = dataProxy.getDataProxy();
|
||||
data.$evaluateExpression = (expression: string) => {
|
||||
return this.resolveSimpleParameterValue('=' + expression, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, returnObjectAsString);
|
||||
};
|
||||
|
||||
// Execute the expression
|
||||
try {
|
||||
const returnValue = tmpl.tmpl(parameterValue, dataProxy.getDataProxy());
|
||||
const returnValue = tmpl.tmpl(parameterValue, data);
|
||||
if (returnValue !== null && typeof returnValue === 'object') {
|
||||
if (Object.keys(returnValue).length === 0) {
|
||||
// When expression is incomplete it returns a Proxy which causes problems.
|
||||
|
||||
Reference in New Issue
Block a user