diff --git a/docker/images/n8n/README.md b/docker/images/n8n/README.md index a5beeb85c6..84fee8a6f9 100644 --- a/docker/images/n8n/README.md +++ b/docker/images/n8n/README.md @@ -1,4 +1,4 @@ -## n8n - Workflow Automation +# n8n - Workflow Automation ![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 6cdfc04dc5..c92e5a40a9 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -254,7 +254,7 @@ export function getNodeWebhookUrl(name: string, workflow: Workflow, node: INode, return undefined; } - return NodeHelpers.getNodeWebhookUrl(baseUrl, workflow.id!, node, path); + return NodeHelpers.getNodeWebhookUrl(baseUrl, workflow.id!, node, path.toString()); } diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 2a310a64a2..a55be35f43 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -123,7 +123,7 @@ export default mixins(nodeBase, workflowHelpers).extend({ }, nodeSubtitle (): string | undefined { if (this.nodeType !== null && this.nodeType.subtitle !== undefined) { - return this.workflow.getSimpleParameterValue(this.data as INode, this.nodeType.subtitle); + return this.workflow.getSimpleParameterValue(this.data as INode, this.nodeType.subtitle) as string | undefined; } if (this.data.parameters.operation !== undefined) { diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index 1e50c26b33..5869047f81 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -466,7 +466,6 @@ export default mixins( } } - Vue.set(this.nodeValues, 'parameters', JSON.parse(JSON.stringify(this.node.parameters))); } else { this.nodeValid = false; diff --git a/packages/nodes-base/nodes/ExecuteCommand.node.ts b/packages/nodes-base/nodes/ExecuteCommand.node.ts index ef43ba3b98..1d57e9084a 100644 --- a/packages/nodes-base/nodes/ExecuteCommand.node.ts +++ b/packages/nodes-base/nodes/ExecuteCommand.node.ts @@ -92,10 +92,8 @@ export class ExecuteCommand implements INodeType { items = [items[0]]; } - let item: INodeExecutionData; + const returnItems: INodeExecutionData[] = []; for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { - item = items[itemIndex]; - command = this.getNodeParameter('command', itemIndex) as string; const { @@ -105,13 +103,17 @@ export class ExecuteCommand implements INodeType { stderr, } = await execPromise(command); - item.json = { - exitCode, - stderr, - stdout, - }; + returnItems.push( + { + json: { + exitCode, + stderr, + stdout, + }, + }, + ); } - return this.prepareOutputData(items); + return this.prepareOutputData(returnItems); } } diff --git a/packages/nodes-base/nodes/HttpRequest.node.ts b/packages/nodes-base/nodes/HttpRequest.node.ts index f3f01759a7..5ec9250519 100644 --- a/packages/nodes-base/nodes/HttpRequest.node.ts +++ b/packages/nodes-base/nodes/HttpRequest.node.ts @@ -129,10 +129,10 @@ export class HttpRequest implements INodeType { name: 'String', value: 'string' }, - { - name: 'XML (not implemented)', - value: 'xml' - }, + // { + // name: 'XML (not implemented)', + // value: 'xml' + // }, ], default: 'json', description: 'The format in which the data gets returned from the URL.', @@ -325,10 +325,6 @@ export class HttpRequest implements INodeType { async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); - if (items.length === 0) { - items.push({json: {}}); - } - // TODO: Should have a setting which makes clear that this parameter can not change for each item const requestMethod = this.getNodeParameter('requestMethod', 0) as string; const parametersAreJson = this.getNodeParameter('jsonParameters', 0) as boolean; @@ -362,6 +358,7 @@ export class HttpRequest implements INodeType { }, }; + const returnItems: INodeExecutionData[] = []; for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { item = items[itemIndex]; @@ -431,14 +428,14 @@ export class HttpRequest implements INodeType { const response = await this.helpers.request(requestOptions); if (responseFormat === 'json') { - item.json = response; - } else if (responseFormat === 'xml') { - // TODO: Not implemented yet + returnItems.push({ json: response }); + // } else if (responseFormat === 'xml') { + // // TODO: Not implemented yet } else { - item.json.reponse = response; + returnItems.push({ json: { response } }); } } - return this.prepareOutputData(items); + return this.prepareOutputData(returnItems); } } diff --git a/packages/nodes-base/nodes/Merge.node.ts b/packages/nodes-base/nodes/Merge.node.ts index bc729ebd7e..8262410db8 100644 --- a/packages/nodes-base/nodes/Merge.node.ts +++ b/packages/nodes-base/nodes/Merge.node.ts @@ -14,6 +14,7 @@ export class Merge implements INodeType { icon: 'fa:code-branch', group: ['transform'], version: 1, + subtitle: '={{$parameter["mode"]}}', description: 'Merges data of multiple streams once data of both is available', defaults: { name: 'Merge', diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index e5b1c78ed6..8cc7517c0b 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -515,6 +515,8 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: continue; } + nodeWebhookPath = nodeWebhookPath.toString(); + if (nodeWebhookPath.charAt(0) === '/') { nodeWebhookPath = nodeWebhookPath.slice(1); } @@ -530,7 +532,7 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: } returnData.push({ - httpMethod: httpMethod as WebhookHttpMethod, + httpMethod: httpMethod.toString() as WebhookHttpMethod, node: node.name, path, webhookDescription, diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index 0be39f62cb..870699fdfe 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -688,7 +688,7 @@ export class Workflow { * @returns {(string | undefined)} * @memberof Workflow */ - getSimpleParameterValue(node: INode, parameterValue: string | undefined, defaultValue?: string): string | undefined { + getSimpleParameterValue(node: INode, parameterValue: string | undefined, defaultValue?: boolean | number | string): boolean | number | string | undefined { if (parameterValue === undefined) { // Value is not set so return the default return defaultValue; @@ -704,7 +704,7 @@ export class Workflow { } }; - return this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData) as string | undefined; + return this.getParameterValue(parameterValue, runData, runIndex, itemIndex, node.name, connectionInputData) as boolean | number | string | undefined; } diff --git a/packages/workflow/test/Helpers.ts b/packages/workflow/test/Helpers.ts index 37f3df3a79..da51347419 100644 --- a/packages/workflow/test/Helpers.ts +++ b/packages/workflow/test/Helpers.ts @@ -102,7 +102,6 @@ let nodeTypesInstance: NodeTypesClass | undefined; export function NodeTypes(): NodeTypesClass { if (nodeTypesInstance === undefined) { nodeTypesInstance = new NodeTypesClass(); - nodeTypesInstance.init({}); } return nodeTypesInstance;