Initial commit to release

This commit is contained in:
Jan Oberhauser
2019-06-23 12:35:23 +02:00
commit 9cb9804eee
257 changed files with 42436 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
import { IExecuteFunctions } from 'n8n-core';
import {
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';
export class ErrorTrigger implements INodeType {
description: INodeTypeDescription = {
displayName: 'Error Trigger',
name: 'errorTrigger',
icon: 'fa:bug',
group: ['trigger'],
version: 1,
description: 'Triggers the workflow when another workflow has an error',
maxNodes: 1,
defaults: {
name: 'Error Trigger',
color: '#0000FF',
},
inputs: [],
outputs: ['main'],
properties: []
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const mode = this.getMode();
if (mode === 'manual' && items.length === 1 && Object.keys(items[0].json).length === 0 && items[0].binary === undefined) {
// If we are in manual mode and no input data got provided we return
// example data to allow to develope and test errorWorkflows easily
items[0].json = {
execution: {
error: {
message: 'Example Error Message',
stack: 'Stacktrace'
},
lastNodeExecuted: '',
mode: 'manual'
},
workflow: {
id: '1',
name: 'Example Workflow'
}
};
}
return this.prepareOutputData(items);
}
}