mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Remove loadOptions for workflows from ExecuteWorkflow-Node
This commit is contained in:
parent
1dc8714a80
commit
312f960535
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue