Remove loadOptions for workflows from ExecuteWorkflow-Node

This commit is contained in:
Jan Oberhauser 2020-03-08 22:50:15 +01:00
parent 1dc8714a80
commit 312f960535

View file

@ -1,5 +1,3 @@
import { OptionsWithUri } from 'request';
import {
readFile as fsReadFile,
} from 'fs';
@ -9,9 +7,7 @@ const fsReadFileAsync = promisify(fsReadFile);
import { IExecuteFunctions } from 'n8n-core';
import {
ILoadOptionsFunctions,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
IExecuteWorkflowInfo,
@ -69,9 +65,9 @@ export class ExecuteWorkflow implements INodeType {
// source:database
// ----------------------------------
{
displayName: 'Workflow',
displayName: 'Workflow ID',
name: 'workflowId',
type: 'options',
type: 'string',
displayOptions: {
show: {
source: [
@ -79,9 +75,6 @@ export class ExecuteWorkflow implements INodeType {
],
},
},
typeOptions: {
loadOptionsMethod: 'getWorkflows',
},
default: '',
required: true,
description: 'The workflow to execute.',
@ -153,31 +146,6 @@ export class ExecuteWorkflow implements INodeType {
]
};
methods = {
loadOptions: {
async getWorkflows(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const options: OptionsWithUri = {
method: 'GET',
uri: this.getRestApiUrl() + '/workflows',
json: true
};
const returnData: INodePropertyOptions[] = [];
const responseData = await this.helpers.request!(options);
for (const workflowData of responseData.data) {
returnData.push({
name: workflowData.name,
value: workflowData.id,
});
}
return returnData;
}
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const source = this.getNodeParameter('source', 0) as string;