How to use the n8n-core.LoadNodeParameterOptions function in n8n-core

To help you get started, we’ve selected a few n8n-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github n8n-io / n8n / packages / cli / src / Server.ts View on Github external
this.app.get('/rest/node-parameter-options', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => {
			const nodeType = req.query.nodeType;
			let credentials: INodeCredentials | undefined = undefined;
			const currentNodeParameters = req.query.currentNodeParameters;
			if (req.query.credentials !== undefined) {
				credentials = JSON.parse(req.query.credentials);
			}
			const methodName = req.query.methodName;

			const nodeTypes = NodeTypes();

			const loadDataInstance = new LoadNodeParameterOptions(nodeType, nodeTypes, credentials);

			const workflowData = loadDataInstance.getWorkflowData() as IWorkflowBase;
			const workflowCredentials = await WorkflowCredentials(workflowData.nodes);
			const additionalData = await WorkflowExecuteAdditionalData.getBase(workflowCredentials, currentNodeParameters);

			return loadDataInstance.getOptions(methodName, additionalData);
		}));