0
# Specialized Modules
1
2
Specialized utility modules and namespaces providing logging, node helpers, telemetry, observable objects, and native method access for advanced workflow functionality.
3
4
## Capabilities
5
6
### Logger Proxy
7
8
Centralized logging proxy for workflow execution and system events.
9
10
```typescript { .api }
11
namespace LoggerProxy {
12
function info(message: string, meta?: object): void;
13
function debug(message: string, meta?: object): void;
14
function warn(message: string, meta?: object): void;
15
function error(message: string, meta?: object): void;
16
function verbose(message: string, meta?: object): void;
17
function init(logger: ILogger): void;
18
function getInstance(): ILogger;
19
}
20
21
interface ILogger {
22
log(level: LogLevel, message: string, meta?: object): void;
23
debug(message: string, meta?: object): void;
24
info(message: string, meta?: object): void;
25
warn(message: string, meta?: object): void;
26
error(message: string, meta?: object): void;
27
verbose(message: string, meta?: object): void;
28
}
29
```
30
31
### Node Helpers
32
33
Comprehensive utilities for node development, parameter resolution, and execution context management.
34
35
```typescript { .api }
36
namespace NodeHelpers {
37
function getExecutionData(
38
workflow: Workflow,
39
runExecutionData: IRunExecutionData,
40
runIndex: number,
41
connectionInputData: INodeExecutionData[],
42
node: INode,
43
itemIndex: number,
44
mode: WorkflowExecuteMode
45
): IExecuteData;
46
47
function getNodeParameters(
48
nodeParameters: INodeParameters,
49
runExecutionData: IRunExecutionData,
50
runIndex: number,
51
connectionInputData: INodeExecutionData[],
52
node: INode,
53
itemIndex: number,
54
workflow: Workflow,
55
mode: WorkflowExecuteMode
56
): INodeParameters;
57
58
function getNodeWebhooks(
59
workflow: Workflow,
60
node: INode,
61
additionalData: IWorkflowExecuteAdditionalData,
62
ignoreRestartWehbooks?: boolean
63
): IWebhookData[];
64
65
function getPollTimes(
66
node: INode,
67
workflow: Workflow,
68
additionalData: IWorkflowExecuteAdditionalData,
69
mode: WorkflowExecuteMode
70
): IPollTimes;
71
}
72
```
73
74
### Telemetry Helpers
75
76
Telemetry collection and event tracking utilities for workflow analytics and monitoring.
77
78
```typescript { .api }
79
namespace TelemetryHelpers {
80
function generateNodesGraph(
81
workflow: IWorkflowBase,
82
nodeTypes: INodeTypes
83
): INodesGraph;
84
85
function getNodeTypeForName(
86
workflow: IWorkflowBase,
87
nodeName: string
88
): INodeType | null;
89
90
function getNodeParameters(nodeType: INodeType): object;
91
92
function getNodeVersions(nodeType: INodeType): number[];
93
94
function getNodeMetadata(nodeType: INodeType): INodeTypeDescription;
95
}
96
97
interface INodesGraph {
98
nodeGraph: {
99
[nodeId: string]: {
100
edges: INodesGraphEdge[];
101
node: INodesGraphNode;
102
};
103
};
104
directedAcyclicGraph: {
105
[nodeType: string]: {
106
count: number;
107
};
108
};
109
notes: object;
110
webhooks: number;
111
triggers: number;
112
}
113
```
114
115
### Observable Object
116
117
Reactive object wrapper providing change notifications and event handling for dynamic workflow data.
118
119
```typescript { .api }
120
namespace ObservableObject {
121
function create<T extends object>(
122
initialData: T,
123
ignoreKeys?: string[],
124
observableGetter?: (value: T) => T
125
): IObservableObject<T>;
126
127
function isObservableObject(value: any): value is IObservableObject;
128
}
129
130
interface IObservableObject<T = any> {
131
__ob__: Observer<T>;
132
[key: string]: any;
133
}
134
135
interface Observer<T> {
136
value: T;
137
dep: Dep;
138
vmCount: number;
139
walk(obj: T): void;
140
observeArray(items: any[]): void;
141
}
142
```
143
144
### Expression Parser
145
146
Advanced expression parsing utilities for analyzing and manipulating n8n expressions and code.
147
148
```typescript { .api }
149
namespace ExpressionParser {
150
function parseExpression(expression: string): ParsedExpression;
151
152
function extractExpressionDetails(
153
expression: string,
154
workflow: Workflow
155
): ExpressionDetails;
156
157
function validateExpression(
158
expression: string,
159
allowedMethods?: string[]
160
): ValidationResult;
161
162
function getExpressionDependencies(expression: string): string[];
163
}
164
165
interface ParsedExpression {
166
isValid: boolean;
167
dependencies: string[];
168
methods: string[];
169
variables: string[];
170
error?: string;
171
}
172
173
interface ExpressionDetails {
174
expression: string;
175
resolvedExpression?: string;
176
hasErrors: boolean;
177
errors: string[];
178
usedVariables: string[];
179
}
180
```
181
182
### Native Methods
183
184
Access to native JavaScript and system methods within controlled execution contexts.
185
186
```typescript { .api }
187
class NativeMethods {
188
static getInstanceBaseClasses(): string[];
189
190
static hasAccessToMethod(
191
instanceName: string,
192
methodName: string
193
): boolean;
194
195
static validateMethodAccess(
196
context: string,
197
method: string,
198
args: any[]
199
): boolean;
200
201
static getAvailableMethods(instanceName: string): string[];
202
}
203
204
interface MethodAccessConfig {
205
instance: string;
206
methods: string[];
207
readonly: boolean;
208
context?: string[];
209
}
210
```
211
212
### Common Module
213
214
Core workflow analysis utilities available through the common export path.
215
216
```typescript { .api }
217
// Available as: import * as common from "n8n-workflow/common";
218
219
function getNodeByName(workflow: IWorkflowBase, nodeName: string): INode | null;
220
221
function getConnectedNodes(
222
workflow: IWorkflowBase,
223
connectionMap: IConnections,
224
nodeName: string,
225
connectionType?: NodeConnectionType,
226
direction?: 'input' | 'output'
227
): IConnectedNode[];
228
229
function getChildNodes(
230
workflow: IWorkflowBase,
231
nodeName: string,
232
connectionType?: NodeConnectionType
233
): string[];
234
235
function getParentNodes(
236
workflow: IWorkflowBase,
237
nodeName: string,
238
connectionType?: NodeConnectionType
239
): string[];
240
241
function mapConnectionsByDestination(
242
connections: IConnections
243
): IConnections;
244
```