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
Specialized utility modules and namespaces providing logging, node helpers, telemetry, observable objects, and native method access for advanced workflow functionality.
Centralized logging proxy for workflow execution and system events.
namespace LoggerProxy {
function info(message: string, meta?: object): void;
function debug(message: string, meta?: object): void;
function warn(message: string, meta?: object): void;
function error(message: string, meta?: object): void;
function verbose(message: string, meta?: object): void;
function init(logger: ILogger): void;
function getInstance(): ILogger;
}
interface ILogger {
log(level: LogLevel, message: string, meta?: object): void;
debug(message: string, meta?: object): void;
info(message: string, meta?: object): void;
warn(message: string, meta?: object): void;
error(message: string, meta?: object): void;
verbose(message: string, meta?: object): void;
}Comprehensive utilities for node development, parameter resolution, and execution context management.
namespace NodeHelpers {
function getExecutionData(
workflow: Workflow,
runExecutionData: IRunExecutionData,
runIndex: number,
connectionInputData: INodeExecutionData[],
node: INode,
itemIndex: number,
mode: WorkflowExecuteMode
): IExecuteData;
function getNodeParameters(
nodeParameters: INodeParameters,
runExecutionData: IRunExecutionData,
runIndex: number,
connectionInputData: INodeExecutionData[],
node: INode,
itemIndex: number,
workflow: Workflow,
mode: WorkflowExecuteMode
): INodeParameters;
function getNodeWebhooks(
workflow: Workflow,
node: INode,
additionalData: IWorkflowExecuteAdditionalData,
ignoreRestartWehbooks?: boolean
): IWebhookData[];
function getPollTimes(
node: INode,
workflow: Workflow,
additionalData: IWorkflowExecuteAdditionalData,
mode: WorkflowExecuteMode
): IPollTimes;
}Telemetry collection and event tracking utilities for workflow analytics and monitoring.
namespace TelemetryHelpers {
function generateNodesGraph(
workflow: IWorkflowBase,
nodeTypes: INodeTypes
): INodesGraph;
function getNodeTypeForName(
workflow: IWorkflowBase,
nodeName: string
): INodeType | null;
function getNodeParameters(nodeType: INodeType): object;
function getNodeVersions(nodeType: INodeType): number[];
function getNodeMetadata(nodeType: INodeType): INodeTypeDescription;
}
interface INodesGraph {
nodeGraph: {
[nodeId: string]: {
edges: INodesGraphEdge[];
node: INodesGraphNode;
};
};
directedAcyclicGraph: {
[nodeType: string]: {
count: number;
};
};
notes: object;
webhooks: number;
triggers: number;
}Reactive object wrapper providing change notifications and event handling for dynamic workflow data.
namespace ObservableObject {
function create<T extends object>(
initialData: T,
ignoreKeys?: string[],
observableGetter?: (value: T) => T
): IObservableObject<T>;
function isObservableObject(value: any): value is IObservableObject;
}
interface IObservableObject<T = any> {
__ob__: Observer<T>;
[key: string]: any;
}
interface Observer<T> {
value: T;
dep: Dep;
vmCount: number;
walk(obj: T): void;
observeArray(items: any[]): void;
}Advanced expression parsing utilities for analyzing and manipulating n8n expressions and code.
namespace ExpressionParser {
function parseExpression(expression: string): ParsedExpression;
function extractExpressionDetails(
expression: string,
workflow: Workflow
): ExpressionDetails;
function validateExpression(
expression: string,
allowedMethods?: string[]
): ValidationResult;
function getExpressionDependencies(expression: string): string[];
}
interface ParsedExpression {
isValid: boolean;
dependencies: string[];
methods: string[];
variables: string[];
error?: string;
}
interface ExpressionDetails {
expression: string;
resolvedExpression?: string;
hasErrors: boolean;
errors: string[];
usedVariables: string[];
}Access to native JavaScript and system methods within controlled execution contexts.
class NativeMethods {
static getInstanceBaseClasses(): string[];
static hasAccessToMethod(
instanceName: string,
methodName: string
): boolean;
static validateMethodAccess(
context: string,
method: string,
args: any[]
): boolean;
static getAvailableMethods(instanceName: string): string[];
}
interface MethodAccessConfig {
instance: string;
methods: string[];
readonly: boolean;
context?: string[];
}Core workflow analysis utilities available through the common export path.
// Available as: import * as common from "n8n-workflow/common";
function getNodeByName(workflow: IWorkflowBase, nodeName: string): INode | null;
function getConnectedNodes(
workflow: IWorkflowBase,
connectionMap: IConnections,
nodeName: string,
connectionType?: NodeConnectionType,
direction?: 'input' | 'output'
): IConnectedNode[];
function getChildNodes(
workflow: IWorkflowBase,
nodeName: string,
connectionType?: NodeConnectionType
): string[];
function getParentNodes(
workflow: IWorkflowBase,
nodeName: string,
connectionType?: NodeConnectionType
): string[];
function mapConnectionsByDestination(
connections: IConnections
): IConnections;