mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
✨ Make workflow metadata available in expresions and
node-functions
This commit is contained in:
@@ -240,6 +240,35 @@ export class WorkflowDataProxy {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns a proxt to query data from the workflow
|
||||
*
|
||||
* @private
|
||||
* @returns
|
||||
* @memberof WorkflowDataProxy
|
||||
*/
|
||||
private workflowGetter() {
|
||||
const allowedValues = [
|
||||
'active',
|
||||
'id',
|
||||
'name',
|
||||
];
|
||||
const that = this;
|
||||
|
||||
return new Proxy({}, {
|
||||
get(target, name, receiver) {
|
||||
if (!allowedValues.includes(name.toString())) {
|
||||
throw new Error(`The key "${name.toString()}" is not supported!`);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
return that.workflow[name.toString()];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns a proxy to query data of all nodes
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user