@solidxai/core 0.1.13-beta.3 → 0.1.13-beta.4
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/commands/seed.command.d.ts +2 -0
- package/dist/commands/seed.command.d.ts.map +1 -1
- package/dist/commands/seed.command.js +21 -0
- package/dist/commands/seed.command.js.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.js +1 -1
- package/dist/entities/workflow-trigger-execution.entity.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +1 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +44 -27
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +80 -67
- package/dist/services/workflow/nodes/execution-fail.node.d.ts +6 -0
- package/dist/services/workflow/nodes/execution-fail.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/execution-fail.node.js +81 -0
- package/dist/services/workflow/nodes/execution-fail.node.js.map +1 -0
- package/dist/services/workflow/nodes/for-each.node.d.ts +2 -0
- package/dist/services/workflow/nodes/for-each.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/for-each.node.js +114 -5
- package/dist/services/workflow/nodes/for-each.node.js.map +1 -1
- package/dist/services/workflow/nodes/if.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/if.node.js +7 -0
- package/dist/services/workflow/nodes/if.node.js.map +1 -1
- package/dist/services/workflow/nodes/log-write.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/log-write.node.js +2 -0
- package/dist/services/workflow/nodes/log-write.node.js.map +1 -1
- package/dist/services/workflow/nodes/loop-until.node.d.ts +12 -0
- package/dist/services/workflow/nodes/loop-until.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/loop-until.node.js +281 -0
- package/dist/services/workflow/nodes/loop-until.node.js.map +1 -0
- package/dist/services/workflow/nodes/parallel.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/parallel.node.js +7 -0
- package/dist/services/workflow/nodes/parallel.node.js.map +1 -1
- package/dist/services/workflow/nodes/sequential.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/sequential.node.js +7 -0
- package/dist/services/workflow/nodes/sequential.node.js.map +1 -1
- package/dist/services/workflow/nodes/switch.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/switch.node.js +7 -0
- package/dist/services/workflow/nodes/switch.node.js.map +1 -1
- package/dist/services/workflow/workflow-definition-validator.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-definition-validator.service.js +5 -2
- package/dist/services/workflow/workflow-definition-validator.service.js.map +1 -1
- package/dist/services/workflow/workflow-expression.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-expression.service.js +5 -0
- package/dist/services/workflow/workflow-expression.service.js.map +1 -1
- package/dist/services/workflow/workflow-node-registry.service.d.ts +2 -1
- package/dist/services/workflow/workflow-node-registry.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-node-registry.service.js +7 -0
- package/dist/services/workflow/workflow-node-registry.service.js.map +1 -1
- package/dist/services/workflow/workflow-runtime.service.d.ts +8 -0
- package/dist/services/workflow/workflow-runtime.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-runtime.service.js +197 -32
- package/dist/services/workflow/workflow-runtime.service.js.map +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +4 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/types/workflow-dsl.types.d.ts +14 -0
- package/dist/types/workflow-dsl.types.d.ts.map +1 -1
- package/dist/types/workflow-dsl.types.js.map +1 -1
- package/dist-tests/api/authenticate.spec.js +119 -0
- package/dist-tests/api/authenticate.spec.js.map +1 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
- package/dist-tests/api/ping.spec.js +21 -0
- package/dist-tests/api/ping.spec.js.map +1 -0
- package/dist-tests/helpers/auth.js +41 -0
- package/dist-tests/helpers/auth.js.map +1 -0
- package/dist-tests/helpers/env.js +11 -0
- package/dist-tests/helpers/env.js.map +1 -0
- package/docs/agent-builder/notebook-lm-prompt-for-agent-builder.md +136 -0
- package/docs/agent-builder/team-ready-note-agent-builder.md +305 -0
- package/docs/agent-hub-grooming.md +301 -0
- package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +438 -0
- package/docs/dashboards/dashboard-curl-smoke-tests.txt +146 -0
- package/docs/dashboards/delete-legacy-dashboard-metadata.sql +172 -0
- package/docs/datasource-introspection-ddl-analysis.md +326 -0
- package/docs/datasource-introspection-implementation-plan.md +306 -0
- package/docs/grouping-enhancements.md +89 -0
- package/docs/java-spring/README.md +3 -0
- package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
- package/docs/module-package-import-handoff.md +691 -0
- package/docs/seed-changes.md +65 -0
- package/docs/test-data-workflow.md +200 -0
- package/docs/type-declaration-import-issue.md +24 -0
- package/docs/workflow/business-automation-example-notes.md +309 -0
- package/docs/workflow/control-flow-node-addition-sop.md +324 -0
- package/docs/workflow/data-engineering-pipeline-example-notes.md +330 -0
- package/docs/workflow/foreach-example-notes.md +187 -0
- package/docs/workflow/hello-world-example-notes.md +271 -0
- package/docs/workflow/kestra-concepts-plugins-blueprints.md +315 -0
- package/docs/workflow/loop-until-example-notes.md +198 -0
- package/docs/workflow/microservices-and-apis-example-notes.md +264 -0
- package/docs/workflow/samples.md +25 -0
- package/docs/workflow/what-is-kestra.md +79 -0
- package/docs/workflow/workflow-core-module-handoff-summary.md +191 -0
- package/docs/workflow/workflow-module-brd.md +185 -0
- package/docs/workflow/workflow-module-domain-model.md +252 -0
- package/docs/workflow/workflow-module-metadata-dsl.md +302 -0
- package/docs/workflow/workflow-module-technical-spec.md +293 -0
- package/docs/workflow/workflow-node-type-contracts.md +635 -0
- package/docs/workflow/workflow-node-ui-metadata-contract.md +1262 -0
- package/docs/workflow/workflow-solidx-model-field-spec.md +284 -0
- package/package.json +1 -1
- package/src/commands/seed.command.ts +19 -0
- package/src/entities/workflow-trigger-execution.entity.ts +1 -1
- package/src/index.ts +2 -0
- package/src/interfaces.ts +1 -0
- package/src/seeders/module-metadata-seeder.service.ts +50 -36
- package/src/seeders/seed-data/solid-core-metadata.json +80 -67
- package/src/services/workflow/nodes/execution-fail.node.ts +82 -0
- package/src/services/workflow/nodes/for-each.node.ts +140 -6
- package/src/services/workflow/nodes/if.node.ts +7 -0
- package/src/services/workflow/nodes/log-write.node.ts +2 -0
- package/src/services/workflow/nodes/loop-until.node.ts +343 -0
- package/src/services/workflow/nodes/parallel.node.ts +7 -0
- package/src/services/workflow/nodes/sequential.node.ts +7 -0
- package/src/services/workflow/nodes/switch.node.ts +7 -0
- package/src/services/workflow/workflow-definition-validator.service.ts +5 -2
- package/src/services/workflow/workflow-expression.service.ts +5 -0
- package/src/services/workflow/workflow-node-registry.service.ts +11 -0
- package/src/services/workflow/workflow-runtime.service.ts +274 -39
- package/src/solid-core.module.ts +4 -0
- package/src/types/workflow-dsl.types.ts +43 -0
- package/.claude/settings.local.json +0 -16
- package/CLAUDE.md +0 -26
- package/src/services/1.js +0 -6
|
@@ -8681,16 +8681,42 @@
|
|
|
8681
8681
|
{
|
|
8682
8682
|
"displayName": "Workflow Definitions",
|
|
8683
8683
|
"name": "workflowDefinition-list-action",
|
|
8684
|
-
"type": "
|
|
8684
|
+
"type": "solid",
|
|
8685
8685
|
"domain": "",
|
|
8686
8686
|
"context": "",
|
|
8687
|
-
"customComponent": "
|
|
8687
|
+
"customComponent": "",
|
|
8688
8688
|
"customIsModal": true,
|
|
8689
8689
|
"serverEndpoint": "",
|
|
8690
8690
|
"viewUserKey": "workflowDefinition-list-view",
|
|
8691
8691
|
"moduleUserKey": "solid-core",
|
|
8692
8692
|
"modelUserKey": "workflowDefinition"
|
|
8693
8693
|
},
|
|
8694
|
+
{
|
|
8695
|
+
"displayName": "New Workflow Definition",
|
|
8696
|
+
"name": "workflowDefinition-create-action",
|
|
8697
|
+
"type": "custom",
|
|
8698
|
+
"domain": "",
|
|
8699
|
+
"context": "{}",
|
|
8700
|
+
"customComponent": "/admin/core/solid-core/workflow-definition/editor/new",
|
|
8701
|
+
"customIsModal": false,
|
|
8702
|
+
"serverEndpoint": "",
|
|
8703
|
+
"viewUserKey": "workflowDefinition-list-view",
|
|
8704
|
+
"moduleUserKey": "solid-core",
|
|
8705
|
+
"modelUserKey": "workflowDefinition"
|
|
8706
|
+
},
|
|
8707
|
+
{
|
|
8708
|
+
"displayName": "Workflow Definition Editor",
|
|
8709
|
+
"name": "workflowDefinition-editor-action",
|
|
8710
|
+
"type": "custom",
|
|
8711
|
+
"domain": "",
|
|
8712
|
+
"context": "{}",
|
|
8713
|
+
"customComponent": "/admin/core/solid-core/workflow-definition/editor",
|
|
8714
|
+
"customIsModal": false,
|
|
8715
|
+
"serverEndpoint": "",
|
|
8716
|
+
"viewUserKey": "workflowDefinition-list-view",
|
|
8717
|
+
"moduleUserKey": "solid-core",
|
|
8718
|
+
"modelUserKey": "workflowDefinition"
|
|
8719
|
+
},
|
|
8694
8720
|
{
|
|
8695
8721
|
"displayName": "Workflow Execution List Action",
|
|
8696
8722
|
"name": "workflowExecution-list-action",
|
|
@@ -17260,97 +17286,71 @@
|
|
|
17260
17286
|
],
|
|
17261
17287
|
"enableGlobalSearch": true,
|
|
17262
17288
|
"create": true,
|
|
17289
|
+
"createAction": "workflowDefinition-create-action",
|
|
17263
17290
|
"edit": true,
|
|
17291
|
+
"editAction": "workflowDefinition-editor-action",
|
|
17264
17292
|
"delete": true,
|
|
17265
|
-
"
|
|
17266
|
-
|
|
17267
|
-
"attrs": {
|
|
17268
|
-
"label": "Open Workflow Editor",
|
|
17269
|
-
"action": "openWorkflowDefinitionEditorHeaderAction",
|
|
17270
|
-
"actionInContextMenu": false,
|
|
17271
|
-
"openInPopup": false,
|
|
17272
|
-
"icon": "si-sparkles"
|
|
17273
|
-
}
|
|
17274
|
-
}
|
|
17275
|
-
],
|
|
17276
|
-
"rowButtons": [
|
|
17277
|
-
{
|
|
17278
|
-
"attrs": {
|
|
17279
|
-
"className": "p-button-text",
|
|
17280
|
-
"icon": "si-pencil",
|
|
17281
|
-
"label": "Open Editor",
|
|
17282
|
-
"action": "openWorkflowDefinitionEditorRowAction",
|
|
17283
|
-
"openInPopup": false,
|
|
17284
|
-
"actionInContextMenu": true
|
|
17285
|
-
}
|
|
17286
|
-
}
|
|
17287
|
-
]
|
|
17293
|
+
"showRowActionsAsIconOnly": true,
|
|
17294
|
+
"showRowActionsInContextMenu": false
|
|
17288
17295
|
},
|
|
17289
17296
|
"children": [
|
|
17290
17297
|
{
|
|
17291
17298
|
"type": "field",
|
|
17292
17299
|
"attrs": {
|
|
17293
|
-
"name": "
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
"attrs": {
|
|
17299
|
-
"name": "key"
|
|
17300
|
-
}
|
|
17301
|
-
},
|
|
17302
|
-
{
|
|
17303
|
-
"type": "field",
|
|
17304
|
-
"attrs": {
|
|
17305
|
-
"name": "moduleMetadata"
|
|
17306
|
-
}
|
|
17307
|
-
},
|
|
17308
|
-
{
|
|
17309
|
-
"type": "field",
|
|
17310
|
-
"attrs": {
|
|
17311
|
-
"name": "displayName"
|
|
17312
|
-
}
|
|
17313
|
-
},
|
|
17314
|
-
{
|
|
17315
|
-
"type": "field",
|
|
17316
|
-
"attrs": {
|
|
17317
|
-
"name": "namespace"
|
|
17318
|
-
}
|
|
17319
|
-
},
|
|
17320
|
-
{
|
|
17321
|
-
"type": "field",
|
|
17322
|
-
"attrs": {
|
|
17323
|
-
"name": "description"
|
|
17300
|
+
"name": "key",
|
|
17301
|
+
"className": "font-bold",
|
|
17302
|
+
"sortable": true,
|
|
17303
|
+
"isSearchable": true,
|
|
17304
|
+
"truncateAfter": 28
|
|
17324
17305
|
}
|
|
17325
17306
|
},
|
|
17326
17307
|
{
|
|
17327
17308
|
"type": "field",
|
|
17328
17309
|
"attrs": {
|
|
17329
|
-
"name": "
|
|
17310
|
+
"name": "displayName",
|
|
17311
|
+
"className": "font-bold",
|
|
17312
|
+
"sortable": true,
|
|
17313
|
+
"isSearchable": true,
|
|
17314
|
+
"truncateAfter": 32
|
|
17330
17315
|
}
|
|
17331
17316
|
},
|
|
17332
17317
|
{
|
|
17333
17318
|
"type": "field",
|
|
17334
17319
|
"attrs": {
|
|
17335
|
-
"name": "
|
|
17320
|
+
"name": "namespace",
|
|
17321
|
+
"sortable": true,
|
|
17322
|
+
"isSearchable": true,
|
|
17323
|
+
"truncateAfter": 28
|
|
17336
17324
|
}
|
|
17337
17325
|
},
|
|
17338
17326
|
{
|
|
17339
17327
|
"type": "field",
|
|
17340
17328
|
"attrs": {
|
|
17341
|
-
"name": "
|
|
17329
|
+
"name": "description",
|
|
17330
|
+
"isSearchable": true,
|
|
17331
|
+
"truncateAfter": 56
|
|
17342
17332
|
}
|
|
17343
17333
|
},
|
|
17344
17334
|
{
|
|
17345
17335
|
"type": "field",
|
|
17346
17336
|
"attrs": {
|
|
17347
|
-
"name": "
|
|
17337
|
+
"name": "status",
|
|
17338
|
+
"sortable": true,
|
|
17339
|
+
"viewWidget": "PillWidget",
|
|
17340
|
+
"pillColorMap": {
|
|
17341
|
+
"draft": "#e5e7eb",
|
|
17342
|
+
"active": "#dcfce7",
|
|
17343
|
+
"inactive": "#fef3c7",
|
|
17344
|
+
"archived": "#ede9fe",
|
|
17345
|
+
"default": "#e5e7eb"
|
|
17346
|
+
}
|
|
17348
17347
|
}
|
|
17349
17348
|
},
|
|
17350
17349
|
{
|
|
17351
17350
|
"type": "field",
|
|
17352
17351
|
"attrs": {
|
|
17353
|
-
"name": "
|
|
17352
|
+
"name": "definitionVersion",
|
|
17353
|
+
"sortable": true
|
|
17354
17354
|
}
|
|
17355
17355
|
}
|
|
17356
17356
|
]
|
|
@@ -17518,7 +17518,7 @@
|
|
|
17518
17518
|
50
|
|
17519
17519
|
],
|
|
17520
17520
|
"enableGlobalSearch": true,
|
|
17521
|
-
"create":
|
|
17521
|
+
"create": false,
|
|
17522
17522
|
"edit": true,
|
|
17523
17523
|
"editAction": "workflowExecution-detail-action",
|
|
17524
17524
|
"delete": true,
|
|
@@ -17539,8 +17539,10 @@
|
|
|
17539
17539
|
"type": "field",
|
|
17540
17540
|
"attrs": {
|
|
17541
17541
|
"name": "executionIdentifier",
|
|
17542
|
+
"className": "font-bold",
|
|
17542
17543
|
"sortable": true,
|
|
17543
|
-
"isSearchable": true
|
|
17544
|
+
"isSearchable": true,
|
|
17545
|
+
"truncateAfter": 28
|
|
17544
17546
|
}
|
|
17545
17547
|
},
|
|
17546
17548
|
{
|
|
@@ -17549,7 +17551,8 @@
|
|
|
17549
17551
|
"name": "workflowDefinition",
|
|
17550
17552
|
"sortable": true,
|
|
17551
17553
|
"isSearchable": true,
|
|
17552
|
-
"searchField": "workflowDefinition.displayName"
|
|
17554
|
+
"searchField": "workflowDefinition.displayName",
|
|
17555
|
+
"truncateAfter": 30
|
|
17553
17556
|
}
|
|
17554
17557
|
},
|
|
17555
17558
|
{
|
|
@@ -17558,7 +17561,8 @@
|
|
|
17558
17561
|
"name": "workflowDisplayName",
|
|
17559
17562
|
"className": "font-bold",
|
|
17560
17563
|
"sortable": true,
|
|
17561
|
-
"isSearchable": true
|
|
17564
|
+
"isSearchable": true,
|
|
17565
|
+
"truncateAfter": 32
|
|
17562
17566
|
}
|
|
17563
17567
|
},
|
|
17564
17568
|
{
|
|
@@ -17583,7 +17587,15 @@
|
|
|
17583
17587
|
"attrs": {
|
|
17584
17588
|
"name": "triggerType",
|
|
17585
17589
|
"sortable": true,
|
|
17586
|
-
"isSearchable": true
|
|
17590
|
+
"isSearchable": true,
|
|
17591
|
+
"viewWidget": "PillWidget",
|
|
17592
|
+
"pillColorMap": {
|
|
17593
|
+
"manual": "#ede9fe",
|
|
17594
|
+
"schedule": "#e0f2fe",
|
|
17595
|
+
"webhook": "#ccfbf1",
|
|
17596
|
+
"api": "#dbeafe",
|
|
17597
|
+
"default": "#e5e7eb"
|
|
17598
|
+
}
|
|
17587
17599
|
}
|
|
17588
17600
|
},
|
|
17589
17601
|
{
|
|
@@ -17611,7 +17623,8 @@
|
|
|
17611
17623
|
"type": "field",
|
|
17612
17624
|
"attrs": {
|
|
17613
17625
|
"name": "errorSummary",
|
|
17614
|
-
"isSearchable": true
|
|
17626
|
+
"isSearchable": true,
|
|
17627
|
+
"truncateAfter": 56
|
|
17615
17628
|
}
|
|
17616
17629
|
}
|
|
17617
17630
|
]
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';
|
|
2
|
+
import { WorkflowNodeExecutionContext, WorkflowNodeHandlerResult } from '../../../types/workflow-dsl.types';
|
|
3
|
+
export declare class ExecutionFailNode implements WorkflowNodeHandler {
|
|
4
|
+
execute(context: WorkflowNodeExecutionContext): Promise<WorkflowNodeHandlerResult>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=execution-fail.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-fail.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/execution-fail.node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,qBA6Da,iBAAkB,YAAW,mBAAmB;IACrD,OAAO,CACX,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC;CAStC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ExecutionFailNode = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const workflow_node_provider_decorator_1 = require("../../../decorators/workflow-node-provider.decorator");
|
|
12
|
+
let ExecutionFailNode = class ExecutionFailNode {
|
|
13
|
+
async execute(context) {
|
|
14
|
+
const configuration = context.expression.interpolate(context.node.configuration ?? {}, context);
|
|
15
|
+
throw new common_1.BadRequestException(configuration.message ?? 'Execution failed intentionally.');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.ExecutionFailNode = ExecutionFailNode;
|
|
19
|
+
exports.ExecutionFailNode = ExecutionFailNode = __decorate([
|
|
20
|
+
(0, workflow_node_provider_decorator_1.WorkflowNodeProvider)({
|
|
21
|
+
type: 'execution.fail',
|
|
22
|
+
kind: 'task',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
category: 'core',
|
|
25
|
+
subcategory: 'execution',
|
|
26
|
+
label: 'Fail Execution',
|
|
27
|
+
description: 'Fails intentionally with a configured message.',
|
|
28
|
+
tags: ['failure', 'error', 'testing'],
|
|
29
|
+
aliases: ['fail'],
|
|
30
|
+
configSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
message: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: 'Execution failed intentionally.',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
authoring: {
|
|
40
|
+
defaultConfiguration: {
|
|
41
|
+
message: 'Execution failed intentionally.',
|
|
42
|
+
},
|
|
43
|
+
configurationFields: [
|
|
44
|
+
{
|
|
45
|
+
key: 'message',
|
|
46
|
+
label: 'Message',
|
|
47
|
+
description: 'Failure message. Expressions are allowed.',
|
|
48
|
+
valueType: 'string',
|
|
49
|
+
expressionAllowed: true,
|
|
50
|
+
group: 'General',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
supportsExpressions: true,
|
|
54
|
+
supportsDisableToggle: true,
|
|
55
|
+
supportsName: true,
|
|
56
|
+
supportsDescription: true,
|
|
57
|
+
searchableText: ['fail', 'failure', 'error', 'testing'],
|
|
58
|
+
},
|
|
59
|
+
runtime: {
|
|
60
|
+
emitsLogs: false,
|
|
61
|
+
emitsArtifacts: false,
|
|
62
|
+
deterministicOutputs: true,
|
|
63
|
+
executionMode: 'task',
|
|
64
|
+
successStatuses: [],
|
|
65
|
+
},
|
|
66
|
+
documentation: {
|
|
67
|
+
summary: 'Use this node in reference workflows and tests to intentionally exercise failure paths and error handlers.',
|
|
68
|
+
},
|
|
69
|
+
ui: {
|
|
70
|
+
icon: 'si-x-circle',
|
|
71
|
+
iconColor: '#dc2626',
|
|
72
|
+
iconBackgroundColor: '#fee2e2',
|
|
73
|
+
iconBorderColor: '#fecaca',
|
|
74
|
+
modalSize: 'lg',
|
|
75
|
+
layoutHints: {
|
|
76
|
+
groupOrder: ['General'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
})
|
|
80
|
+
], ExecutionFailNode);
|
|
81
|
+
//# sourceMappingURL=execution-fail.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-fail.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/execution-fail.node.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqD;AACrD,2GAA4F;AAoErF,IAAM,iBAAiB,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ACP,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,KAAK;YACrB,oBAAoB,EAAE,IAAI;YAC1B,aAAa,EAAE,MAAM;YACrB,eAAe,EAAE,EAAE;SACpB;QACD,aAAa,EAAE;YACb,OAAO,EACL,4GAA4G;SAC/G;QACD,EAAE,EAAE;YACF,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,SAAS;YACpB,mBAAmB,EAAE,SAAS;YAC9B,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,IAAI;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,CAAC,SAAS,CAAC;aACxB;SACF;KACF,CAAC;GACW,iBAAiB,CAY7B","sourcesContent":["import { BadRequestException } from '@nestjs/common';\nimport { WorkflowNodeProvider } from '../../../decorators/workflow-node-provider.decorator';\nimport { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';\nimport {\n WorkflowNodeExecutionContext,\n WorkflowNodeHandlerResult,\n} from '../../../types/workflow-dsl.types';\n\n@WorkflowNodeProvider({\n type: 'execution.fail',\n kind: 'task',\n version: '1.0.0',\n category: 'core',\n subcategory: 'execution',\n label: 'Fail Execution',\n description: 'Fails intentionally with a configured message.',\n tags: ['failure', 'error', 'testing'],\n aliases: ['fail'],\n configSchema: {\n type: 'object',\n properties: {\n message: {\n type: 'string',\n default: 'Execution failed intentionally.',\n },\n },\n },\n authoring: {\n defaultConfiguration: {\n message: 'Execution failed intentionally.',\n },\n configurationFields: [\n {\n key: 'message',\n label: 'Message',\n description: 'Failure message. Expressions are allowed.',\n valueType: 'string',\n expressionAllowed: true,\n group: 'General',\n },\n ],\n supportsExpressions: true,\n supportsDisableToggle: true,\n supportsName: true,\n supportsDescription: true,\n searchableText: ['fail', 'failure', 'error', 'testing'],\n },\n runtime: {\n emitsLogs: false,\n emitsArtifacts: false,\n deterministicOutputs: true,\n executionMode: 'task',\n successStatuses: [],\n },\n documentation: {\n summary:\n 'Use this node in reference workflows and tests to intentionally exercise failure paths and error handlers.',\n },\n ui: {\n icon: 'si-x-circle',\n iconColor: '#dc2626',\n iconBackgroundColor: '#fee2e2',\n iconBorderColor: '#fecaca',\n modalSize: 'lg',\n layoutHints: {\n groupOrder: ['General'],\n },\n },\n})\nexport class ExecutionFailNode implements WorkflowNodeHandler {\n async execute(\n context: WorkflowNodeExecutionContext,\n ): Promise<WorkflowNodeHandlerResult> {\n const configuration = context.expression.interpolate(\n context.node.configuration ?? {},\n context,\n );\n throw new BadRequestException(\n configuration.message ?? 'Execution failed intentionally.',\n );\n }\n}\n"]}
|
|
@@ -2,5 +2,7 @@ import { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.i
|
|
|
2
2
|
import { WorkflowNodeExecutionContext, WorkflowNodeHandlerResult } from '../../../types/workflow-dsl.types';
|
|
3
3
|
export declare class ForEachNode implements WorkflowNodeHandler {
|
|
4
4
|
execute(context: WorkflowNodeExecutionContext): Promise<WorkflowNodeHandlerResult>;
|
|
5
|
+
private resolveConcurrencyLimit;
|
|
6
|
+
private runIterations;
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=for-each.node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"for-each.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/for-each.node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"for-each.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/for-each.node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,qBA4Fa,WAAY,YAAW,mBAAmB;IAC/C,OAAO,CACX,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAwFrC,OAAO,CAAC,uBAAuB;YAWjB,aAAa;CA4B5B"}
|
|
@@ -13,27 +13,101 @@ let ForEachNode = class ForEachNode {
|
|
|
13
13
|
async execute(context) {
|
|
14
14
|
const configuration = context.node.configuration ?? {};
|
|
15
15
|
const items = context.expression.interpolate(configuration.items ?? [], context);
|
|
16
|
+
const concurrencyLimit = this.resolveConcurrencyLimit(context.expression.interpolate(configuration.concurrencyLimit ?? 1, context));
|
|
17
|
+
const aggregateOutputs = Boolean(context.expression.interpolate(configuration.aggregateOutputs ?? false, context));
|
|
16
18
|
if (!Array.isArray(items)) {
|
|
17
19
|
throw new common_1.BadRequestException('forEach requires configuration.items array.');
|
|
18
20
|
}
|
|
19
21
|
const childNodes = context.node.tasks ?? [];
|
|
20
|
-
|
|
22
|
+
const iterationsByIndex = {};
|
|
23
|
+
const iterationsByKey = {};
|
|
24
|
+
const shouldAggregateByKey = aggregateOutputs && configuration.outputKey !== undefined && configuration.outputKey !== null;
|
|
25
|
+
await this.runIterations(items, concurrencyLimit, async (item, index) => {
|
|
21
26
|
const inheritedOutputs = context.outputs ?? {};
|
|
22
27
|
const iterationOutputs = { ...inheritedOutputs };
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
const parentLoops = context.loops ?? [];
|
|
29
|
+
const currentLoop = {
|
|
30
|
+
item,
|
|
25
31
|
index,
|
|
32
|
+
nodeId: context.node.id,
|
|
33
|
+
stepExecutionKey: context.stepExecution.stepExecutionKey,
|
|
34
|
+
};
|
|
35
|
+
const loopContext = {
|
|
36
|
+
item,
|
|
37
|
+
index,
|
|
38
|
+
parent: parentLoops[parentLoops.length - 1],
|
|
39
|
+
parents: [...parentLoops].reverse(),
|
|
40
|
+
loops: [...parentLoops, currentLoop],
|
|
41
|
+
};
|
|
42
|
+
const outputKey = shouldAggregateByKey
|
|
43
|
+
? String(context.expression.interpolate(configuration.outputKey, {
|
|
44
|
+
...context,
|
|
45
|
+
...loopContext,
|
|
46
|
+
outputs: iterationOutputs,
|
|
47
|
+
}))
|
|
48
|
+
: undefined;
|
|
49
|
+
const childOutputs = await context.runNodes(childNodes, {
|
|
50
|
+
...loopContext,
|
|
26
51
|
outputs: iterationOutputs,
|
|
27
52
|
});
|
|
28
|
-
|
|
53
|
+
if (aggregateOutputs) {
|
|
54
|
+
const iterationResult = {
|
|
55
|
+
item,
|
|
56
|
+
index,
|
|
57
|
+
outputs: childOutputs,
|
|
58
|
+
};
|
|
59
|
+
iterationsByIndex[index] = iterationResult;
|
|
60
|
+
if (outputKey !== undefined) {
|
|
61
|
+
iterationsByKey[outputKey] = iterationResult;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
29
65
|
return {
|
|
30
66
|
output: {
|
|
31
67
|
count: items.length,
|
|
32
68
|
childNodeIds: childNodes.map((childNode) => childNode.id),
|
|
33
|
-
|
|
69
|
+
concurrencyLimit,
|
|
70
|
+
iterationOutputsStoredOnSteps: !aggregateOutputs,
|
|
71
|
+
...(aggregateOutputs
|
|
72
|
+
? {
|
|
73
|
+
iterations: {
|
|
74
|
+
byIndex: iterationsByIndex,
|
|
75
|
+
...(shouldAggregateByKey
|
|
76
|
+
? {
|
|
77
|
+
byKey: iterationsByKey,
|
|
78
|
+
}
|
|
79
|
+
: {}),
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
: {}),
|
|
34
83
|
},
|
|
35
84
|
};
|
|
36
85
|
}
|
|
86
|
+
resolveConcurrencyLimit(value) {
|
|
87
|
+
const parsed = Number(value === '' || value === null || value === undefined ? 1 : value);
|
|
88
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
89
|
+
throw new common_1.BadRequestException('forEach configuration.concurrencyLimit must be 0 or a positive number.');
|
|
90
|
+
}
|
|
91
|
+
return Math.floor(parsed);
|
|
92
|
+
}
|
|
93
|
+
async runIterations(items, concurrencyLimit, handler) {
|
|
94
|
+
if (concurrencyLimit === 1 || items.length <= 1) {
|
|
95
|
+
for (let index = 0; index < items.length; index++) {
|
|
96
|
+
await handler(items[index], index);
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const limit = concurrencyLimit === 0 ? items.length : concurrencyLimit;
|
|
101
|
+
let nextIndex = 0;
|
|
102
|
+
const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
|
|
103
|
+
while (nextIndex < items.length) {
|
|
104
|
+
const index = nextIndex;
|
|
105
|
+
nextIndex += 1;
|
|
106
|
+
await handler(items[index], index);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
await Promise.all(workers);
|
|
110
|
+
}
|
|
37
111
|
};
|
|
38
112
|
exports.ForEachNode = ForEachNode;
|
|
39
113
|
exports.ForEachNode = ForEachNode = __decorate([
|
|
@@ -47,6 +121,8 @@ exports.ForEachNode = ForEachNode = __decorate([
|
|
|
47
121
|
authoring: {
|
|
48
122
|
defaultConfiguration: {
|
|
49
123
|
items: '',
|
|
124
|
+
concurrencyLimit: 1,
|
|
125
|
+
aggregateOutputs: false,
|
|
50
126
|
},
|
|
51
127
|
configurationFields: [
|
|
52
128
|
{
|
|
@@ -63,6 +139,32 @@ exports.ForEachNode = ForEachNode = __decorate([
|
|
|
63
139
|
},
|
|
64
140
|
},
|
|
65
141
|
},
|
|
142
|
+
{
|
|
143
|
+
key: 'concurrencyLimit',
|
|
144
|
+
label: 'Concurrency Limit',
|
|
145
|
+
description: 'Maximum number of loop iterations to run at once. Use 1 for sequential execution and 0 for unlimited concurrency.',
|
|
146
|
+
valueType: 'number',
|
|
147
|
+
defaultValue: 1,
|
|
148
|
+
expressionAllowed: true,
|
|
149
|
+
group: 'General',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: 'aggregateOutputs',
|
|
153
|
+
label: 'Aggregate Outputs',
|
|
154
|
+
description: 'Adds per-iteration child outputs to this forEach node output for downstream expressions.',
|
|
155
|
+
valueType: 'boolean',
|
|
156
|
+
defaultValue: false,
|
|
157
|
+
expressionAllowed: true,
|
|
158
|
+
group: 'General',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
key: 'outputKey',
|
|
162
|
+
label: 'Output Key',
|
|
163
|
+
description: 'Optional expression used as the per-iteration key when aggregate outputs is enabled.',
|
|
164
|
+
valueType: 'string',
|
|
165
|
+
expressionAllowed: true,
|
|
166
|
+
group: 'General',
|
|
167
|
+
},
|
|
66
168
|
],
|
|
67
169
|
childSlots: [
|
|
68
170
|
{
|
|
@@ -73,6 +175,13 @@ exports.ForEachNode = ForEachNode = __decorate([
|
|
|
73
175
|
layout: 'sequential',
|
|
74
176
|
required: true,
|
|
75
177
|
},
|
|
178
|
+
{
|
|
179
|
+
key: 'errors',
|
|
180
|
+
label: 'Errors',
|
|
181
|
+
description: 'Nodes that run sequentially if this loop fails.',
|
|
182
|
+
kind: 'sequence',
|
|
183
|
+
layout: 'sequential',
|
|
184
|
+
},
|
|
76
185
|
],
|
|
77
186
|
supportsDescription: true,
|
|
78
187
|
supportsName: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"for-each.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/for-each.node.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqD;AACrD,2GAA4F;AA6DrF,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,KAAK,CAAC,OAAO,CACX,OAAqC;QAErC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAEjF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,4BAAmB,CAAC,6CAA6C,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,KAA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UAAU,EAAE;gBACV;oBACE,GAAG,EAAE,OAAO;oBACZ,KAAK,EAAE,WAAW;oBAClB,WAAW,EAAE,oCAAoC;oBACjD,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,YAAY;oBACpB,QAAQ,EAAE,IAAI;iBACf;aACF;YACD,mBAAmB,EAAE,IAAI;YACzB,YAAY,EAAE,IAAI;SACnB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,mEAAmE;SAC7E;QACD,EAAE,EAAE;YACF,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,SAAS;YACpB,mBAAmB,EAAE,SAAS;YAC9B,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,IAAI;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,CAAC,SAAS,CAAC;aACxB;SACF;KACF,CAAC;GACW,WAAW,CAkCvB","sourcesContent":["import { BadRequestException } from '@nestjs/common';\nimport { WorkflowNodeProvider } from '../../../decorators/workflow-node-provider.decorator';\nimport { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';\nimport {\n WorkflowNodeExecutionContext,\n WorkflowNodeHandlerResult,\n} from '../../../types/workflow-dsl.types';\n\n@WorkflowNodeProvider({\n type: 'forEach',\n kind: 'control',\n category: 'control-flow',\n label: 'For Each',\n description: 'Runs child nodes once for every item in an array.',\n tags: ['loop', 'iteration'],\n authoring: {\n defaultConfiguration: {\n items: '',\n },\n configurationFields: [\n {\n key: 'items',\n label: 'Items',\n description: 'Array or expression resolving to an array to iterate over.',\n valueType: 'string',\n required: true,\n expressionAllowed: true,\n group: 'General',\n uiSchema: {\n layout: {\n width: 'full',\n },\n },\n },\n ],\n childSlots: [\n {\n key: 'tasks',\n label: 'Loop Body',\n description: 'Nodes that run once for each item.',\n kind: 'sequence',\n layout: 'sequential',\n required: true,\n },\n ],\n supportsDescription: true,\n supportsName: true,\n },\n documentation: {\n summary: 'Iterates over an array and runs the loop body once for each item.',\n },\n ui: {\n icon: 'si-refresh',\n iconColor: '#7c3aed',\n iconBackgroundColor: '#f3e8ff',\n iconBorderColor: '#d8b4fe',\n modalSize: 'lg',\n layoutHints: {\n groupOrder: ['General'],\n },\n },\n})\nexport class ForEachNode implements WorkflowNodeHandler {\n async execute(\n context: WorkflowNodeExecutionContext,\n ): Promise<WorkflowNodeHandlerResult> {\n const configuration = context.node.configuration ?? {};\n const items = context.expression.interpolate(configuration.items ?? [], context);\n\n if (!Array.isArray(items)) {\n throw new BadRequestException('forEach requires configuration.items array.');\n }\n\n const childNodes = context.node.tasks ?? [];\n\n for (let index = 0; index < items.length; index++) {\n const inheritedOutputs = context.outputs ?? {};\n const iterationOutputs = { ...inheritedOutputs };\n\n await context.runNodes(childNodes, {\n item: items[index],\n index,\n outputs: iterationOutputs,\n });\n }\n\n return {\n output: {\n count: items.length,\n childNodeIds: childNodes.map((childNode) => childNode.id),\n // Keep the control-node output intentionally small. Per-iteration\n // outputs are already stored on the child workflowStepExecution rows.\n iterationOutputsStoredOnSteps: true,\n },\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"for-each.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/for-each.node.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAqD;AACrD,2GAA4F;AAmGrF,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,KAAK,CAAC,OAAO,CACX,OAAqC;QAErC,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QACjF,MAAM,gBAAgB,GAAG,IAAI,CAAC,uBAAuB,CACnD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,IAAI,CAAC,EAAE,OAAO,CAAC,CAC7E,CAAC;QACF,MAAM,gBAAgB,GAAG,OAAO,CAC9B,OAAO,CAAC,UAAU,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;aACF;YACD,UAAU,EAAE;gBACV;oBACE,GAAG,EAAE,OAAO;oBACZ,KAAK,EAAE,WAAW;oBAClB,WAAW,EAAE,oCAAoC;oBACjD,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,YAAY;oBACpB,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,GAAG,EAAE,QAAQ;oBACb,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,iDAAiD;oBAC9D,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,YAAY;iBACrB;aACF;YACD,mBAAmB,EAAE,IAAI;YACzB,YAAY,EAAE,IAAI;SACnB;QACD,aAAa,EAAE;YACb,OAAO,EAAE,mEAAmE;SAC7E;QACD,EAAE,EAAE;YACF,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,SAAS;YACpB,mBAAmB,EAAE,SAAS;YAC9B,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,IAAI;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,CAAC,SAAS,CAAC;aACxB;SACF;KACF,CAAC;GACW,WAAW,CAkIvB","sourcesContent":["import { BadRequestException } from '@nestjs/common';\nimport { WorkflowNodeProvider } from '../../../decorators/workflow-node-provider.decorator';\nimport { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';\nimport {\n WorkflowNodeExecutionContext,\n WorkflowNodeHandlerResult,\n} from '../../../types/workflow-dsl.types';\n\n@WorkflowNodeProvider({\n type: 'forEach',\n kind: 'control',\n category: 'control-flow',\n label: 'For Each',\n description: 'Runs child nodes once for every item in an array.',\n tags: ['loop', 'iteration'],\n authoring: {\n defaultConfiguration: {\n items: '',\n concurrencyLimit: 1,\n aggregateOutputs: false,\n },\n configurationFields: [\n {\n key: 'items',\n label: 'Items',\n description: 'Array or expression resolving to an array to iterate over.',\n valueType: 'string',\n required: true,\n expressionAllowed: true,\n group: 'General',\n uiSchema: {\n layout: {\n width: 'full',\n },\n },\n },\n {\n key: 'concurrencyLimit',\n label: 'Concurrency Limit',\n description:\n 'Maximum number of loop iterations to run at once. Use 1 for sequential execution and 0 for unlimited concurrency.',\n valueType: 'number',\n defaultValue: 1,\n expressionAllowed: true,\n group: 'General',\n },\n {\n key: 'aggregateOutputs',\n label: 'Aggregate Outputs',\n description:\n 'Adds per-iteration child outputs to this forEach node output for downstream expressions.',\n valueType: 'boolean',\n defaultValue: false,\n expressionAllowed: true,\n group: 'General',\n },\n {\n key: 'outputKey',\n label: 'Output Key',\n description:\n 'Optional expression used as the per-iteration key when aggregate outputs is enabled.',\n valueType: 'string',\n expressionAllowed: true,\n group: 'General',\n },\n ],\n childSlots: [\n {\n key: 'tasks',\n label: 'Loop Body',\n description: 'Nodes that run once for each item.',\n kind: 'sequence',\n layout: 'sequential',\n required: true,\n },\n {\n key: 'errors',\n label: 'Errors',\n description: 'Nodes that run sequentially if this loop fails.',\n kind: 'sequence',\n layout: 'sequential',\n },\n ],\n supportsDescription: true,\n supportsName: true,\n },\n documentation: {\n summary: 'Iterates over an array and runs the loop body once for each item.',\n },\n ui: {\n icon: 'si-refresh',\n iconColor: '#7c3aed',\n iconBackgroundColor: '#f3e8ff',\n iconBorderColor: '#d8b4fe',\n modalSize: 'lg',\n layoutHints: {\n groupOrder: ['General'],\n },\n },\n})\nexport class ForEachNode implements WorkflowNodeHandler {\n async execute(\n context: WorkflowNodeExecutionContext,\n ): Promise<WorkflowNodeHandlerResult> {\n const configuration = context.node.configuration ?? {};\n const items = context.expression.interpolate(configuration.items ?? [], context);\n const concurrencyLimit = this.resolveConcurrencyLimit(\n context.expression.interpolate(configuration.concurrencyLimit ?? 1, context),\n );\n const aggregateOutputs = Boolean(\n context.expression.interpolate(configuration.aggregateOutputs ?? false, context),\n );\n\n if (!Array.isArray(items)) {\n throw new BadRequestException('forEach requires configuration.items array.');\n }\n\n const childNodes = context.node.tasks ?? [];\n const iterationsByIndex: Record<number, any> = {};\n const iterationsByKey: Record<string, any> = {};\n const shouldAggregateByKey =\n aggregateOutputs && configuration.outputKey !== undefined && configuration.outputKey !== null;\n\n await this.runIterations(items, concurrencyLimit, async (item, index) => {\n const inheritedOutputs = context.outputs ?? {};\n const iterationOutputs = { ...inheritedOutputs };\n const parentLoops = context.loops ?? [];\n const currentLoop = {\n item,\n index,\n nodeId: context.node.id,\n stepExecutionKey: context.stepExecution.stepExecutionKey,\n };\n const loopContext = {\n item,\n index,\n parent: parentLoops[parentLoops.length - 1],\n parents: [...parentLoops].reverse(),\n loops: [...parentLoops, currentLoop],\n };\n const outputKey = shouldAggregateByKey\n ? String(context.expression.interpolate(configuration.outputKey, {\n ...context,\n ...loopContext,\n outputs: iterationOutputs,\n }))\n : undefined;\n\n const childOutputs = await context.runNodes(childNodes, {\n ...loopContext,\n outputs: iterationOutputs,\n });\n\n if (aggregateOutputs) {\n const iterationResult = {\n item,\n index,\n outputs: childOutputs,\n };\n\n iterationsByIndex[index] = iterationResult;\n if (outputKey !== undefined) {\n iterationsByKey[outputKey] = iterationResult;\n }\n }\n });\n\n return {\n output: {\n count: items.length,\n childNodeIds: childNodes.map((childNode) => childNode.id),\n concurrencyLimit,\n // Keep the control-node output intentionally small. Per-iteration\n // outputs are already stored on the child workflowStepExecution rows.\n iterationOutputsStoredOnSteps: !aggregateOutputs,\n ...(aggregateOutputs\n ? {\n iterations: {\n byIndex: iterationsByIndex,\n ...(shouldAggregateByKey\n ? {\n byKey: iterationsByKey,\n }\n : {}),\n },\n }\n : {}),\n },\n };\n }\n\n private resolveConcurrencyLimit(value: any): number {\n const parsed = Number(value === '' || value === null || value === undefined ? 1 : value);\n if (!Number.isFinite(parsed) || parsed < 0) {\n throw new BadRequestException(\n 'forEach configuration.concurrencyLimit must be 0 or a positive number.',\n );\n }\n\n return Math.floor(parsed);\n }\n\n private async runIterations<T>(\n items: T[],\n concurrencyLimit: number,\n handler: (item: T, index: number) => Promise<void>,\n ): Promise<void> {\n if (concurrencyLimit === 1 || items.length <= 1) {\n for (let index = 0; index < items.length; index++) {\n await handler(items[index], index);\n }\n return;\n }\n\n const limit = concurrencyLimit === 0 ? items.length : concurrencyLimit;\n let nextIndex = 0;\n\n const workers = Array.from(\n { length: Math.min(limit, items.length) },\n async () => {\n while (nextIndex < items.length) {\n const index = nextIndex;\n nextIndex += 1;\n await handler(items[index], index);\n }\n },\n );\n\n await Promise.all(workers);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"if.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/if.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"if.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/if.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,qBA+Da,MAAO,YAAW,mBAAmB;IAC1C,OAAO,CACX,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC;CA0BtC"}
|
|
@@ -71,6 +71,13 @@ exports.IfNode = IfNode = __decorate([
|
|
|
71
71
|
description: 'Nodes that run when the condition evaluates to false.',
|
|
72
72
|
kind: 'sequence',
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
key: 'errors',
|
|
76
|
+
label: 'Errors',
|
|
77
|
+
description: 'Nodes that run sequentially if the selected branch fails.',
|
|
78
|
+
kind: 'sequence',
|
|
79
|
+
layout: 'sequential',
|
|
80
|
+
},
|
|
74
81
|
],
|
|
75
82
|
supportsDescription: true,
|
|
76
83
|
supportsName: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"if.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/if.node.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2GAA4F;
|
|
1
|
+
{"version":3,"file":"if.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/if.node.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2GAA4F;AAsErF,IAAM,MAAM,GAAZ,MAAM,MAAM;IACjB,KAAK,CAAC,OAAO,CACX,OAAqC;QAErC,MAAM,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS;YACrC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACzE,MAAM,aAAa,GAAG,OAAO;YAC3B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;YACzB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAE5B,MAAM,OAAO,CAAC,OAAO,CAAC;YACpB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,mBAAmB;YAC9B,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,YAAY,OAAO,CAAC,IAAI,CAAC,EAAE,kBAAkB,OAAO,GAAG;YAChE,OAAO,EAAE,EAAE,SAAS,EAAE;SACvB,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAEtC,OAAO;YACL,MAAM,EAAE;gBACN,OAAO;gBACP,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;aAClC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA7BY,wBAAM;iBAAN,MAAM;IA/DlB,IAAA,uDAAoB,EAAC;QACpB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,8DAA8D;QAC3E,IAAI,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;QAChC,SAAS,EAAE;YACT,oBAAoB,EAAE;gBACpB,SAAS,EAAE,qCAAqC;aACjD;YACD,mBAAmB,EAAE;gBACnB;oBACE,GAAG,EAAE,WAAW;oBAChB,KAAK,EAAE,WAAW;oBAClB,WAAW,EAAE,iEAAiE;oBAC9E,SAAS,EAAE,YAAY;oBACvB,QAAQ,EAAE,IAAI;oBACd,iBAAiB,EAAE,IAAI;oBACvB,UAAU,EAAE,UAAU;oBACtB,KAAK,EAAE,SAAS;iBACjB;aACF;YACD,UAAU,EAAE;gBACV;oBACE,GAAG,EAAE,MAAM;oBACX,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,sDAAsD;oBACnE,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,GAAG,EAAE,MAAM;oBACX,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,uDAAuD;oBACpE,IAAI,EAAE,UAAU;iBACjB;gBACD;oBACE,GAAG,EAAE,QAAQ;oBACb,KAAK,EAAE,QAAQ;oBACf,WAAW,EAAE,2DAA2D;oBACxE,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,YAAY;iBACrB;aACF;YACD,mBAAmB,EAAE,IAAI;YACzB,YAAY,EAAE,IAAI;SACnB;QACD,aAAa,EAAE;YACb,OAAO,EACL,6OAA6O;SAChP;QACD,EAAE,EAAE;YACF,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,SAAS;YACpB,mBAAmB,EAAE,SAAS;YAC9B,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,IAAI;YACf,WAAW,EAAE;gBACX,UAAU,EAAE,CAAC,SAAS,CAAC;aACxB;SACF;KACF,CAAC;GACW,MAAM,CA6BlB","sourcesContent":["import { WorkflowNodeProvider } from '../../../decorators/workflow-node-provider.decorator';\nimport { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';\nimport {\n WorkflowNodeExecutionContext,\n WorkflowNodeHandlerResult,\n} from '../../../types/workflow-dsl.types';\n\n@WorkflowNodeProvider({\n type: 'if',\n kind: 'control',\n category: 'control-flow',\n label: 'If',\n description: 'Runs then or else child nodes based on a boolean expression.',\n tags: ['branching', 'condition'],\n authoring: {\n defaultConfiguration: {\n condition: '{{ input.shouldContinue === true }}',\n },\n configurationFields: [\n {\n key: 'condition',\n label: 'Condition',\n description: 'Boolean expression evaluated by the workflow expression engine.',\n valueType: 'expression',\n required: true,\n expressionAllowed: true,\n widgetHint: 'textarea',\n group: 'General',\n },\n ],\n childSlots: [\n {\n key: 'then',\n label: 'Then',\n description: 'Nodes that run when the condition evaluates to true.',\n kind: 'sequence',\n required: true,\n },\n {\n key: 'else',\n label: 'Else',\n description: 'Nodes that run when the condition evaluates to false.',\n kind: 'sequence',\n },\n {\n key: 'errors',\n label: 'Errors',\n description: 'Nodes that run sequentially if the selected branch fails.',\n kind: 'sequence',\n layout: 'sequential',\n },\n ],\n supportsDescription: true,\n supportsName: true,\n },\n documentation: {\n summary:\n 'Conditionally branches workflow execution into then or else node sequences. The node evaluates a boolean expression and executes either the then or else child sequence. Sequence order inside each branch remains implicit by array order.',\n },\n ui: {\n icon: 'si-code',\n iconColor: '#4f46e5',\n iconBackgroundColor: '#eef2ff',\n iconBorderColor: '#c7d2fe',\n modalSize: 'lg',\n layoutHints: {\n groupOrder: ['General'],\n },\n },\n})\nexport class IfNode implements WorkflowNodeHandler {\n async execute(\n context: WorkflowNodeExecutionContext,\n ): Promise<WorkflowNodeHandlerResult> {\n const condition =\n context.node.configuration?.condition ??\n context.node.configuration?.expression;\n const matched = context.expression.evaluateCondition(condition, context);\n const selectedNodes = matched\n ? context.node.then ?? []\n : context.node.else ?? [];\n\n await context.emitLog({\n level: 'info',\n eventType: 'node.if.evaluated',\n source: 'if',\n message: `If node \"${context.node.id}\" evaluated to ${matched}.`,\n context: { condition },\n });\n\n await context.runNodes(selectedNodes);\n\n return {\n output: {\n matched,\n branch: matched ? 'then' : 'else',\n },\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-write.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/log-write.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"log-write.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/log-write.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,qBAuMa,YAAa,YAAW,mBAAmB;IAChD,OAAO,CACX,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC;CAwBtC"}
|
|
@@ -186,6 +186,7 @@ exports.LogWriteNode = LogWriteNode = __decorate([
|
|
|
186
186
|
description: 'The resolved log level.',
|
|
187
187
|
valueType: 'string',
|
|
188
188
|
path: 'level',
|
|
189
|
+
includeInRuntimeContext: false,
|
|
189
190
|
},
|
|
190
191
|
{
|
|
191
192
|
key: 'message',
|
|
@@ -193,6 +194,7 @@ exports.LogWriteNode = LogWriteNode = __decorate([
|
|
|
193
194
|
description: 'The rendered log message.',
|
|
194
195
|
valueType: 'string',
|
|
195
196
|
path: 'message',
|
|
197
|
+
includeInRuntimeContext: false,
|
|
196
198
|
},
|
|
197
199
|
],
|
|
198
200
|
supportsExpressions: true,
|