@elqnt/workflow 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1159 -0
- package/dist/index.d.ts +1159 -0
- package/dist/index.js +5009 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4808 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { JSONSchema } from '@elqnt/types';
|
|
3
|
+
import React$1 from 'react';
|
|
4
|
+
import * as redux from 'redux';
|
|
5
|
+
|
|
6
|
+
interface DynamicSchemaFormUIComponents {
|
|
7
|
+
Input: React.ComponentType<{
|
|
8
|
+
type?: string;
|
|
9
|
+
value: any;
|
|
10
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
step?: string | number;
|
|
17
|
+
}>;
|
|
18
|
+
Label: React.ComponentType<{
|
|
19
|
+
htmlFor?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}>;
|
|
23
|
+
Textarea: React.ComponentType<{
|
|
24
|
+
value: any;
|
|
25
|
+
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
rows?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
}>;
|
|
31
|
+
Checkbox: React.ComponentType<{
|
|
32
|
+
id?: string;
|
|
33
|
+
checked: boolean;
|
|
34
|
+
onCheckedChange: (checked: boolean) => void;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
Select: React.ComponentType<{
|
|
38
|
+
value: string;
|
|
39
|
+
onValueChange: (value: string) => void;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
}>;
|
|
43
|
+
SelectTrigger: React.ComponentType<{
|
|
44
|
+
className?: string;
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
}>;
|
|
47
|
+
SelectValue: React.ComponentType<{
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
}>;
|
|
50
|
+
SelectContent: React.ComponentType<{
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
}>;
|
|
53
|
+
SelectItem: React.ComponentType<{
|
|
54
|
+
value: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}>;
|
|
58
|
+
Button: React.ComponentType<{
|
|
59
|
+
type?: "button" | "submit" | "reset";
|
|
60
|
+
variant?: string;
|
|
61
|
+
size?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
onClick?: () => void;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
children: React.ReactNode;
|
|
66
|
+
}>;
|
|
67
|
+
Card: React.ComponentType<{
|
|
68
|
+
className?: string;
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
}>;
|
|
71
|
+
PlusIcon: React.ComponentType<{
|
|
72
|
+
className?: string;
|
|
73
|
+
}>;
|
|
74
|
+
TrashIcon: React.ComponentType<{
|
|
75
|
+
className?: string;
|
|
76
|
+
}>;
|
|
77
|
+
ChevronDownIcon: React.ComponentType<{
|
|
78
|
+
className?: string;
|
|
79
|
+
}>;
|
|
80
|
+
ChevronRightIcon: React.ComponentType<{
|
|
81
|
+
className?: string;
|
|
82
|
+
}>;
|
|
83
|
+
VariableIcon?: React.ComponentType<{
|
|
84
|
+
className?: string;
|
|
85
|
+
}>;
|
|
86
|
+
CheckIcon?: React.ComponentType<{
|
|
87
|
+
className?: string;
|
|
88
|
+
}>;
|
|
89
|
+
EditIcon?: React.ComponentType<{
|
|
90
|
+
className?: string;
|
|
91
|
+
}>;
|
|
92
|
+
Popover?: React.ComponentType<{
|
|
93
|
+
open?: boolean;
|
|
94
|
+
onOpenChange?: (open: boolean) => void;
|
|
95
|
+
children: React.ReactNode;
|
|
96
|
+
}>;
|
|
97
|
+
PopoverTrigger?: React.ComponentType<{
|
|
98
|
+
asChild?: boolean;
|
|
99
|
+
children: React.ReactNode;
|
|
100
|
+
}>;
|
|
101
|
+
PopoverContent?: React.ComponentType<{
|
|
102
|
+
className?: string;
|
|
103
|
+
align?: "start" | "center" | "end";
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
}>;
|
|
106
|
+
Dialog?: React.ComponentType<{
|
|
107
|
+
open?: boolean;
|
|
108
|
+
onOpenChange?: (open: boolean) => void;
|
|
109
|
+
children: React.ReactNode;
|
|
110
|
+
}>;
|
|
111
|
+
DialogContent?: React.ComponentType<{
|
|
112
|
+
className?: string;
|
|
113
|
+
children: React.ReactNode;
|
|
114
|
+
}>;
|
|
115
|
+
DialogHeader?: React.ComponentType<{
|
|
116
|
+
className?: string;
|
|
117
|
+
children: React.ReactNode;
|
|
118
|
+
}>;
|
|
119
|
+
DialogTitle?: React.ComponentType<{
|
|
120
|
+
className?: string;
|
|
121
|
+
children: React.ReactNode;
|
|
122
|
+
}>;
|
|
123
|
+
DialogFooter?: React.ComponentType<{
|
|
124
|
+
className?: string;
|
|
125
|
+
children: React.ReactNode;
|
|
126
|
+
}>;
|
|
127
|
+
ScrollArea?: React.ComponentType<{
|
|
128
|
+
className?: string;
|
|
129
|
+
children: React.ReactNode;
|
|
130
|
+
}>;
|
|
131
|
+
MarkdownEditor?: React.ComponentType<{
|
|
132
|
+
content: string;
|
|
133
|
+
onChange: (markdown: string) => void;
|
|
134
|
+
placeholder?: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
readOnly?: boolean;
|
|
137
|
+
minHeight?: string;
|
|
138
|
+
variables?: Array<{
|
|
139
|
+
name: string;
|
|
140
|
+
path: string;
|
|
141
|
+
title?: string;
|
|
142
|
+
}>;
|
|
143
|
+
}>;
|
|
144
|
+
cn: (...classes: (string | undefined | null | false)[]) => string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Variable definition for workflow variables
|
|
148
|
+
*/
|
|
149
|
+
interface WorkflowVariable {
|
|
150
|
+
name: string;
|
|
151
|
+
type: string;
|
|
152
|
+
title?: string;
|
|
153
|
+
path: string;
|
|
154
|
+
}
|
|
155
|
+
interface DynamicSchemaFormProps {
|
|
156
|
+
schema: JSONSchema;
|
|
157
|
+
value: any;
|
|
158
|
+
onChange: (value: any) => void;
|
|
159
|
+
disabled?: boolean;
|
|
160
|
+
path?: string[];
|
|
161
|
+
components: DynamicSchemaFormUIComponents;
|
|
162
|
+
/** Workflow variables available for selection */
|
|
163
|
+
variables?: WorkflowVariable[];
|
|
164
|
+
/** Whether to show variable picker buttons */
|
|
165
|
+
showVariablePicker?: boolean;
|
|
166
|
+
}
|
|
167
|
+
declare function DynamicSchemaForm({ schema, value, onChange, disabled, path, components, variables, showVariablePicker, }: DynamicSchemaFormProps): react_jsx_runtime.JSX.Element;
|
|
168
|
+
|
|
169
|
+
interface SchemaBuilderUIComponents {
|
|
170
|
+
Input: React.ComponentType<{
|
|
171
|
+
value: any;
|
|
172
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
className?: string;
|
|
175
|
+
placeholder?: string;
|
|
176
|
+
}>;
|
|
177
|
+
Label: React.ComponentType<{
|
|
178
|
+
htmlFor?: string;
|
|
179
|
+
className?: string;
|
|
180
|
+
children: React.ReactNode;
|
|
181
|
+
}>;
|
|
182
|
+
Checkbox: React.ComponentType<{
|
|
183
|
+
id?: string;
|
|
184
|
+
checked: boolean;
|
|
185
|
+
onCheckedChange: (checked: boolean) => void;
|
|
186
|
+
disabled?: boolean;
|
|
187
|
+
}>;
|
|
188
|
+
Select: React.ComponentType<{
|
|
189
|
+
value: string;
|
|
190
|
+
onValueChange: (value: string) => void;
|
|
191
|
+
disabled?: boolean;
|
|
192
|
+
children: React.ReactNode;
|
|
193
|
+
}>;
|
|
194
|
+
SelectTrigger: React.ComponentType<{
|
|
195
|
+
className?: string;
|
|
196
|
+
children: React.ReactNode;
|
|
197
|
+
}>;
|
|
198
|
+
SelectValue: React.ComponentType<{
|
|
199
|
+
placeholder?: string;
|
|
200
|
+
}>;
|
|
201
|
+
SelectContent: React.ComponentType<{
|
|
202
|
+
children: React.ReactNode;
|
|
203
|
+
}>;
|
|
204
|
+
SelectItem: React.ComponentType<{
|
|
205
|
+
value: string;
|
|
206
|
+
className?: string;
|
|
207
|
+
children: React.ReactNode;
|
|
208
|
+
}>;
|
|
209
|
+
Button: React.ComponentType<{
|
|
210
|
+
type?: "button" | "submit" | "reset";
|
|
211
|
+
variant?: string;
|
|
212
|
+
size?: string;
|
|
213
|
+
className?: string;
|
|
214
|
+
onClick?: () => void;
|
|
215
|
+
disabled?: boolean;
|
|
216
|
+
children: React.ReactNode;
|
|
217
|
+
}>;
|
|
218
|
+
Card: React.ComponentType<{
|
|
219
|
+
className?: string;
|
|
220
|
+
children: React.ReactNode;
|
|
221
|
+
}>;
|
|
222
|
+
PlusIcon: React.ComponentType<{
|
|
223
|
+
className?: string;
|
|
224
|
+
}>;
|
|
225
|
+
TrashIcon: React.ComponentType<{
|
|
226
|
+
className?: string;
|
|
227
|
+
}>;
|
|
228
|
+
GripVerticalIcon: React.ComponentType<{
|
|
229
|
+
className?: string;
|
|
230
|
+
}>;
|
|
231
|
+
ChevronDownIcon: React.ComponentType<{
|
|
232
|
+
className?: string;
|
|
233
|
+
}>;
|
|
234
|
+
ChevronRightIcon: React.ComponentType<{
|
|
235
|
+
className?: string;
|
|
236
|
+
}>;
|
|
237
|
+
cn: (...classes: (string | undefined | null | false)[]) => string;
|
|
238
|
+
}
|
|
239
|
+
interface SchemaBuilderProps {
|
|
240
|
+
schema: JSONSchema;
|
|
241
|
+
onChange: (schema: JSONSchema) => void;
|
|
242
|
+
disabled?: boolean;
|
|
243
|
+
components: SchemaBuilderUIComponents;
|
|
244
|
+
}
|
|
245
|
+
declare function SchemaBuilder({ schema, onChange, disabled, components, }: SchemaBuilderProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
type NodeSubTypeTS = "actionAIClassify" | "actionAIExtractData" | "actionAISummarize" | "actionApiCall" | "actionAssignSLAPolicy" | "actionCreateEntityRecord" | "actionDeleteEntityRecord" | "actionDocumentExtraction" | "actionNatsRequest" | "actionQueryEntityRecords" | "actionSendEmail" | "actionSendSMS" | "actionSetVariables" | "actionUpdateEntityRecord" | "agentChat" | "agentCustomResponse" | "agentIntentDetector" | "agentKnowledgeGraph" | "agentOpenTicket" | "agentStructuredOutput" | "agentTransferToHuman" | "delay" | "humanActionApproval" | "humanActionAssignment" | "humanActionDataEntry" | "humanActionReview" | "integrationCreateEvent" | "integrationGetDriveFile" | "integrationSearchCalendar" | "integrationSearchDrive" | "integrationSearchEmails" | "integrationSendEmail" | "logicFor" | "logicIf" | "logicSwitch" | "triggerCalendarEvent" | "triggerDriveFileChanged" | "triggerEmailReceived" | "triggerEntityRecordCreated" | "triggerEntityRecordDeleted" | "triggerEntityRecordUpdated" | "triggerEscalation" | "triggerSLABreach" | "triggerSLAWarning" | "triggerSchedule" | "triggerStart" | "triggerWebhookReceived";
|
|
248
|
+
interface NodeSubTypeInfo {
|
|
249
|
+
value: string;
|
|
250
|
+
label: string;
|
|
251
|
+
icon: string;
|
|
252
|
+
description: string;
|
|
253
|
+
}
|
|
254
|
+
declare const nodeDefinitions: Record<string, NodeDefinition>;
|
|
255
|
+
declare const nodeSchemas: Record<string, JSONSchema>;
|
|
256
|
+
declare const TriggerNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
257
|
+
declare const HumanActionNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
258
|
+
declare const AgentNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
259
|
+
declare const ActionNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
260
|
+
declare const LogicNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
261
|
+
declare const DelayNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
262
|
+
declare const ParallelNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
263
|
+
declare const DataNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
264
|
+
declare const TimerNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
265
|
+
declare const LoopNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
266
|
+
declare const AccountingNodeSubTypes: Record<string, NodeSubTypeInfo>;
|
|
267
|
+
type TriggerNodeSubType = keyof typeof TriggerNodeSubTypes;
|
|
268
|
+
type HumanActionNodeSubType = keyof typeof HumanActionNodeSubTypes;
|
|
269
|
+
type AgentNodeSubType = keyof typeof AgentNodeSubTypes;
|
|
270
|
+
type ActionNodeSubType = keyof typeof ActionNodeSubTypes;
|
|
271
|
+
type LogicNodeSubType = keyof typeof LogicNodeSubTypes;
|
|
272
|
+
type DelayNodeSubType = keyof typeof DelayNodeSubTypes;
|
|
273
|
+
type DataNodeSubType = keyof typeof DataNodeSubTypes;
|
|
274
|
+
type TimerNodeSubType = keyof typeof TimerNodeSubTypes;
|
|
275
|
+
type LoopNodeSubType = keyof typeof LoopNodeSubTypes;
|
|
276
|
+
type ParallelNodeSubType = keyof typeof ParallelNodeSubTypes;
|
|
277
|
+
type AccountingNodeSubType = keyof typeof AccountingNodeSubTypes;
|
|
278
|
+
type WorkflowNodeSubTypeTS = TriggerNodeSubType | HumanActionNodeSubType | AgentNodeSubType | ActionNodeSubType | LogicNodeSubType | DelayNodeSubType | DataNodeSubType | TimerNodeSubType | LoopNodeSubType | ParallelNodeSubType | AccountingNodeSubType;
|
|
279
|
+
declare const WorkflowNodeTypes: {
|
|
280
|
+
readonly trigger: {
|
|
281
|
+
readonly value: "trigger";
|
|
282
|
+
readonly label: "Trigger";
|
|
283
|
+
readonly category: "Triggers";
|
|
284
|
+
};
|
|
285
|
+
readonly humanAction: {
|
|
286
|
+
readonly value: "humanAction";
|
|
287
|
+
readonly label: "Human Action";
|
|
288
|
+
readonly category: "User Interaction";
|
|
289
|
+
};
|
|
290
|
+
readonly agent: {
|
|
291
|
+
readonly value: "agent";
|
|
292
|
+
readonly label: "Agent";
|
|
293
|
+
readonly category: "Automation";
|
|
294
|
+
};
|
|
295
|
+
readonly action: {
|
|
296
|
+
readonly value: "action";
|
|
297
|
+
readonly label: "Action";
|
|
298
|
+
readonly category: "Automation";
|
|
299
|
+
};
|
|
300
|
+
readonly logic: {
|
|
301
|
+
readonly value: "logic";
|
|
302
|
+
readonly label: "Logic";
|
|
303
|
+
readonly category: "Flow Control";
|
|
304
|
+
};
|
|
305
|
+
readonly data: {
|
|
306
|
+
readonly value: "data";
|
|
307
|
+
readonly label: "Data";
|
|
308
|
+
readonly category: "Data Processing";
|
|
309
|
+
};
|
|
310
|
+
readonly integration: {
|
|
311
|
+
readonly value: "integration";
|
|
312
|
+
readonly label: "Integration";
|
|
313
|
+
readonly category: "Integration";
|
|
314
|
+
};
|
|
315
|
+
readonly timer: {
|
|
316
|
+
readonly value: "timer";
|
|
317
|
+
readonly label: "Timer";
|
|
318
|
+
readonly category: "Time & Scheduling";
|
|
319
|
+
};
|
|
320
|
+
readonly loop: {
|
|
321
|
+
readonly value: "loop";
|
|
322
|
+
readonly label: "Loop";
|
|
323
|
+
readonly category: "Flow Control";
|
|
324
|
+
};
|
|
325
|
+
readonly parallel: {
|
|
326
|
+
readonly value: "parallel";
|
|
327
|
+
readonly label: "Parallel";
|
|
328
|
+
readonly category: "Flow Control";
|
|
329
|
+
};
|
|
330
|
+
readonly delay: {
|
|
331
|
+
readonly value: "delay";
|
|
332
|
+
readonly label: "Delay";
|
|
333
|
+
readonly category: "Flow Control";
|
|
334
|
+
};
|
|
335
|
+
readonly subflow: {
|
|
336
|
+
readonly value: "subflow";
|
|
337
|
+
readonly label: "Subflow";
|
|
338
|
+
readonly category: "Flow Control";
|
|
339
|
+
};
|
|
340
|
+
readonly custom: {
|
|
341
|
+
readonly value: "custom";
|
|
342
|
+
readonly label: "Custom";
|
|
343
|
+
readonly category: "Custom";
|
|
344
|
+
};
|
|
345
|
+
readonly documentExtraction: {
|
|
346
|
+
readonly value: "documentExtraction";
|
|
347
|
+
readonly label: "Document Extraction";
|
|
348
|
+
readonly category: "Data Processing";
|
|
349
|
+
};
|
|
350
|
+
readonly apiCall: {
|
|
351
|
+
readonly value: "apiCall";
|
|
352
|
+
readonly label: "API Call";
|
|
353
|
+
readonly category: "Integration";
|
|
354
|
+
};
|
|
355
|
+
readonly accounting: {
|
|
356
|
+
readonly value: "accounting";
|
|
357
|
+
readonly label: "Accounting";
|
|
358
|
+
readonly category: "Accounting";
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
type WorkflowNodeTypeTS = keyof typeof WorkflowNodeTypes;
|
|
362
|
+
type WorkflowNodeTypeOptionTS = typeof WorkflowNodeTypes[WorkflowNodeTypeTS];
|
|
363
|
+
type NodeCategory = "Triggers" | "User Interaction" | "Automation" | "Integration" | "Flow Control" | "Data Processing" | "Time & Scheduling" | "Custom" | "Document Processing" | "API Integration" | "Accounting";
|
|
364
|
+
declare const WorkflowEdgeTypes: Record<string, EdgeTypeDefinition>;
|
|
365
|
+
type WorkflowEdgeTypeTS = keyof typeof WorkflowEdgeTypes;
|
|
366
|
+
type WorkflowEdgeTypeOptionTS = typeof WorkflowEdgeTypes[WorkflowEdgeTypeTS];
|
|
367
|
+
declare const WorkflowTypes: Record<string, WorkflowTypeDefinition>;
|
|
368
|
+
type WorkflowTypeTS = keyof typeof WorkflowTypes;
|
|
369
|
+
type WorkflowTypeOptionTS = typeof WorkflowTypes[WorkflowTypeTS];
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* NodeType represents the primary type of a workflow node
|
|
373
|
+
*/
|
|
374
|
+
type NodeType = string;
|
|
375
|
+
declare const NodeTypeTrigger: NodeType;
|
|
376
|
+
declare const NodeTypeHumanAction: NodeType;
|
|
377
|
+
declare const NodeTypeAgent: NodeType;
|
|
378
|
+
declare const NodeTypeAction: NodeType;
|
|
379
|
+
declare const NodeTypeLogic: NodeType;
|
|
380
|
+
declare const NodeTypeLoop: NodeType;
|
|
381
|
+
declare const NodeTypeParallel: NodeType;
|
|
382
|
+
declare const NodeTypeDelay: NodeType;
|
|
383
|
+
declare const NodeTypeData: NodeType;
|
|
384
|
+
declare const NodeTypeIntegration: NodeType;
|
|
385
|
+
declare const NodeTypeTimer: NodeType;
|
|
386
|
+
declare const NodeTypeSubflow: NodeType;
|
|
387
|
+
declare const NodeTypeCustom: NodeType;
|
|
388
|
+
declare const NodeTypeAccounting: NodeType;
|
|
389
|
+
/**
|
|
390
|
+
* NodeSubType represents the subtype of a workflow node
|
|
391
|
+
* All node subtypes are unified under this single type
|
|
392
|
+
*/
|
|
393
|
+
type NodeSubType = string;
|
|
394
|
+
/**
|
|
395
|
+
* Trigger subtypes
|
|
396
|
+
*/
|
|
397
|
+
declare const NodeSubTypeTriggerStart: NodeSubType;
|
|
398
|
+
declare const NodeSubTypeTriggerEntityRecordCreated: NodeSubType;
|
|
399
|
+
declare const NodeSubTypeTriggerEntityRecordUpdated: NodeSubType;
|
|
400
|
+
declare const NodeSubTypeTriggerEntityRecordDeleted: NodeSubType;
|
|
401
|
+
declare const NodeSubTypeTriggerSLAWarning: NodeSubType;
|
|
402
|
+
declare const NodeSubTypeTriggerSLABreach: NodeSubType;
|
|
403
|
+
declare const NodeSubTypeTriggerEscalation: NodeSubType;
|
|
404
|
+
declare const NodeSubTypeTriggerWebhookReceived: NodeSubType;
|
|
405
|
+
/**
|
|
406
|
+
* Human action subtypes
|
|
407
|
+
*/
|
|
408
|
+
declare const NodeSubTypeHumanActionReview: NodeSubType;
|
|
409
|
+
declare const NodeSubTypeHumanActionApproval: NodeSubType;
|
|
410
|
+
declare const NodeSubTypeHumanActionDataEntry: NodeSubType;
|
|
411
|
+
declare const NodeSubTypeHumanActionAssignment: NodeSubType;
|
|
412
|
+
/**
|
|
413
|
+
* Agent subtypes
|
|
414
|
+
*/
|
|
415
|
+
declare const NodeSubTypeAgentChat: NodeSubType;
|
|
416
|
+
declare const NodeSubTypeAgentIntentDetector: NodeSubType;
|
|
417
|
+
declare const NodeSubTypeAgentKnowledgeGraph: NodeSubType;
|
|
418
|
+
declare const NodeSubTypeAgentClientApiCall: NodeSubType;
|
|
419
|
+
declare const NodeSubTypeAgentTransferToHuman: NodeSubType;
|
|
420
|
+
declare const NodeSubTypeAgentOpenTicket: NodeSubType;
|
|
421
|
+
declare const NodeSubTypeAgentApiIntegration: NodeSubType;
|
|
422
|
+
declare const NodeSubTypeAgentCustomResponse: NodeSubType;
|
|
423
|
+
declare const NodeSubTypeAgentStructuredOutput: NodeSubType;
|
|
424
|
+
/**
|
|
425
|
+
* Action subtypes
|
|
426
|
+
*/
|
|
427
|
+
declare const NodeSubTypeActionApiCall: NodeSubType;
|
|
428
|
+
declare const NodeSubTypeActionDocumentExtraction: NodeSubType;
|
|
429
|
+
declare const NodeSubTypeActionSendEmail: NodeSubType;
|
|
430
|
+
declare const NodeSubTypeActionSendSMS: NodeSubType;
|
|
431
|
+
declare const NodeSubTypeActionGenerateDocument: NodeSubType;
|
|
432
|
+
declare const NodeSubTypeActionProcessPayment: NodeSubType;
|
|
433
|
+
declare const NodeSubTypeActionCreateEntityRecord: NodeSubType;
|
|
434
|
+
declare const NodeSubTypeActionUpdateEntityRecord: NodeSubType;
|
|
435
|
+
declare const NodeSubTypeActionDeleteEntityRecord: NodeSubType;
|
|
436
|
+
declare const NodeSubTypeActionMergeEntityRecords: NodeSubType;
|
|
437
|
+
declare const NodeSubTypeActionAssignSLAPolicy: NodeSubType;
|
|
438
|
+
declare const NodeSubTypeActionChangeSLAStatus: NodeSubType;
|
|
439
|
+
declare const NodeSubTypeActionEscalateSLA: NodeSubType;
|
|
440
|
+
declare const NodeSubTypeActionCSATSurvey: NodeSubType;
|
|
441
|
+
declare const NodeSubTypeActionSetVariables: NodeSubType;
|
|
442
|
+
declare const NodeSubTypeActionQueryEntityRecords: NodeSubType;
|
|
443
|
+
declare const NodeSubTypeActionNatsRequest: NodeSubType;
|
|
444
|
+
/**
|
|
445
|
+
* Logic subtypes
|
|
446
|
+
*/
|
|
447
|
+
declare const NodeSubTypeLogicIf: NodeSubType;
|
|
448
|
+
declare const NodeSubTypeLogicSwitch: NodeSubType;
|
|
449
|
+
declare const NodeSubTypeLogicFor: NodeSubType;
|
|
450
|
+
declare const NodeSubTypeLogicParallel: NodeSubType;
|
|
451
|
+
/**
|
|
452
|
+
* Loop subtypes
|
|
453
|
+
*/
|
|
454
|
+
declare const NodeSubTypeLoopData: NodeSubType;
|
|
455
|
+
/**
|
|
456
|
+
* Delay subtypes
|
|
457
|
+
*/
|
|
458
|
+
declare const NodeSubTypeDelay: NodeSubType;
|
|
459
|
+
/**
|
|
460
|
+
* Data subtypes
|
|
461
|
+
*/
|
|
462
|
+
declare const NodeSubTypeDataFilter: NodeSubType;
|
|
463
|
+
declare const NodeSubTypeDataMap: NodeSubType;
|
|
464
|
+
declare const NodeSubTypeDataCalculate: NodeSubType;
|
|
465
|
+
declare const NodeSubTypeDataValidate: NodeSubType;
|
|
466
|
+
/**
|
|
467
|
+
* Timer subtypes
|
|
468
|
+
*/
|
|
469
|
+
declare const NodeSubTypeTimerDelay: NodeSubType;
|
|
470
|
+
declare const NodeSubTypeTimerSchedule: NodeSubType;
|
|
471
|
+
declare const NodeSubTypeTimerBusinessHours: NodeSubType;
|
|
472
|
+
/**
|
|
473
|
+
* ExpressionType defines the type of expression evaluation to be used
|
|
474
|
+
*/
|
|
475
|
+
type ExpressionType = string;
|
|
476
|
+
/**
|
|
477
|
+
* Simple filter-based expressions using predefined operators
|
|
478
|
+
*/
|
|
479
|
+
declare const ExpressionTypeFilter: ExpressionType;
|
|
480
|
+
/**
|
|
481
|
+
* JavaScript-like expressions with full language features
|
|
482
|
+
*/
|
|
483
|
+
declare const ExpressionTypeJavaScript: ExpressionType;
|
|
484
|
+
/**
|
|
485
|
+
* Template expressions with variable interpolation
|
|
486
|
+
*/
|
|
487
|
+
declare const ExpressionTypeTemplate: ExpressionType;
|
|
488
|
+
/**
|
|
489
|
+
* Custom domain-specific language expressions
|
|
490
|
+
*/
|
|
491
|
+
declare const ExpressionTypeDSL: ExpressionType;
|
|
492
|
+
/**
|
|
493
|
+
* Complex rule-based expressions (e.g., business rules)
|
|
494
|
+
*/
|
|
495
|
+
declare const ExpressionTypeRules: ExpressionType;
|
|
496
|
+
/**
|
|
497
|
+
* EdgeType defines the type and behavior of workflow edges
|
|
498
|
+
*/
|
|
499
|
+
type EdgeType = string;
|
|
500
|
+
/**
|
|
501
|
+
* Standard flow between nodes
|
|
502
|
+
*/
|
|
503
|
+
declare const EdgeTypeNormal: EdgeType;
|
|
504
|
+
/**
|
|
505
|
+
* Loop back to previous node
|
|
506
|
+
*/
|
|
507
|
+
declare const EdgeTypeLoopBack: EdgeType;
|
|
508
|
+
/**
|
|
509
|
+
* Error handling path
|
|
510
|
+
*/
|
|
511
|
+
declare const EdgeTypeError: EdgeType;
|
|
512
|
+
/**
|
|
513
|
+
* Fallback/default path when no other conditions match
|
|
514
|
+
*/
|
|
515
|
+
declare const EdgeTypeDefault: EdgeType;
|
|
516
|
+
/**
|
|
517
|
+
* Path for parallel execution branch
|
|
518
|
+
*/
|
|
519
|
+
declare const EdgeTypeParallel: EdgeType;
|
|
520
|
+
/**
|
|
521
|
+
* Path for conditional branching
|
|
522
|
+
*/
|
|
523
|
+
declare const EdgeTypeConditional: EdgeType;
|
|
524
|
+
/**
|
|
525
|
+
* Path for merging parallel branches
|
|
526
|
+
*/
|
|
527
|
+
declare const EdgeTypeMerge: EdgeType;
|
|
528
|
+
/**
|
|
529
|
+
* Compensating/rollback path
|
|
530
|
+
*/
|
|
531
|
+
declare const EdgeTypeCompensation: EdgeType;
|
|
532
|
+
/**
|
|
533
|
+
* Path for timeout/deadline handling
|
|
534
|
+
*/
|
|
535
|
+
declare const EdgeTypeTimeout: EdgeType;
|
|
536
|
+
type WorkflowType = string;
|
|
537
|
+
declare const WorkflowTypeEntity: WorkflowType;
|
|
538
|
+
declare const WorkflowTypeDocument: WorkflowType;
|
|
539
|
+
declare const WorkflowTypeChat: WorkflowType;
|
|
540
|
+
declare const WorkflowTypeAgent: WorkflowType;
|
|
541
|
+
declare const WorkflowTypeProductivity: WorkflowType;
|
|
542
|
+
/**
|
|
543
|
+
* NodeDefinition is the design-time template for creating WorkflowNode instances.
|
|
544
|
+
* This is the single source of truth for all node types in the workflow system.
|
|
545
|
+
* Generated to TypeScript via schema-generator for use in the workflow designer UI.
|
|
546
|
+
*/
|
|
547
|
+
interface NodeDefinition {
|
|
548
|
+
type: NodeType;
|
|
549
|
+
subType: NodeSubTypeTS;
|
|
550
|
+
label: string;
|
|
551
|
+
icon: string;
|
|
552
|
+
description: string;
|
|
553
|
+
category: string;
|
|
554
|
+
config: JSONSchema;
|
|
555
|
+
input: JSONSchema;
|
|
556
|
+
output: JSONSchema;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* EdgeTypeDefinition defines metadata for an edge type
|
|
560
|
+
*/
|
|
561
|
+
interface EdgeTypeDefinition {
|
|
562
|
+
value: string;
|
|
563
|
+
label: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* WorkflowTypeDefinition defines metadata for a workflow type
|
|
567
|
+
*/
|
|
568
|
+
interface WorkflowTypeDefinition {
|
|
569
|
+
value: string;
|
|
570
|
+
label: string;
|
|
571
|
+
}
|
|
572
|
+
interface LogicPath {
|
|
573
|
+
id: string;
|
|
574
|
+
nodeId: string;
|
|
575
|
+
condition: string;
|
|
576
|
+
priority: number;
|
|
577
|
+
}
|
|
578
|
+
interface Intent {
|
|
579
|
+
id: string;
|
|
580
|
+
nodeId: string;
|
|
581
|
+
name: string;
|
|
582
|
+
description: string;
|
|
583
|
+
}
|
|
584
|
+
interface ResponseMetadata {
|
|
585
|
+
success: boolean;
|
|
586
|
+
timestamp: string;
|
|
587
|
+
message?: string;
|
|
588
|
+
error?: string;
|
|
589
|
+
}
|
|
590
|
+
interface Metadata {
|
|
591
|
+
createdBy: string;
|
|
592
|
+
createdAt: string;
|
|
593
|
+
updatedBy?: string;
|
|
594
|
+
updatedAt?: string;
|
|
595
|
+
isActive: boolean;
|
|
596
|
+
version: number;
|
|
597
|
+
}
|
|
598
|
+
interface CreateWorkflowDefinitionRequest {
|
|
599
|
+
definition: WorkflowDefinition;
|
|
600
|
+
orgId: string;
|
|
601
|
+
}
|
|
602
|
+
interface UpdateWorkflowDefinitionRequest {
|
|
603
|
+
definition: WorkflowDefinition;
|
|
604
|
+
orgId: string;
|
|
605
|
+
}
|
|
606
|
+
interface WorkflowDefinitionResponse {
|
|
607
|
+
definition: WorkflowDefinition;
|
|
608
|
+
metadata: ResponseMetadata;
|
|
609
|
+
}
|
|
610
|
+
interface GetWorkflowDefinitionRequest {
|
|
611
|
+
id: string;
|
|
612
|
+
orgId: string;
|
|
613
|
+
}
|
|
614
|
+
interface GetWorkflowDefinitionByTitleRequest {
|
|
615
|
+
title: string;
|
|
616
|
+
orgId: string;
|
|
617
|
+
}
|
|
618
|
+
interface ListWorkflowDefinitionsRequest {
|
|
619
|
+
orgId: string;
|
|
620
|
+
status?: string;
|
|
621
|
+
}
|
|
622
|
+
interface ListWorkflowDefinitionsResponse {
|
|
623
|
+
definitions: WorkflowDefinition[];
|
|
624
|
+
metadata: ResponseMetadata;
|
|
625
|
+
}
|
|
626
|
+
interface DeleteWorkflowDefinitionRequest {
|
|
627
|
+
id: string;
|
|
628
|
+
orgId: string;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Workflow Definition models
|
|
632
|
+
*/
|
|
633
|
+
interface WorkflowDefinition {
|
|
634
|
+
/**
|
|
635
|
+
* Core Identity
|
|
636
|
+
*/
|
|
637
|
+
id?: string;
|
|
638
|
+
title: string;
|
|
639
|
+
description: string;
|
|
640
|
+
type: WorkflowTypeTS;
|
|
641
|
+
/**
|
|
642
|
+
* Graph Structure
|
|
643
|
+
*/
|
|
644
|
+
nodes: {
|
|
645
|
+
[key: string]: WorkflowNode;
|
|
646
|
+
};
|
|
647
|
+
edges: WorkflowEdge[];
|
|
648
|
+
entryPoints: string[];
|
|
649
|
+
/**
|
|
650
|
+
* Data Management
|
|
651
|
+
*/
|
|
652
|
+
variables: WorkflowVariables;
|
|
653
|
+
constants?: {
|
|
654
|
+
[key: string]: any;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Runtime Configuration
|
|
658
|
+
*/
|
|
659
|
+
persistence?: PersistenceType;
|
|
660
|
+
/**
|
|
661
|
+
* Validation and Constraints
|
|
662
|
+
*/
|
|
663
|
+
rules?: WorkflowRule[];
|
|
664
|
+
permissions: WorkflowPermissions;
|
|
665
|
+
/**
|
|
666
|
+
* Metadata and Tracking
|
|
667
|
+
*/
|
|
668
|
+
metadata: WorkflowMetadata;
|
|
669
|
+
}
|
|
670
|
+
interface WorkflowVariables {
|
|
671
|
+
schema: JSONSchema;
|
|
672
|
+
scope: {
|
|
673
|
+
[key: string]: string;
|
|
674
|
+
};
|
|
675
|
+
defaultValues: {
|
|
676
|
+
[key: string]: any;
|
|
677
|
+
};
|
|
678
|
+
computed: {
|
|
679
|
+
[key: string]: string;
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
interface WorkflowRule {
|
|
683
|
+
name: string;
|
|
684
|
+
description: string;
|
|
685
|
+
condition: string;
|
|
686
|
+
action: string;
|
|
687
|
+
level: RuleLevel;
|
|
688
|
+
}
|
|
689
|
+
type RuleLevel = string;
|
|
690
|
+
declare const RuleLevelError: RuleLevel;
|
|
691
|
+
declare const RuleLevelWarning: RuleLevel;
|
|
692
|
+
declare const RuleLevelInfo: RuleLevel;
|
|
693
|
+
interface WorkflowPermissions {
|
|
694
|
+
roles: {
|
|
695
|
+
[key: string]: string[];
|
|
696
|
+
};
|
|
697
|
+
accessLevel: string;
|
|
698
|
+
editableBy: string[];
|
|
699
|
+
viewableBy: string[];
|
|
700
|
+
}
|
|
701
|
+
interface WorkflowMetadata {
|
|
702
|
+
createdBy: string;
|
|
703
|
+
createdAt: string;
|
|
704
|
+
updatedBy?: string;
|
|
705
|
+
updatedAt?: string;
|
|
706
|
+
isActive: boolean;
|
|
707
|
+
version: number;
|
|
708
|
+
tags?: string[];
|
|
709
|
+
category?: string;
|
|
710
|
+
labels?: string[];
|
|
711
|
+
}
|
|
712
|
+
type PersistenceType = string;
|
|
713
|
+
declare const PersistenceTypeEphemeral: PersistenceType;
|
|
714
|
+
declare const PersistenceTypePermanent: PersistenceType;
|
|
715
|
+
/**
|
|
716
|
+
* todo: validate default values against schema
|
|
717
|
+
*/
|
|
718
|
+
interface NodeInput {
|
|
719
|
+
schema: JSONSchema;
|
|
720
|
+
defaultValues?: {
|
|
721
|
+
[key: string]: any;
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
interface NodeOutput {
|
|
725
|
+
schema: JSONSchema;
|
|
726
|
+
/**
|
|
727
|
+
* Mapping map[string]string `json:"mapping,omitempty"`
|
|
728
|
+
*/
|
|
729
|
+
values?: {
|
|
730
|
+
[key: string]: any;
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
interface NodeConfig {
|
|
734
|
+
schema: JSONSchema;
|
|
735
|
+
values: {
|
|
736
|
+
[key: string]: any;
|
|
737
|
+
};
|
|
738
|
+
promoteToVariables?: string[];
|
|
739
|
+
}
|
|
740
|
+
interface WorkflowNode {
|
|
741
|
+
id: string;
|
|
742
|
+
title: string;
|
|
743
|
+
name: string;
|
|
744
|
+
label?: string;
|
|
745
|
+
description?: string;
|
|
746
|
+
type: WorkflowNodeTypeTS;
|
|
747
|
+
subType?: WorkflowNodeSubTypeTS;
|
|
748
|
+
config: NodeConfig;
|
|
749
|
+
settings: NodeSettings;
|
|
750
|
+
input: NodeInput;
|
|
751
|
+
output: NodeOutput;
|
|
752
|
+
isStart: boolean;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* NodeSettings contains type-specific configuration
|
|
756
|
+
*/
|
|
757
|
+
interface NodeSettings {
|
|
758
|
+
/**
|
|
759
|
+
* Shared configs
|
|
760
|
+
*/
|
|
761
|
+
execution?: ExecutionConfig;
|
|
762
|
+
retry?: RetryConfig;
|
|
763
|
+
}
|
|
764
|
+
interface ExecutionConfig {
|
|
765
|
+
timeoutSeconds: number;
|
|
766
|
+
priority: number;
|
|
767
|
+
subject?: string;
|
|
768
|
+
}
|
|
769
|
+
interface RetryConfig {
|
|
770
|
+
maxAttempts: number;
|
|
771
|
+
initialDelay: any;
|
|
772
|
+
maxDelay: any;
|
|
773
|
+
backoffMultiplier: number;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* CacheConfig defines caching behavior for expression results
|
|
777
|
+
*/
|
|
778
|
+
interface CacheConfig {
|
|
779
|
+
enabled: boolean;
|
|
780
|
+
ttl: any;
|
|
781
|
+
key?: string;
|
|
782
|
+
tags?: string[];
|
|
783
|
+
}
|
|
784
|
+
interface ExpressionConfig {
|
|
785
|
+
type: ExpressionType;
|
|
786
|
+
expression: string;
|
|
787
|
+
variables?: string[];
|
|
788
|
+
timeout?: any;
|
|
789
|
+
cache?: CacheConfig;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Example usage in full edge structure
|
|
793
|
+
*/
|
|
794
|
+
interface WorkflowEdge {
|
|
795
|
+
id: string;
|
|
796
|
+
fromNodeId: string;
|
|
797
|
+
toNodeId: string;
|
|
798
|
+
type: WorkflowEdgeTypeTS;
|
|
799
|
+
label?: string;
|
|
800
|
+
expression?: ExpressionConfig;
|
|
801
|
+
priority: number;
|
|
802
|
+
retry?: RetryConfig;
|
|
803
|
+
timeout?: TimeoutConfig;
|
|
804
|
+
properties?: {
|
|
805
|
+
[key: string]: string;
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* TimeoutConfig defines timeout behavior for nodes and edges
|
|
810
|
+
*/
|
|
811
|
+
interface TimeoutConfig {
|
|
812
|
+
duration: any;
|
|
813
|
+
action: TimeoutAction;
|
|
814
|
+
retryPolicy?: RetryConfig;
|
|
815
|
+
}
|
|
816
|
+
type TimeoutAction = string;
|
|
817
|
+
declare const TimeoutActionFail: TimeoutAction;
|
|
818
|
+
declare const TimeoutActionSkip: TimeoutAction;
|
|
819
|
+
declare const TimeoutActionRetry: TimeoutAction;
|
|
820
|
+
declare const TimeoutActionAlt: TimeoutAction;
|
|
821
|
+
interface CreateWorkflowInstanceRequest {
|
|
822
|
+
orgId: string;
|
|
823
|
+
definitionId: string;
|
|
824
|
+
variables: {
|
|
825
|
+
[key: string]: any;
|
|
826
|
+
};
|
|
827
|
+
autoExecute: boolean;
|
|
828
|
+
}
|
|
829
|
+
interface WorkflowInstanceResponse {
|
|
830
|
+
instance?: WorkflowInstance;
|
|
831
|
+
metadata: ResponseMetadata;
|
|
832
|
+
}
|
|
833
|
+
interface WorkflowInstanceExecuteNodeRequest {
|
|
834
|
+
orgId: string;
|
|
835
|
+
instanceId: string;
|
|
836
|
+
nodeId: string;
|
|
837
|
+
input: {
|
|
838
|
+
[key: string]: any;
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
interface WorkflowInstanceResumeNodeRequest {
|
|
842
|
+
orgId: string;
|
|
843
|
+
instanceId: string;
|
|
844
|
+
nodeId: string;
|
|
845
|
+
result: {
|
|
846
|
+
[key: string]: any;
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
interface WorkflowInstanceExecuteNodeLeanRequest {
|
|
850
|
+
orgId: string;
|
|
851
|
+
nodeDef: WorkflowNode;
|
|
852
|
+
input: {
|
|
853
|
+
[key: string]: any;
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
interface UpdateInstanceNodeMetadataRequest {
|
|
857
|
+
orgId: string;
|
|
858
|
+
instanceId: string;
|
|
859
|
+
nodeId: string;
|
|
860
|
+
metadataKey: string;
|
|
861
|
+
payload: any;
|
|
862
|
+
}
|
|
863
|
+
interface GetWorkflowInstanceRequest {
|
|
864
|
+
orgId: string;
|
|
865
|
+
instanceId: string;
|
|
866
|
+
}
|
|
867
|
+
interface ListWorkflowInstancesRequest {
|
|
868
|
+
orgId: string;
|
|
869
|
+
definitionId: string;
|
|
870
|
+
}
|
|
871
|
+
interface ListWorkflowInstancesResponse {
|
|
872
|
+
instances: WorkflowInstance[];
|
|
873
|
+
metadata: ResponseMetadata;
|
|
874
|
+
}
|
|
875
|
+
interface UpdateInstanceStatusRequest {
|
|
876
|
+
orgId: string;
|
|
877
|
+
instanceId: string;
|
|
878
|
+
status: InstanceStatus;
|
|
879
|
+
}
|
|
880
|
+
interface RetryNodeRequest {
|
|
881
|
+
orgId: string;
|
|
882
|
+
instanceId: string;
|
|
883
|
+
nodeId: string;
|
|
884
|
+
}
|
|
885
|
+
interface ListInstancesOptions {
|
|
886
|
+
definitionId: string;
|
|
887
|
+
status: InstanceStatus;
|
|
888
|
+
limit: number;
|
|
889
|
+
offset: number;
|
|
890
|
+
}
|
|
891
|
+
interface InstanceState {
|
|
892
|
+
variables: {
|
|
893
|
+
[key: string]: any;
|
|
894
|
+
};
|
|
895
|
+
constants: {
|
|
896
|
+
[key: string]: any;
|
|
897
|
+
};
|
|
898
|
+
nodeStates: {
|
|
899
|
+
[key: string]: NodeState;
|
|
900
|
+
};
|
|
901
|
+
edgeStates: {
|
|
902
|
+
[key: string]: EdgeState;
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
interface ExecutionContext {
|
|
906
|
+
currentNodes: string[];
|
|
907
|
+
path: ExecutionPathEntry[];
|
|
908
|
+
errors: ExecutionError[];
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Workflow Instance models
|
|
912
|
+
*/
|
|
913
|
+
interface WorkflowInstance {
|
|
914
|
+
id?: string;
|
|
915
|
+
orgId?: string;
|
|
916
|
+
definitionId: string;
|
|
917
|
+
title?: string;
|
|
918
|
+
description?: string;
|
|
919
|
+
type?: WorkflowType;
|
|
920
|
+
definitionVersion: number;
|
|
921
|
+
status: InstanceStatus;
|
|
922
|
+
state: InstanceState;
|
|
923
|
+
context: ExecutionContext;
|
|
924
|
+
persistence?: PersistenceType;
|
|
925
|
+
metadata: WorkflowMetadata;
|
|
926
|
+
}
|
|
927
|
+
interface NodeState {
|
|
928
|
+
status: NodeStatus;
|
|
929
|
+
input?: {
|
|
930
|
+
[key: string]: any;
|
|
931
|
+
};
|
|
932
|
+
output?: {
|
|
933
|
+
[key: string]: any;
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
936
|
+
* Variables map[string]interface{} `json:"variables,omitempty"`
|
|
937
|
+
*/
|
|
938
|
+
error?: string;
|
|
939
|
+
startTime?: string;
|
|
940
|
+
endTime?: string;
|
|
941
|
+
retryCount: number;
|
|
942
|
+
nextRetryAt?: string;
|
|
943
|
+
}
|
|
944
|
+
interface EdgeState {
|
|
945
|
+
status: EdgeStatus;
|
|
946
|
+
timestamp: string;
|
|
947
|
+
error?: string;
|
|
948
|
+
}
|
|
949
|
+
interface ExecutionPathEntry {
|
|
950
|
+
nodeId: string;
|
|
951
|
+
edgeId: string;
|
|
952
|
+
type: string;
|
|
953
|
+
timestamp: string;
|
|
954
|
+
data?: {
|
|
955
|
+
[key: string]: any;
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
interface ExecutionError {
|
|
959
|
+
nodeId?: string;
|
|
960
|
+
edgeId?: string;
|
|
961
|
+
error: string;
|
|
962
|
+
timestamp: string;
|
|
963
|
+
retryable: boolean;
|
|
964
|
+
}
|
|
965
|
+
type InstanceStatus = string;
|
|
966
|
+
declare const InstanceStatusNew: InstanceStatus;
|
|
967
|
+
declare const InstanceStatusRunning: InstanceStatus;
|
|
968
|
+
declare const InstanceStatusWaiting: InstanceStatus;
|
|
969
|
+
declare const InstanceStatusPaused: InstanceStatus;
|
|
970
|
+
declare const InstanceStatusCompleted: InstanceStatus;
|
|
971
|
+
declare const InstanceStatusFailed: InstanceStatus;
|
|
972
|
+
interface NodeInstance {
|
|
973
|
+
nodeId: string;
|
|
974
|
+
status: NodeStatus;
|
|
975
|
+
input?: {
|
|
976
|
+
[key: string]: any;
|
|
977
|
+
};
|
|
978
|
+
output?: {
|
|
979
|
+
[key: string]: any;
|
|
980
|
+
};
|
|
981
|
+
error?: string;
|
|
982
|
+
startTime?: string;
|
|
983
|
+
endTime?: string;
|
|
984
|
+
retryCount: number;
|
|
985
|
+
nextRetryAt?: string;
|
|
986
|
+
}
|
|
987
|
+
type NodeStatus = string;
|
|
988
|
+
declare const NodeStatusPending: NodeStatus;
|
|
989
|
+
declare const NodeStatusRunning: NodeStatus;
|
|
990
|
+
declare const NodeStatusCompleted: NodeStatus;
|
|
991
|
+
declare const NodeStatusFailed: NodeStatus;
|
|
992
|
+
declare const NodeStatusWaiting: NodeStatus;
|
|
993
|
+
declare const NodeStatusSkipped: NodeStatus;
|
|
994
|
+
type EdgeStatus = string;
|
|
995
|
+
declare const EdgeStatusPending: EdgeStatus;
|
|
996
|
+
declare const EdgeStatusCompleted: EdgeStatus;
|
|
997
|
+
declare const EdgeStatusSkipped: EdgeStatus;
|
|
998
|
+
/**
|
|
999
|
+
* WorkflowDefinitionInfo holds summarized info about an active workflow definition
|
|
1000
|
+
* Used by schedulers and services that need to process workflows without full definition details
|
|
1001
|
+
*/
|
|
1002
|
+
interface WorkflowDefinitionInfo {
|
|
1003
|
+
id: string;
|
|
1004
|
+
orgId: string;
|
|
1005
|
+
title: string;
|
|
1006
|
+
type: string;
|
|
1007
|
+
category: string;
|
|
1008
|
+
isActive: boolean;
|
|
1009
|
+
createdBy: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* User config from definition.variables.defaultValues (workflow-specific)
|
|
1012
|
+
*/
|
|
1013
|
+
provider?: string;
|
|
1014
|
+
userEmail?: string;
|
|
1015
|
+
userId?: string;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
declare const WorkflowDefinitionCreate = "workflow.definition.create";
|
|
1019
|
+
declare const WorkflowDefinitionCreated = "workflow.definition.created";
|
|
1020
|
+
declare const WorkflowDefinitionUpdate = "workflow.definition.update";
|
|
1021
|
+
declare const WorkflowDefinitionUpdated = "workflow.definition.updated";
|
|
1022
|
+
declare const WorkflowDefinitionGet = "workflow.definition.get";
|
|
1023
|
+
declare const WorkflowDefinitionGetServer = "workflow.definition.get.server";
|
|
1024
|
+
declare const WorkflowDefinitionGetByTitle = "workflow.definition.get.by.title";
|
|
1025
|
+
declare const WorkflowDefinitionList = "workflow.definition.list";
|
|
1026
|
+
declare const WorkflowDefinitionDelete = "workflow.definition.delete";
|
|
1027
|
+
declare const WorkflowDefinitionDeleted = "workflow.definition.deleted";
|
|
1028
|
+
declare const WorkflowInstanceCreate = "workflow.instance.create";
|
|
1029
|
+
declare const WorkflowInstanceExecuteNode = "workflow.instance.execute.node";
|
|
1030
|
+
declare const WorkflowInstanceResumeNode = "workflow.instance.resume.node";
|
|
1031
|
+
declare const WorkflowInstanceExecuteNodeServer = "workflow.instance.execute.node.server";
|
|
1032
|
+
declare const WorkflowInstanceResumeNodeServer = "workflow.instance.resume.node.server";
|
|
1033
|
+
declare const WorkflowInstanceExecuteNodeLean = "workflow.instance.execute.node.lean";
|
|
1034
|
+
declare const WorkflowInstanceExecuteNodeLeanServer = "workflow.instance.execute.node.lean.server";
|
|
1035
|
+
declare const WorkflowInstanceGet = "workflow.instance.get";
|
|
1036
|
+
declare const WorkflowInstanceList = "workflow.instance.list";
|
|
1037
|
+
declare const WorkflowInstanceUpdate = "workflow.instance.update";
|
|
1038
|
+
declare const WorkflowInstanceUpdated = "workflow.instance.updated";
|
|
1039
|
+
declare const WorkflowInstanceUpdateNodeMetadata = "workflow.instance.update.node.metadata";
|
|
1040
|
+
/**
|
|
1041
|
+
* Template management
|
|
1042
|
+
*/
|
|
1043
|
+
declare const WorkflowTemplateList = "workflow.template.list";
|
|
1044
|
+
declare const WorkflowTemplateGet = "workflow.template.get";
|
|
1045
|
+
declare const WorkflowTemplateInstantiate = "workflow.template.instantiate";
|
|
1046
|
+
/**
|
|
1047
|
+
* Schedule management
|
|
1048
|
+
*/
|
|
1049
|
+
declare const WorkflowScheduleCreate = "workflow.schedule.create";
|
|
1050
|
+
declare const WorkflowScheduleUpdate = "workflow.schedule.update";
|
|
1051
|
+
declare const WorkflowScheduleDelete = "workflow.schedule.delete";
|
|
1052
|
+
declare const WorkflowScheduleList = "workflow.schedule.list";
|
|
1053
|
+
declare const WorkflowSchedulePause = "workflow.schedule.pause";
|
|
1054
|
+
declare const WorkflowScheduleResume = "workflow.schedule.resume";
|
|
1055
|
+
/**
|
|
1056
|
+
* Trigger management
|
|
1057
|
+
*/
|
|
1058
|
+
declare const WorkflowTriggerRegister = "workflow.trigger.register";
|
|
1059
|
+
declare const WorkflowTriggerPause = "workflow.trigger.pause";
|
|
1060
|
+
declare const WorkflowTriggerResume = "workflow.trigger.resume";
|
|
1061
|
+
declare const WorkflowTriggerStatus = "workflow.trigger.status";
|
|
1062
|
+
declare const WorkflowTriggerFired = "workflow.trigger.fired";
|
|
1063
|
+
/**
|
|
1064
|
+
* Execution events
|
|
1065
|
+
*/
|
|
1066
|
+
declare const WorkflowExecutionStarted = "workflow.execution.started";
|
|
1067
|
+
declare const WorkflowExecutionCompleted = "workflow.execution.completed";
|
|
1068
|
+
declare const WorkflowExecutionFailed = "workflow.execution.failed";
|
|
1069
|
+
|
|
1070
|
+
type UseWorkflowDefinitionType = {
|
|
1071
|
+
definitions: Record<string, WorkflowDefinition>;
|
|
1072
|
+
selectedDefinition?: WorkflowDefinition;
|
|
1073
|
+
isLoading: boolean;
|
|
1074
|
+
loadingStates: Record<string, boolean>;
|
|
1075
|
+
error?: string;
|
|
1076
|
+
loadDefinitions: () => Promise<void>;
|
|
1077
|
+
loadDefinition: (id: string) => Promise<void>;
|
|
1078
|
+
resetSelectedDefinition: () => void;
|
|
1079
|
+
createDefinition: (definition: WorkflowDefinition) => Promise<WorkflowDefinitionResponse>;
|
|
1080
|
+
updateDefinition: (id: string, definition: WorkflowDefinition) => Promise<WorkflowDefinitionResponse>;
|
|
1081
|
+
deleteDefinition: (id: string) => Promise<ResponseMetadata>;
|
|
1082
|
+
refresh: () => void;
|
|
1083
|
+
};
|
|
1084
|
+
interface UseWorkflowDefinitionOptions {
|
|
1085
|
+
autoLoad?: boolean;
|
|
1086
|
+
}
|
|
1087
|
+
declare function useWorkflowDefinition(orgId: string | undefined, definitionId?: string, options?: UseWorkflowDefinitionOptions): UseWorkflowDefinitionType;
|
|
1088
|
+
|
|
1089
|
+
type UseWorkflowInstanceType = {
|
|
1090
|
+
instances: Record<string, WorkflowInstance>;
|
|
1091
|
+
selectedInstance?: WorkflowInstance;
|
|
1092
|
+
doSetSelectedInstance: (instance: WorkflowInstance | undefined) => void;
|
|
1093
|
+
isLoading: boolean;
|
|
1094
|
+
loadingStates: Record<string, boolean>;
|
|
1095
|
+
error?: string;
|
|
1096
|
+
loadInstances: (definitionId: string) => Promise<void>;
|
|
1097
|
+
loadInstance: (id: string) => Promise<void>;
|
|
1098
|
+
getInstance: (id: string) => Promise<WorkflowInstanceResponse>;
|
|
1099
|
+
createInstance: (definitionId: string, variables?: {
|
|
1100
|
+
[key: string]: any;
|
|
1101
|
+
}) => Promise<WorkflowInstanceResponse>;
|
|
1102
|
+
executeNode: (instanceId: string, nodeId: string, input?: any) => Promise<WorkflowInstanceResponse>;
|
|
1103
|
+
updateInstanceNodeMetadata: (instanceId: string, nodeId: string, metadataKey: string, payload: any) => Promise<WorkflowInstanceResponse>;
|
|
1104
|
+
resumeInstanceNode: (instanceId: string, nodeId: string, result: {
|
|
1105
|
+
[key: string]: any;
|
|
1106
|
+
}) => Promise<WorkflowInstanceResponse>;
|
|
1107
|
+
refresh: () => void;
|
|
1108
|
+
};
|
|
1109
|
+
interface UseWorkflowInstanceOptions {
|
|
1110
|
+
autoLoad?: boolean;
|
|
1111
|
+
}
|
|
1112
|
+
declare function useWorkflowInstance(orgId: string | undefined, instanceId?: string, definitionId?: string, options?: UseWorkflowInstanceOptions): UseWorkflowInstanceType;
|
|
1113
|
+
|
|
1114
|
+
declare const WorkflowDefinitionContext: React$1.Context<UseWorkflowDefinitionType | undefined>;
|
|
1115
|
+
interface WorkflowDefinitionProviderProps {
|
|
1116
|
+
children: React$1.ReactNode;
|
|
1117
|
+
orgId?: string;
|
|
1118
|
+
definitionId?: string;
|
|
1119
|
+
options?: UseWorkflowDefinitionOptions;
|
|
1120
|
+
}
|
|
1121
|
+
declare function WorkflowDefinitionProvider({ children, orgId, definitionId, options, }: WorkflowDefinitionProviderProps): react_jsx_runtime.JSX.Element;
|
|
1122
|
+
declare function useWorkflowDefinitionContext(): UseWorkflowDefinitionType;
|
|
1123
|
+
|
|
1124
|
+
declare const WorkflowInstanceContext: React$1.Context<UseWorkflowInstanceType | undefined>;
|
|
1125
|
+
interface WorkflowInstanceProviderProps {
|
|
1126
|
+
children: React$1.ReactNode;
|
|
1127
|
+
orgId: string;
|
|
1128
|
+
instanceId?: string;
|
|
1129
|
+
definitionId?: string;
|
|
1130
|
+
options?: UseWorkflowInstanceOptions;
|
|
1131
|
+
}
|
|
1132
|
+
declare function WorkflowInstanceProvider({ children, orgId, instanceId, definitionId, options, }: WorkflowInstanceProviderProps): react_jsx_runtime.JSX.Element;
|
|
1133
|
+
declare function useWorkflowInstanceContext(): UseWorkflowInstanceType;
|
|
1134
|
+
|
|
1135
|
+
interface WorkflowDefinitionState {
|
|
1136
|
+
definitions: Record<string, WorkflowDefinition>;
|
|
1137
|
+
selectedDefinition?: WorkflowDefinition;
|
|
1138
|
+
isLoading: boolean;
|
|
1139
|
+
error?: string;
|
|
1140
|
+
loadingStates: Record<string, boolean>;
|
|
1141
|
+
}
|
|
1142
|
+
interface WorkflowDefinitionSelector {
|
|
1143
|
+
workflowDefinition: WorkflowDefinitionState;
|
|
1144
|
+
}
|
|
1145
|
+
declare const workflowDefinitionReducer: redux.Reducer<WorkflowDefinitionState>;
|
|
1146
|
+
|
|
1147
|
+
interface WorkflowInstanceState {
|
|
1148
|
+
instances: Record<string, WorkflowInstance>;
|
|
1149
|
+
selectedInstance?: WorkflowInstance;
|
|
1150
|
+
isLoading: boolean;
|
|
1151
|
+
error?: string;
|
|
1152
|
+
loadingStates: Record<string, boolean>;
|
|
1153
|
+
}
|
|
1154
|
+
interface WorkflowInstanceSelector {
|
|
1155
|
+
workflowInstance: WorkflowInstanceState;
|
|
1156
|
+
}
|
|
1157
|
+
declare const workflowInstanceReducer: redux.Reducer<WorkflowInstanceState>;
|
|
1158
|
+
|
|
1159
|
+
export { type AccountingNodeSubType, AccountingNodeSubTypes, type ActionNodeSubType, ActionNodeSubTypes, type AgentNodeSubType, AgentNodeSubTypes, type CacheConfig, type CreateWorkflowDefinitionRequest, type CreateWorkflowInstanceRequest, type DataNodeSubType, DataNodeSubTypes, type DelayNodeSubType, DelayNodeSubTypes, type DeleteWorkflowDefinitionRequest, DynamicSchemaForm, type DynamicSchemaFormProps, type DynamicSchemaFormUIComponents, type EdgeState, type EdgeStatus, EdgeStatusCompleted, EdgeStatusPending, EdgeStatusSkipped, type EdgeType, EdgeTypeCompensation, EdgeTypeConditional, EdgeTypeDefault, type EdgeTypeDefinition, EdgeTypeError, EdgeTypeLoopBack, EdgeTypeMerge, EdgeTypeNormal, EdgeTypeParallel, EdgeTypeTimeout, type ExecutionConfig, type ExecutionContext, type ExecutionError, type ExecutionPathEntry, type ExpressionConfig, type ExpressionType, ExpressionTypeDSL, ExpressionTypeFilter, ExpressionTypeJavaScript, ExpressionTypeRules, ExpressionTypeTemplate, type GetWorkflowDefinitionByTitleRequest, type GetWorkflowDefinitionRequest, type GetWorkflowInstanceRequest, type HumanActionNodeSubType, HumanActionNodeSubTypes, type InstanceState, type InstanceStatus, InstanceStatusCompleted, InstanceStatusFailed, InstanceStatusNew, InstanceStatusPaused, InstanceStatusRunning, InstanceStatusWaiting, type Intent, type ListInstancesOptions, type ListWorkflowDefinitionsRequest, type ListWorkflowDefinitionsResponse, type ListWorkflowInstancesRequest, type ListWorkflowInstancesResponse, type LogicNodeSubType, LogicNodeSubTypes, type LogicPath, type LoopNodeSubType, LoopNodeSubTypes, type Metadata, type NodeCategory, type NodeConfig, type NodeDefinition, type NodeInput, type NodeInstance, type NodeOutput, type NodeSettings, type NodeState, type NodeStatus, NodeStatusCompleted, NodeStatusFailed, NodeStatusPending, NodeStatusRunning, NodeStatusSkipped, NodeStatusWaiting, type NodeSubType, NodeSubTypeActionApiCall, NodeSubTypeActionAssignSLAPolicy, NodeSubTypeActionCSATSurvey, NodeSubTypeActionChangeSLAStatus, NodeSubTypeActionCreateEntityRecord, NodeSubTypeActionDeleteEntityRecord, NodeSubTypeActionDocumentExtraction, NodeSubTypeActionEscalateSLA, NodeSubTypeActionGenerateDocument, NodeSubTypeActionMergeEntityRecords, NodeSubTypeActionNatsRequest, NodeSubTypeActionProcessPayment, NodeSubTypeActionQueryEntityRecords, NodeSubTypeActionSendEmail, NodeSubTypeActionSendSMS, NodeSubTypeActionSetVariables, NodeSubTypeActionUpdateEntityRecord, NodeSubTypeAgentApiIntegration, NodeSubTypeAgentChat, NodeSubTypeAgentClientApiCall, NodeSubTypeAgentCustomResponse, NodeSubTypeAgentIntentDetector, NodeSubTypeAgentKnowledgeGraph, NodeSubTypeAgentOpenTicket, NodeSubTypeAgentStructuredOutput, NodeSubTypeAgentTransferToHuman, NodeSubTypeDataCalculate, NodeSubTypeDataFilter, NodeSubTypeDataMap, NodeSubTypeDataValidate, NodeSubTypeDelay, NodeSubTypeHumanActionApproval, NodeSubTypeHumanActionAssignment, NodeSubTypeHumanActionDataEntry, NodeSubTypeHumanActionReview, type NodeSubTypeInfo, NodeSubTypeLogicFor, NodeSubTypeLogicIf, NodeSubTypeLogicParallel, NodeSubTypeLogicSwitch, NodeSubTypeLoopData, type NodeSubTypeTS, NodeSubTypeTimerBusinessHours, NodeSubTypeTimerDelay, NodeSubTypeTimerSchedule, NodeSubTypeTriggerEntityRecordCreated, NodeSubTypeTriggerEntityRecordDeleted, NodeSubTypeTriggerEntityRecordUpdated, NodeSubTypeTriggerEscalation, NodeSubTypeTriggerSLABreach, NodeSubTypeTriggerSLAWarning, NodeSubTypeTriggerStart, NodeSubTypeTriggerWebhookReceived, type NodeType, NodeTypeAccounting, NodeTypeAction, NodeTypeAgent, NodeTypeCustom, NodeTypeData, NodeTypeDelay, NodeTypeHumanAction, NodeTypeIntegration, NodeTypeLogic, NodeTypeLoop, NodeTypeParallel, NodeTypeSubflow, NodeTypeTimer, NodeTypeTrigger, type ParallelNodeSubType, ParallelNodeSubTypes, type PersistenceType, PersistenceTypeEphemeral, PersistenceTypePermanent, type ResponseMetadata, type RetryConfig, type RetryNodeRequest, type RuleLevel, RuleLevelError, RuleLevelInfo, RuleLevelWarning, SchemaBuilder, type SchemaBuilderProps, type SchemaBuilderUIComponents, type TimeoutAction, TimeoutActionAlt, TimeoutActionFail, TimeoutActionRetry, TimeoutActionSkip, type TimeoutConfig, type TimerNodeSubType, TimerNodeSubTypes, type TriggerNodeSubType, TriggerNodeSubTypes, type UpdateInstanceNodeMetadataRequest, type UpdateInstanceStatusRequest, type UpdateWorkflowDefinitionRequest, type UseWorkflowDefinitionOptions, type UseWorkflowDefinitionType, type UseWorkflowInstanceOptions, type UseWorkflowInstanceType, type WorkflowDefinition, WorkflowDefinitionContext, WorkflowDefinitionCreate, WorkflowDefinitionCreated, WorkflowDefinitionDelete, WorkflowDefinitionDeleted, WorkflowDefinitionGet, WorkflowDefinitionGetByTitle, WorkflowDefinitionGetServer, type WorkflowDefinitionInfo, WorkflowDefinitionList, WorkflowDefinitionProvider, type WorkflowDefinitionProviderProps, type WorkflowDefinitionResponse, type WorkflowDefinitionSelector, type WorkflowDefinitionState, WorkflowDefinitionUpdate, WorkflowDefinitionUpdated, type WorkflowEdge, type WorkflowEdgeTypeOptionTS, type WorkflowEdgeTypeTS, WorkflowEdgeTypes, WorkflowExecutionCompleted, WorkflowExecutionFailed, WorkflowExecutionStarted, type WorkflowInstance, WorkflowInstanceContext, WorkflowInstanceCreate, WorkflowInstanceExecuteNode, WorkflowInstanceExecuteNodeLean, type WorkflowInstanceExecuteNodeLeanRequest, WorkflowInstanceExecuteNodeLeanServer, type WorkflowInstanceExecuteNodeRequest, WorkflowInstanceExecuteNodeServer, WorkflowInstanceGet, WorkflowInstanceList, WorkflowInstanceProvider, type WorkflowInstanceProviderProps, type WorkflowInstanceResponse, WorkflowInstanceResumeNode, type WorkflowInstanceResumeNodeRequest, WorkflowInstanceResumeNodeServer, type WorkflowInstanceSelector, type WorkflowInstanceState, WorkflowInstanceUpdate, WorkflowInstanceUpdateNodeMetadata, WorkflowInstanceUpdated, type WorkflowMetadata, type WorkflowNode, type WorkflowNodeSubTypeTS, type WorkflowNodeTypeOptionTS, type WorkflowNodeTypeTS, WorkflowNodeTypes, type WorkflowPermissions, type WorkflowRule, WorkflowScheduleCreate, WorkflowScheduleDelete, WorkflowScheduleList, WorkflowSchedulePause, WorkflowScheduleResume, WorkflowScheduleUpdate, WorkflowTemplateGet, WorkflowTemplateInstantiate, WorkflowTemplateList, WorkflowTriggerFired, WorkflowTriggerPause, WorkflowTriggerRegister, WorkflowTriggerResume, WorkflowTriggerStatus, type WorkflowType, WorkflowTypeAgent, WorkflowTypeChat, type WorkflowTypeDefinition, WorkflowTypeDocument, WorkflowTypeEntity, type WorkflowTypeOptionTS, WorkflowTypeProductivity, type WorkflowTypeTS, WorkflowTypes, type WorkflowVariable, type WorkflowVariables, nodeDefinitions, nodeSchemas, useWorkflowDefinition, useWorkflowDefinitionContext, useWorkflowInstance, useWorkflowInstanceContext, workflowDefinitionReducer, workflowInstanceReducer };
|