🚚 Directorize and alphabetize nodes (#2445)

* 🚚 Directorize nodes

*  Alphabetize nodes and credentials

* 🔥 Remove unused node

* 🔥 Remove unused codex

* 🔥 Remove duplicate cred file references

* 🐛 Fix node file paths

* 🔥 Remove duplicate node reference
This commit is contained in:
Iván Ovejero
2021-11-17 17:30:14 +01:00
committed by GitHub
parent 0022c7eb09
commit 766f74c782
95 changed files with 109 additions and 472 deletions

View File

@@ -0,0 +1,29 @@
{
"node": "n8n-nodes-base.errorTrigger",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"details": "In n8n, when a workflow execution fails, it can start another workflow. This second workflow can be any arbitrary workflow on your n8n instance. Use the Error Trigger node as your Trigger in the Error workflow.",
"categories": [
"Development",
"Core Nodes"
],
"resources": {
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/nodes/n8n-nodes-base.errorTrigger/"
}
],
"generic": [
{
"label": "Creating Error Workflows in n8n",
"icon": "🌪",
"url": "https://n8n.io/blog/creating-error-workflows-in-n8n/"
}
]
},
"subcategories": {
"Core Nodes": [
"Helpers"
]
}
}

View File

@@ -0,0 +1,66 @@
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
const restApiUrl = this.getRestApiUrl();
const urlParts = restApiUrl.split('/');
urlParts.pop();
urlParts.push('execution');
const id = 231;
items[0].json = {
execution: {
id,
url: `${urlParts.join('/')}/${id}`,
retryOf: '34',
error: {
message: 'Example Error Message',
stack: 'Stacktrace',
},
lastNodeExecuted: 'Node With Error',
mode: 'manual',
},
workflow: {
id: '1',
name: 'Example Workflow',
},
};
}
return this.prepareOutputData(items);
}
}