Workflow base code of n8n providing foundational workflow execution engine for automation platform
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Essential constants and enumeration values used throughout the n8n workflow system for node types, execution modes, and configuration.
Standard node type identifiers for common n8n nodes and triggers.
// Core node types
const MANUAL_TRIGGER_NODE_TYPE = 'n8n-nodes-base.manualTrigger';
const START_NODE_TYPE = 'n8n-nodes-base.start';
const ERROR_TRIGGER_NODE_TYPE = 'n8n-nodes-base.errorTrigger';
const EXECUTE_WORKFLOW_NODE_TYPE = 'n8n-nodes-base.executeWorkflow';
const EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE = 'n8n-nodes-base.executeWorkflowTrigger';
const WEBHOOK_NODE_TYPE = 'n8n-nodes-base.webhook';
const HTTP_REQUEST_NODE_TYPE = 'n8n-nodes-base.httpRequest';
const CODE_NODE_TYPE = 'n8n-nodes-base.code';
const FUNCTION_NODE_TYPE = 'n8n-nodes-base.function';
const FUNCTION_ITEM_NODE_TYPE = 'n8n-nodes-base.functionItem';
const AI_TRANSFORM_NODE_TYPE = 'n8n-nodes-base.aiTransform';
const MERGE_NODE_TYPE = 'n8n-nodes-base.merge';
const WAIT_NODE_TYPE = 'n8n-nodes-base.wait';
const FORM_NODE_TYPE = 'n8n-nodes-base.form';
const FORM_TRIGGER_NODE_TYPE = 'n8n-nodes-base.formTrigger';
const RESPOND_TO_WEBHOOK_NODE_TYPE = 'n8n-nodes-base.respondToWebhook';
const STICKY_NODE_TYPE = 'n8n-nodes-base.stickyNote';
const NO_OP_NODE_TYPE = 'n8n-nodes-base.noOp';
const HTML_NODE_TYPE = 'n8n-nodes-base.html';
const EVALUATION_TRIGGER_NODE_TYPE = 'n8n-nodes-base.evaluationTrigger';
const EVALUATION_NODE_TYPE = 'n8n-nodes-base.evaluation';
// Database node types
const POSTGRES_NODE_TYPE = 'n8n-nodes-base.postgres';
const MYSQL_NODE_TYPE = 'n8n-nodes-base.mySql';
// Service node types
const MAILGUN_NODE_TYPE = 'n8n-nodes-base.mailgun';
// LangChain node types
const CHAT_TRIGGER_NODE_TYPE = '@n8n/n8n-nodes-langchain.chatTrigger';
const MANUAL_CHAT_TRIGGER_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.manualChatTrigger';
const AGENT_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.agent';
const CHAIN_LLM_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.chainLlm';
const OPENAI_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.openAi';
const CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.chainSummarization';
const AGENT_TOOL_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.agentTool';
const CODE_TOOL_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.toolCode';
const WORKFLOW_TOOL_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.toolWorkflow';
const HTTP_REQUEST_TOOL_LANGCHAIN_NODE_TYPE = '@n8n/n8n-nodes-langchain.toolHttpRequest';Predefined collections of node types for specific categories and use cases.
// Starting node types that can begin workflow execution
const STARTING_NODE_TYPES: string[] = [
'n8n-nodes-base.manualTrigger',
'n8n-nodes-base.executeWorkflowTrigger',
'n8n-nodes-base.errorTrigger',
'n8n-nodes-base.start',
'n8n-nodes-base.evaluationTrigger'
];
// Node types that support scripting/code execution
const SCRIPTING_NODE_TYPES: string[] = [
'n8n-nodes-base.function',
'n8n-nodes-base.functionItem',
'n8n-nodes-base.code',
'n8n-nodes-base.aiTransform'
];
// LangChain custom tool node types
const LANGCHAIN_CUSTOM_TOOLS: string[] = [
'@n8n/n8n-nodes-langchain.toolCode',
'@n8n/n8n-nodes-langchain.toolWorkflow',
'@n8n/n8n-nodes-langchain.toolHttpRequest'
];
// Nodes with renamable content when referenced nodes are renamed
const NODES_WITH_RENAMABLE_CONTENT: Set<string>;
const NODES_WITH_RENAMABLE_FORM_HTML_CONTENT: Set<string>;
const NODES_WITH_RENAMEABLE_TOPLEVEL_HTML_CONTENT: Set<string>;Core constants for workflow execution modes, logging, and system configuration.
// Log levels for system logging
const LOG_LEVELS: readonly ['silent', 'error', 'warn', 'info', 'debug'];
// Supported code execution languages
const CODE_LANGUAGES: readonly ['javaScript', 'python'];
// Code execution modes for script nodes
const CODE_EXECUTION_MODES: readonly ['runOnceForAllItems', 'runOnceForEachItem'];
// Binary data encoding format
const BINARY_ENCODING = 'base64';
// Wait indefinitely date constant
const WAIT_INDEFINITELY: Date;
// Character sets for string generation
const DIGITS = '0123456789';
const UPPERCASE_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const LOWERCASE_LETTERS = 'abcdefghijklmnopqrstuvwxyz';
const ALPHABET: string; // Combined digits and letters
// System constants
const CREDENTIAL_EMPTY_VALUE: string; // Placeholder for empty credential values
const FORM_TRIGGER_PATH_IDENTIFIER = 'n8n-form';
const PROJECT_ROOT = '0';Constants for error handling, status reporting, and system messaging.
// Error messages
const UNKNOWN_ERROR_MESSAGE = 'There was an unknown issue while executing the node';
const UNKNOWN_ERROR_DESCRIPTION: string; // Detailed error description with documentation link
const UNKNOWN_ERROR_MESSAGE_CRED = 'UNKNOWN ERROR';
// Operation constants
const SEND_AND_WAIT_OPERATION = 'sendAndWait';
const AI_TRANSFORM_CODE_GENERATED_FOR_PROMPT = 'codeGeneratedForPrompt';
const AI_TRANSFORM_JS_CODE = 'jsCode';
const ADD_FORM_NOTICE = 'addFormPage';
// System markers and keys
const TRIMMED_TASK_DATA_CONNECTIONS_KEY = '__isTrimmedManualExecutionDataItem';
const FROM_AI_AUTO_GENERATED_MARKER = '/*n8n-auto-generated-fromAI-override*/';
const WAITING_FORMS_EXECUTION_STATUS = 'n8n-execution-status';
const CHAT_WAIT_USER_REPLY = 'waitUserReply';
// AI and credential constants
const OPEN_AI_API_CREDENTIAL_TYPE = 'openAiApi';
const FREE_AI_CREDITS_ERROR_TYPE = 'free_ai_credits_request_error';
const FREE_AI_CREDITS_USED_ALL_CREDITS_ERROR_CODE = 400;type LogLevel = typeof LOG_LEVELS[number];
type CodeLanguage = typeof CODE_LANGUAGES[number];
type CodeExecutionMode = typeof CODE_EXECUTION_MODES[number];