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 {
|
import {
|
||||||
readFile as fsReadFile,
|
readFile as fsReadFile,
|
||||||
} from 'fs';
|
} from 'fs';
|
||||||
|
@ -9,9 +7,7 @@ const fsReadFileAsync = promisify(fsReadFile);
|
||||||
|
|
||||||
import { IExecuteFunctions } from 'n8n-core';
|
import { IExecuteFunctions } from 'n8n-core';
|
||||||
import {
|
import {
|
||||||
ILoadOptionsFunctions,
|
|
||||||
INodeExecutionData,
|
INodeExecutionData,
|
||||||
INodePropertyOptions,
|
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypeDescription,
|
INodeTypeDescription,
|
||||||
IExecuteWorkflowInfo,
|
IExecuteWorkflowInfo,
|
||||||
|
@ -69,9 +65,9 @@ export class ExecuteWorkflow implements INodeType {
|
||||||
// source:database
|
// source:database
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
{
|
{
|
||||||
displayName: 'Workflow',
|
displayName: 'Workflow ID',
|
||||||
name: 'workflowId',
|
name: 'workflowId',
|
||||||
type: 'options',
|
type: 'string',
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
source: [
|
source: [
|
||||||
|
@ -79,9 +75,6 @@ export class ExecuteWorkflow implements INodeType {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
typeOptions: {
|
|
||||||
loadOptionsMethod: 'getWorkflows',
|
|
||||||
},
|
|
||||||
default: '',
|
default: '',
|
||||||
required: true,
|
required: true,
|
||||||
description: 'The workflow to execute.',
|
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[][]> {
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||||
const items = this.getInputData();
|
const items = this.getInputData();
|
||||||
const source = this.getNodeParameter('source', 0) as string;
|
const source = this.getNodeParameter('source', 0) as string;
|
||||||
|
|
Loading…
Reference in a new issue