@epilot/sdk 2.12.1 → 2.13.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.
Files changed (174) hide show
  1. package/definitions/customer-portal-runtime.json +1 -1
  2. package/definitions/customer-portal.json +164 -16
  3. package/definitions/focus-pocus-runtime.json +1 -0
  4. package/definitions/focus-pocus.json +757 -0
  5. package/definitions/user-runtime.json +1 -1
  6. package/definitions/user.json +146 -0
  7. package/definitions/workflow-definition-runtime.json +1 -1
  8. package/definitions/workflow-definition.json +281 -47
  9. package/definitions/workflow.json +12 -0
  10. package/dist/apis/access-token.cjs +6 -6
  11. package/dist/apis/access-token.js +1 -1
  12. package/dist/apis/address-suggestions.cjs +6 -6
  13. package/dist/apis/address-suggestions.js +1 -1
  14. package/dist/apis/address.cjs +6 -6
  15. package/dist/apis/address.js +1 -1
  16. package/dist/apis/ai-agents.cjs +6 -6
  17. package/dist/apis/ai-agents.js +1 -1
  18. package/dist/apis/app.cjs +6 -6
  19. package/dist/apis/app.js +1 -1
  20. package/dist/apis/audit-logs.cjs +6 -6
  21. package/dist/apis/audit-logs.js +1 -1
  22. package/dist/apis/automation.cjs +6 -6
  23. package/dist/apis/automation.js +1 -1
  24. package/dist/apis/billing.cjs +6 -6
  25. package/dist/apis/billing.js +1 -1
  26. package/dist/apis/blueprint-manifest.cjs +6 -6
  27. package/dist/apis/blueprint-manifest.js +1 -1
  28. package/dist/apis/calendar.cjs +6 -6
  29. package/dist/apis/calendar.js +1 -1
  30. package/dist/apis/configuration-hub.cjs +6 -6
  31. package/dist/apis/configuration-hub.js +1 -1
  32. package/dist/apis/consent.cjs +6 -6
  33. package/dist/apis/consent.js +1 -1
  34. package/dist/apis/customer-portal.cjs +8 -8
  35. package/dist/apis/customer-portal.d.cts +2 -2
  36. package/dist/apis/customer-portal.d.ts +2 -2
  37. package/dist/apis/customer-portal.js +2 -2
  38. package/dist/apis/dashboard.cjs +6 -6
  39. package/dist/apis/dashboard.js +1 -1
  40. package/dist/apis/data-governance.cjs +6 -6
  41. package/dist/apis/data-governance.js +1 -1
  42. package/dist/apis/deduplication.cjs +6 -6
  43. package/dist/apis/deduplication.js +1 -1
  44. package/dist/apis/design.cjs +6 -6
  45. package/dist/apis/design.js +1 -1
  46. package/dist/apis/document.cjs +6 -6
  47. package/dist/apis/document.js +1 -1
  48. package/dist/apis/email-settings.cjs +6 -6
  49. package/dist/apis/email-settings.js +1 -1
  50. package/dist/apis/email-template.cjs +6 -6
  51. package/dist/apis/email-template.js +1 -1
  52. package/dist/apis/entity-mapping.cjs +6 -6
  53. package/dist/apis/entity-mapping.js +1 -1
  54. package/dist/apis/entity.cjs +6 -6
  55. package/dist/apis/entity.js +1 -1
  56. package/dist/apis/environments.cjs +6 -6
  57. package/dist/apis/environments.js +1 -1
  58. package/dist/apis/event-catalog.cjs +6 -6
  59. package/dist/apis/event-catalog.js +1 -1
  60. package/dist/apis/file.cjs +6 -6
  61. package/dist/apis/file.js +1 -1
  62. package/dist/apis/iban.cjs +6 -6
  63. package/dist/apis/iban.js +1 -1
  64. package/dist/apis/integration-toolkit.cjs +6 -6
  65. package/dist/apis/integration-toolkit.js +1 -1
  66. package/dist/apis/journey.cjs +6 -6
  67. package/dist/apis/journey.js +1 -1
  68. package/dist/apis/kanban.cjs +6 -6
  69. package/dist/apis/kanban.js +1 -1
  70. package/dist/apis/message.cjs +6 -6
  71. package/dist/apis/message.js +1 -1
  72. package/dist/apis/metering.cjs +6 -6
  73. package/dist/apis/metering.js +1 -1
  74. package/dist/apis/notes.cjs +6 -6
  75. package/dist/apis/notes.js +1 -1
  76. package/dist/apis/notification.cjs +6 -6
  77. package/dist/apis/notification.js +1 -1
  78. package/dist/apis/organization.cjs +6 -6
  79. package/dist/apis/organization.js +1 -1
  80. package/dist/apis/partner-directory.cjs +6 -6
  81. package/dist/apis/partner-directory.js +1 -1
  82. package/dist/apis/permissions.cjs +6 -6
  83. package/dist/apis/permissions.js +1 -1
  84. package/dist/apis/pricing-tier.cjs +6 -6
  85. package/dist/apis/pricing-tier.js +1 -1
  86. package/dist/apis/pricing.cjs +6 -6
  87. package/dist/apis/pricing.js +1 -1
  88. package/dist/apis/purpose.cjs +6 -6
  89. package/dist/apis/purpose.js +1 -1
  90. package/dist/apis/query.cjs +6 -6
  91. package/dist/apis/query.js +1 -1
  92. package/dist/apis/sandbox.cjs +6 -6
  93. package/dist/apis/sandbox.js +1 -1
  94. package/dist/apis/sharing.cjs +6 -6
  95. package/dist/apis/sharing.js +1 -1
  96. package/dist/apis/snapshot.cjs +6 -6
  97. package/dist/apis/snapshot.js +1 -1
  98. package/dist/apis/submission.cjs +6 -6
  99. package/dist/apis/submission.js +1 -1
  100. package/dist/apis/target.cjs +6 -6
  101. package/dist/apis/target.js +1 -1
  102. package/dist/apis/targeting.cjs +6 -6
  103. package/dist/apis/targeting.js +1 -1
  104. package/dist/apis/template-variables.cjs +6 -6
  105. package/dist/apis/template-variables.js +1 -1
  106. package/dist/apis/user.cjs +8 -8
  107. package/dist/apis/user.d.cts +2 -2
  108. package/dist/apis/user.d.ts +2 -2
  109. package/dist/apis/user.js +2 -2
  110. package/dist/apis/validation-rules.cjs +6 -6
  111. package/dist/apis/validation-rules.js +1 -1
  112. package/dist/apis/webhooks.cjs +6 -6
  113. package/dist/apis/webhooks.js +1 -1
  114. package/dist/apis/workflow-definition.cjs +8 -8
  115. package/dist/apis/workflow-definition.d.cts +2 -2
  116. package/dist/apis/workflow-definition.d.ts +2 -2
  117. package/dist/apis/workflow-definition.js +2 -2
  118. package/dist/apis/workflow.cjs +6 -6
  119. package/dist/apis/workflow.d.cts +2 -2
  120. package/dist/apis/workflow.d.ts +2 -2
  121. package/dist/apis/workflow.js +1 -1
  122. package/dist/chunk-6HJ2Y7DZ.js +14 -0
  123. package/dist/chunk-BFMY2X2J.cjs +14 -0
  124. package/dist/{chunk-AJDY36Y6.cjs → chunk-C35OPQHY.cjs} +7 -7
  125. package/dist/{chunk-NFIYEMMM.js → chunk-N254AABZ.js} +1 -1
  126. package/dist/chunk-OSPTVXY4.js +14 -0
  127. package/dist/chunk-QNSMYDKG.cjs +14 -0
  128. package/dist/{chunk-L3UZLJPQ.js → chunk-SQQJND25.js} +7 -7
  129. package/dist/{chunk-OWXEZ56F.cjs → chunk-X2LMHC5R.cjs} +1 -1
  130. package/dist/customer-portal-6I3G44I4.cjs +7 -0
  131. package/dist/customer-portal-PTVGKDUH.js +7 -0
  132. package/dist/{customer-portal-runtime-VRGCSOVU.cjs → customer-portal-runtime-4ACQGDNY.cjs} +2 -2
  133. package/dist/{customer-portal-runtime-NRIQG6IO.js → customer-portal-runtime-E4RI7NYM.js} +1 -1
  134. package/dist/{customer-portal.d-fWVl8_mE.d.cts → customer-portal.d-Bpc-wk9K.d.cts} +140 -12
  135. package/dist/{customer-portal.d-fWVl8_mE.d.ts → customer-portal.d-Bpc-wk9K.d.ts} +140 -12
  136. package/dist/index.cjs +14 -14
  137. package/dist/index.d.cts +4 -4
  138. package/dist/index.d.ts +4 -4
  139. package/dist/index.js +4 -4
  140. package/dist/js-yaml-DLCVPJ7G.js +0 -0
  141. package/dist/user-5KLWGPQ2.js +7 -0
  142. package/dist/user-GZLPNGIW.cjs +7 -0
  143. package/dist/user-runtime-6TSL4RZN.cjs +5 -0
  144. package/dist/{user-runtime-6ICV2Y73.js → user-runtime-UPFER72E.js} +1 -1
  145. package/dist/{user.d-L-C7_K84.d.cts → user.d-6bp0zEwE.d.cts} +131 -0
  146. package/dist/{user.d-L-C7_K84.d.ts → user.d-6bp0zEwE.d.ts} +131 -0
  147. package/dist/workflow-JQT3F5NJ.cjs +7 -0
  148. package/dist/workflow-Q6FAE5OL.js +7 -0
  149. package/dist/workflow-definition-5P3PDJKU.cjs +7 -0
  150. package/dist/workflow-definition-XSSOSEGF.js +7 -0
  151. package/dist/{workflow-definition-runtime-GACBV4WM.cjs → workflow-definition-runtime-2HQS3RPK.cjs} +2 -2
  152. package/dist/{workflow-definition-runtime-OVXRSE34.js → workflow-definition-runtime-JUPATIKU.js} +1 -1
  153. package/dist/{workflow-definition.d-DOeb0KVV.d.cts → workflow-definition.d-CweGhhBU.d.cts} +416 -82
  154. package/dist/{workflow-definition.d-DOeb0KVV.d.ts → workflow-definition.d-CweGhhBU.d.ts} +416 -82
  155. package/dist/{workflow.d-eFv0ecBi.d.cts → workflow.d-5cyNJgVQ.d.cts} +28 -0
  156. package/dist/{workflow.d-eFv0ecBi.d.ts → workflow.d-5cyNJgVQ.d.ts} +28 -0
  157. package/docs/customer-portal.md +86 -21
  158. package/docs/user.md +174 -11
  159. package/docs/workflow-definition.md +179 -43
  160. package/docs/workflow.md +16 -7
  161. package/package.json +12 -11
  162. package/dist/chunk-43GJY2EB.js +0 -14
  163. package/dist/chunk-4H2KIKGL.cjs +0 -14
  164. package/dist/chunk-COASF7ZR.js +0 -14
  165. package/dist/chunk-CYS6QBW6.cjs +0 -14
  166. package/dist/customer-portal-F45XWLIO.cjs +0 -7
  167. package/dist/customer-portal-MYNJZ4OW.js +0 -7
  168. package/dist/user-3SLAEEVD.cjs +0 -7
  169. package/dist/user-PRUYBXQV.js +0 -7
  170. package/dist/user-runtime-Y3227ETX.cjs +0 -5
  171. package/dist/workflow-7OU2YEEI.cjs +0 -7
  172. package/dist/workflow-IVKCWS44.js +0 -7
  173. package/dist/workflow-definition-2VF7S23G.js +0 -7
  174. package/dist/workflow-definition-U6YXD42W.cjs +0 -7
@@ -3,11 +3,20 @@
3
3
  "info": {
4
4
  "title": "Workflows Definitions",
5
5
  "version": "1.1.0",
6
- "description": "Service for Workflow Definitions for different processes inside of an Organization\n"
6
+ "description": "The Workflows Definitions API enables you to create, manage, and configure reusable workflow templates\nwithin your organization. Workflow definitions serve as blueprints that define the structure and behavior\nof business processes, which can then be instantiated as workflow executions.\n\n## Core Concepts\n\n### Workflow Definition (V1)\nA workflow definition is a template that describes a business process. It consists of:\n- **Sections**: Logical groupings (phases) that organize related steps together\n- **Steps**: Individual tasks or actions that need to be completed within a section\n- **Closing Reasons**: Predefined reasons that can be selected when closing/completing a workflow\n\n### Flow Template (V2)\nThe modern workflow model that provides advanced capabilities:\n- **Phases**: Named stages that group related tasks and track progress through the workflow\n- **Tasks**: Individual units of work that can be manual, automated, AI-powered, or decision points\n- **Edges**: Connections between tasks that define the flow sequence and support conditional branching\n- **Triggers**: Define how a workflow is started (manual, automation, journey submission)\n\n### Task Types (V2)\n- **MANUAL**: Tasks assigned to users that require human action to complete\n- **AUTOMATION**: Tasks that execute automated actions when reached\n- **DECISION**: Conditional branching points that evaluate conditions to determine the next path\n- **AI_AGENT**: Tasks that invoke AI agents to perform intelligent actions\n\n## API Versions\n- **V1 endpoints** (`/v1/workflows/...`): Legacy linear workflow model with sections and steps\n- **V2 endpoints** (`/v2/flows/...`): Modern graph-based flow model with phases, tasks, and edges\n"
7
7
  },
8
- "servers": [
8
+ "tags": [
9
9
  {
10
- "url": "https://workflows-definition.sls.epilot.io"
10
+ "name": "Workflows",
11
+ "description": "Manage V1 workflow definitions with sections and steps. These endpoints support the legacy\nlinear workflow model where definitions contain a sequential flow of sections and steps.\n"
12
+ },
13
+ {
14
+ "name": "Flows V2",
15
+ "description": "Manage V2 flow templates with phases, tasks, and edges. The modern workflow model supports\nadvanced features including conditional branching, multiple trigger types, automation tasks,\nAI agent tasks, and flexible task dependencies.\n"
16
+ },
17
+ {
18
+ "name": "Closing Reason",
19
+ "description": "Manage closing reasons that can be associated with workflows. Closing reasons provide\npredefined options for users to select when closing or completing a workflow execution,\nenabling better tracking and reporting of workflow outcomes.\n"
11
20
  }
12
21
  ],
13
22
  "security": [
@@ -40,7 +49,7 @@
40
49
  }
41
50
  },
42
51
  "500": {
43
- "description": "Other errors",
52
+ "description": "Internal server error",
44
53
  "content": {
45
54
  "application/json": {
46
55
  "schema": {
@@ -56,7 +65,7 @@
56
65
  "get": {
57
66
  "operationId": "getDefinitions",
58
67
  "summary": "getDefinitions",
59
- "description": "Retrieve all Workflow Definitions from an Organization",
68
+ "description": "Retrieve all V1 workflow definitions belonging to the authenticated organization.",
60
69
  "tags": [
61
70
  "Workflows"
62
71
  ],
@@ -135,7 +144,7 @@
135
144
  }
136
145
  },
137
146
  "500": {
138
- "description": "Other errors",
147
+ "description": "Internal server error",
139
148
  "content": {
140
149
  "application/json": {
141
150
  "schema": {
@@ -149,7 +158,7 @@
149
158
  "post": {
150
159
  "operationId": "createDefinition",
151
160
  "summary": "createDefinition",
152
- "description": "Create a Workflow Definition.",
161
+ "description": "Create a new V1 workflow definition. The definition consists of sections and steps\nthat define the structure of the workflow. Once created, the definition can be used\nto start workflow executions.\n",
153
162
  "tags": [
154
163
  "Workflows"
155
164
  ],
@@ -387,17 +396,89 @@
387
396
  "post": {
388
397
  "operationId": "createFlowTemplate",
389
398
  "summary": "createFlowTemplate",
390
- "description": "Create a new Flow Template.",
399
+ "description": "Create a new Flow Template (V2 workflow definition).\n\nA flow template defines the structure of a workflow including its phases, tasks,\nedges (connections between tasks), and trigger configuration. Once created, the\ntemplate can be used to start workflow executions.\n",
391
400
  "tags": [
392
401
  "Flows V2"
393
402
  ],
403
+ "parameters": [
404
+ {
405
+ "$ref": "#/components/parameters/EnforceLimitsParam"
406
+ }
407
+ ],
394
408
  "requestBody": {
395
- "description": "Flow Template payload",
409
+ "description": "Flow Template payload containing the workflow structure.\n\nRequired fields:\n- `name`: Display name for the workflow\n- `tasks`: Array of task definitions (manual, automation, decision, or AI agent tasks)\n- `edges`: Array of connections defining the flow between tasks\n",
396
410
  "required": true,
397
411
  "content": {
398
412
  "application/json": {
399
413
  "schema": {
400
414
  "$ref": "#/components/schemas/CreateFlowTemplate"
415
+ },
416
+ "example": {
417
+ "name": "Customer Onboarding",
418
+ "description": "Standard customer onboarding workflow with verification steps",
419
+ "version": "v3",
420
+ "enabled": true,
421
+ "trigger": {
422
+ "type": "manual",
423
+ "entity_schema": "contact"
424
+ },
425
+ "phases": [
426
+ {
427
+ "id": "phase_1",
428
+ "name": "Verification"
429
+ },
430
+ {
431
+ "id": "phase_2",
432
+ "name": "Setup"
433
+ }
434
+ ],
435
+ "tasks": [
436
+ {
437
+ "id": "task_1",
438
+ "name": "Verify customer identity",
439
+ "task_type": "MANUAL",
440
+ "phase_id": "phase_1",
441
+ "assigned_to": [
442
+ "user_123"
443
+ ]
444
+ },
445
+ {
446
+ "id": "task_2",
447
+ "name": "Send welcome email",
448
+ "task_type": "AUTOMATION",
449
+ "phase_id": "phase_2",
450
+ "automation_config": {
451
+ "flow_id": "automation_456"
452
+ },
453
+ "trigger_mode": "automatic"
454
+ },
455
+ {
456
+ "id": "task_3",
457
+ "name": "Schedule follow-up",
458
+ "task_type": "MANUAL",
459
+ "phase_id": "phase_2"
460
+ }
461
+ ],
462
+ "edges": [
463
+ {
464
+ "id": "edge_1",
465
+ "from_id": "task_1",
466
+ "to_id": "task_2"
467
+ },
468
+ {
469
+ "id": "edge_2",
470
+ "from_id": "task_2",
471
+ "to_id": "task_3"
472
+ }
473
+ ],
474
+ "closing_reasons": [
475
+ {
476
+ "id": "reason_completed"
477
+ },
478
+ {
479
+ "id": "reason_cancelled"
480
+ }
481
+ ]
401
482
  }
402
483
  }
403
484
  }
@@ -512,7 +593,7 @@
512
593
  "get": {
513
594
  "operationId": "getFlowTemplate",
514
595
  "summary": "getFlowTemplate",
515
- "description": "Get specific FLow template for a customer",
596
+ "description": "Retrieve a specific flow template by its unique identifier.",
516
597
  "tags": [
517
598
  "Flows V2"
518
599
  ],
@@ -523,7 +604,8 @@
523
604
  "schema": {
524
605
  "$ref": "#/components/schemas/FlowTemplateId"
525
606
  },
526
- "required": true
607
+ "required": true,
608
+ "description": "Unique identifier of the flow template to retrieve."
527
609
  }
528
610
  ],
529
611
  "responses": {
@@ -593,11 +675,15 @@
593
675
  "schema": {
594
676
  "$ref": "#/components/schemas/FlowTemplateId"
595
677
  },
596
- "required": true
678
+ "required": true,
679
+ "description": "Unique identifier of the flow template to update."
680
+ },
681
+ {
682
+ "$ref": "#/components/parameters/EnforceLimitsParam"
597
683
  }
598
684
  ],
599
685
  "requestBody": {
600
- "description": "Flow Template payload",
686
+ "description": "Updated flow template payload containing the full workflow definition.",
601
687
  "required": true,
602
688
  "content": {
603
689
  "application/json": {
@@ -619,7 +705,7 @@
619
705
  }
620
706
  },
621
707
  "400": {
622
- "description": "Validation Errors",
708
+ "description": "Validation errors - request body contains invalid data",
623
709
  "content": {
624
710
  "application/json": {
625
711
  "schema": {
@@ -629,7 +715,7 @@
629
715
  }
630
716
  },
631
717
  "401": {
632
- "description": "Authentication Errors",
718
+ "description": "Authentication failed - invalid or missing Bearer token",
633
719
  "content": {
634
720
  "application/json": {
635
721
  "schema": {
@@ -638,6 +724,16 @@
638
724
  }
639
725
  }
640
726
  },
727
+ "404": {
728
+ "description": "Flow template not found",
729
+ "content": {
730
+ "application/json": {
731
+ "schema": {
732
+ "$ref": "#/components/schemas/DefinitionNotFoundResp"
733
+ }
734
+ }
735
+ }
736
+ },
641
737
  "409": {
642
738
  "description": "Conflict - the workflow was modified by another user since it was last loaded",
643
739
  "content": {
@@ -649,7 +745,7 @@
649
745
  }
650
746
  },
651
747
  "500": {
652
- "description": "Other errors",
748
+ "description": "Internal server error",
653
749
  "content": {
654
750
  "application/json": {
655
751
  "schema": {
@@ -675,7 +771,7 @@
675
771
  "$ref": "#/components/schemas/FlowTemplateId"
676
772
  },
677
773
  "required": true,
678
- "description": "Id of the flow template to de deleted."
774
+ "description": "Unique identifier of the flow template to be deleted."
679
775
  }
680
776
  ],
681
777
  "responses": {
@@ -693,7 +789,24 @@
693
789
  }
694
790
  },
695
791
  "404": {
696
- "description": "No definition found"
792
+ "description": "Flow template not found",
793
+ "content": {
794
+ "application/json": {
795
+ "schema": {
796
+ "$ref": "#/components/schemas/DefinitionNotFoundResp"
797
+ }
798
+ }
799
+ }
800
+ },
801
+ "500": {
802
+ "description": "Internal server error",
803
+ "content": {
804
+ "application/json": {
805
+ "schema": {
806
+ "$ref": "#/components/schemas/ErrorResp"
807
+ }
808
+ }
809
+ }
697
810
  }
698
811
  }
699
812
  }
@@ -702,7 +815,7 @@
702
815
  "post": {
703
816
  "operationId": "duplicateFlowTemplate",
704
817
  "summary": "duplicateFlowTemplate",
705
- "description": "Duplicate a Flow Template from an existing workflow.",
818
+ "description": "Create a copy of an existing flow template. The duplicated template will have a new\nunique identifier and can be modified independently of the original. This is useful\nfor creating variations of existing workflows without starting from scratch.\n",
706
819
  "tags": [
707
820
  "Flows V2"
708
821
  ],
@@ -713,7 +826,8 @@
713
826
  "schema": {
714
827
  "$ref": "#/components/schemas/FlowTemplateId"
715
828
  },
716
- "required": true
829
+ "required": true,
830
+ "description": "Unique identifier of the flow template to duplicate."
717
831
  }
718
832
  ],
719
833
  "responses": {
@@ -728,7 +842,7 @@
728
842
  }
729
843
  },
730
844
  "400": {
731
- "description": "Validation Errors",
845
+ "description": "Validation errors - source template contains invalid data",
732
846
  "content": {
733
847
  "application/json": {
734
848
  "schema": {
@@ -738,7 +852,7 @@
738
852
  }
739
853
  },
740
854
  "401": {
741
- "description": "Authentication Errors",
855
+ "description": "Authentication failed - invalid or missing Bearer token",
742
856
  "content": {
743
857
  "application/json": {
744
858
  "schema": {
@@ -747,8 +861,18 @@
747
861
  }
748
862
  }
749
863
  },
864
+ "404": {
865
+ "description": "Source flow template not found",
866
+ "content": {
867
+ "application/json": {
868
+ "schema": {
869
+ "$ref": "#/components/schemas/DefinitionNotFoundResp"
870
+ }
871
+ }
872
+ }
873
+ },
750
874
  "500": {
751
- "description": "Other errors",
875
+ "description": "Internal server error",
752
876
  "content": {
753
877
  "application/json": {
754
878
  "schema": {
@@ -1106,7 +1230,7 @@
1106
1230
  "type": "string"
1107
1231
  },
1108
1232
  "required": true,
1109
- "description": "Id of the definition to de deleted.",
1233
+ "description": "Unique identifier of the workflow definition to be deleted.",
1110
1234
  "example": "CustomerRequest"
1111
1235
  }
1112
1236
  ],
@@ -1143,7 +1267,7 @@
1143
1267
  "type": "boolean"
1144
1268
  },
1145
1269
  "required": false,
1146
- "description": "Filter Closing Reasons by status like active inactiv",
1270
+ "description": "When set to true, includes inactive closing reasons in the response. By default, only active closing reasons are returned.",
1147
1271
  "example": true
1148
1272
  }
1149
1273
  ],
@@ -1588,6 +1712,18 @@
1588
1712
  }
1589
1713
  },
1590
1714
  "components": {
1715
+ "parameters": {
1716
+ "EnforceLimitsParam": {
1717
+ "in": "query",
1718
+ "name": "enforce_limits",
1719
+ "required": false,
1720
+ "schema": {
1721
+ "type": "boolean",
1722
+ "default": false
1723
+ },
1724
+ "description": "When true, size/count limit violations (max incoming edges per task, max branches, max entity-sync rules, ...) are enforced as 400 errors. Used by the flow-builder UI for interactive authoring. On update, pre-existing violations are tolerated as long as the request does not worsen them. When false or absent (default for API/system callers such as blueprints, configuration hub and snapshots), limit violations are accepted and returned as `limit_warnings`. Structural errors are always enforced regardless of this flag."
1725
+ }
1726
+ },
1591
1727
  "securitySchemes": {
1592
1728
  "BearerAuth": {
1593
1729
  "type": "http",
@@ -1598,6 +1734,7 @@
1598
1734
  "schemas": {
1599
1735
  "FlowTemplateBase": {
1600
1736
  "type": "object",
1737
+ "description": "Base schema for V2 flow templates. A flow template defines the structure of a workflow\nincluding phases, tasks, edges, triggers, and other configuration. Flow templates serve\nas blueprints that can be instantiated as flow executions.\n",
1601
1738
  "required": [
1602
1739
  "name",
1603
1740
  "tasks",
@@ -1605,16 +1742,22 @@
1605
1742
  ],
1606
1743
  "properties": {
1607
1744
  "id": {
1608
- "type": "string"
1745
+ "type": "string",
1746
+ "description": "Unique identifier for the flow template, generated by the system."
1609
1747
  },
1610
1748
  "org_id": {
1611
- "type": "string"
1749
+ "type": "string",
1750
+ "description": "Organization identifier that owns this flow template."
1612
1751
  },
1613
1752
  "name": {
1614
- "type": "string"
1753
+ "type": "string",
1754
+ "description": "Display name for the workflow, shown to users in the UI.",
1755
+ "minLength": 3
1615
1756
  },
1616
1757
  "description": {
1617
- "type": "string"
1758
+ "type": "string",
1759
+ "description": "Optional detailed description of the workflow's purpose and behavior.",
1760
+ "maxLength": 5000
1618
1761
  },
1619
1762
  "trigger": {
1620
1763
  "$ref": "#/components/schemas/Trigger"
@@ -1715,6 +1858,64 @@
1715
1858
  "items": {
1716
1859
  "type": "string"
1717
1860
  }
1861
+ },
1862
+ "linear": {
1863
+ "type": "boolean",
1864
+ "description": "When true, this is a linear flow: task enablement is computed at runtime from the graph — a task is enabled only when all of its direct predecessor tasks in its branch are done. This fully overrides any explicit per-task requirements."
1865
+ },
1866
+ "limit_warnings": {
1867
+ "type": "array",
1868
+ "description": "Non-blocking warnings for configuration limits the flow exceeds. Returned on read (get-flow) and on create/update responses. Size/count limits are soft: a flow exceeding them is still accepted and stored, and the violations are reported here so the UI can surface an informational banner. The flow is still fully editable and usable.",
1869
+ "items": {
1870
+ "$ref": "#/components/schemas/FlowLimitWarning"
1871
+ }
1872
+ }
1873
+ }
1874
+ },
1875
+ "FlowLimitWarning": {
1876
+ "type": "object",
1877
+ "description": "A configuration limit that the flow currently exceeds. Returned by the get-flow endpoint and by create/update responses so the UI can show a non-blocking banner. Size/count limit violations never cause a 400 — only structural errors do. The flow remains fully usable; users are encouraged to bring values within the limits.",
1878
+ "required": [
1879
+ "i18nKey",
1880
+ "message",
1881
+ "max",
1882
+ "path"
1883
+ ],
1884
+ "properties": {
1885
+ "i18nKey": {
1886
+ "type": "string",
1887
+ "description": "i18n key identifying the exceeded limit (e.g. errors.task_max_incoming_edges)."
1888
+ },
1889
+ "message": {
1890
+ "type": "string",
1891
+ "description": "Human-readable description of the exceeded limit."
1892
+ },
1893
+ "max": {
1894
+ "type": "number",
1895
+ "description": "The configured maximum for this limit."
1896
+ },
1897
+ "current": {
1898
+ "type": "number",
1899
+ "description": "The actual value the flow currently has for this limit (e.g. the actual number of incoming connections)."
1900
+ },
1901
+ "node_id": {
1902
+ "type": "string",
1903
+ "description": "ID of the task/node the limit applies to, when applicable."
1904
+ },
1905
+ "task_name": {
1906
+ "type": "string"
1907
+ },
1908
+ "branch_name": {
1909
+ "type": "string"
1910
+ },
1911
+ "param_name": {
1912
+ "type": "string",
1913
+ "description": "Name of the AI-agent parameter the limit applies to, when applicable."
1914
+ },
1915
+ "path": {
1916
+ "type": "array",
1917
+ "items": {},
1918
+ "description": "JSON path within the flow to the offending value."
1718
1919
  }
1719
1920
  }
1720
1921
  },
@@ -2159,7 +2360,8 @@
2159
2360
  ]
2160
2361
  },
2161
2362
  "duration": {
2162
- "type": "number"
2363
+ "type": "number",
2364
+ "minimum": 1
2163
2365
  },
2164
2366
  "unit": {
2165
2367
  "$ref": "#/components/schemas/TimeUnit"
@@ -2182,7 +2384,8 @@
2182
2384
  ]
2183
2385
  },
2184
2386
  "duration": {
2185
- "type": "number"
2387
+ "type": "number",
2388
+ "minimum": 1
2186
2389
  },
2187
2390
  "unit": {
2188
2391
  "$ref": "#/components/schemas/TimeUnit"
@@ -2273,8 +2476,7 @@
2273
2476
  "type": "integer",
2274
2477
  "description": "Maximum number of iterations for the loop branch",
2275
2478
  "default": 3,
2276
- "minimum": 1,
2277
- "maximum": 100
2479
+ "minimum": 1
2278
2480
  }
2279
2481
  },
2280
2482
  "required": [
@@ -2473,7 +2675,6 @@
2473
2675
  "branch_name": {
2474
2676
  "type": "string",
2475
2677
  "description": "The name of the branch",
2476
- "maxLength": 255,
2477
2678
  "example": "Branch 1"
2478
2679
  },
2479
2680
  "logical_operator": {
@@ -2597,6 +2798,22 @@
2597
2798
  "deleted"
2598
2799
  ]
2599
2800
  },
2801
+ "attributes": {
2802
+ "type": "array",
2803
+ "maxItems": 10,
2804
+ "items": {
2805
+ "type": "string"
2806
+ },
2807
+ "description": "Multi-attribute mode. When present and length > 1, the statement is\nevaluated against every listed attribute and combined via\n`attributes_match`. All listed attributes must share the same\n`attribute_type`. Mutually exclusive with `attribute_sub_field`,\n`date_offset`, and `attribute_operation`. When absent or length === 1,\nthe legacy `attribute` field is used.\n"
2808
+ },
2809
+ "attributes_match": {
2810
+ "type": "string",
2811
+ "enum": [
2812
+ "any",
2813
+ "all"
2814
+ ],
2815
+ "description": "Inner connector across `attributes`. `any` (default) means at least\none attribute must satisfy the operator; `all` means every attribute\nmust satisfy it. Ignored when `attributes` is absent or has length < 2.\n"
2816
+ },
2600
2817
  "attribute_sub_field": {
2601
2818
  "type": "string",
2602
2819
  "description": "For complex attribute types, specifies which sub-field to extract (e.g., \"address\", \"name\", \"email_type\")"
@@ -2681,7 +2898,8 @@
2681
2898
  "hours",
2682
2899
  "days",
2683
2900
  "weeks",
2684
- "months"
2901
+ "months",
2902
+ "years"
2685
2903
  ]
2686
2904
  },
2687
2905
  "EnableRequirement": {
@@ -2710,15 +2928,19 @@
2710
2928
  },
2711
2929
  "WorkflowDefinition": {
2712
2930
  "type": "object",
2931
+ "description": "V1 workflow definition schema. Defines a linear workflow structure with sections\nand steps. Sections group related steps together, and steps represent individual\ntasks that need to be completed. This is the legacy workflow model; for new\nimplementations, consider using V2 flow templates instead.\n",
2713
2932
  "properties": {
2714
2933
  "id": {
2715
- "type": "string"
2934
+ "type": "string",
2935
+ "description": "Unique identifier for the workflow definition, generated by the system."
2716
2936
  },
2717
2937
  "name": {
2718
- "type": "string"
2938
+ "type": "string",
2939
+ "description": "Display name for the workflow, shown to users in the UI."
2719
2940
  },
2720
2941
  "description": {
2721
- "type": "string"
2942
+ "type": "string",
2943
+ "description": "Optional detailed description of the workflow's purpose and behavior."
2722
2944
  },
2723
2945
  "creationTime": {
2724
2946
  "type": "string",
@@ -3029,7 +3251,8 @@
3029
3251
  "type": "boolean"
3030
3252
  },
3031
3253
  "value": {
3032
- "type": "string"
3254
+ "type": "string",
3255
+ "maxLength": 10000
3033
3256
  }
3034
3257
  }
3035
3258
  },
@@ -3045,18 +3268,24 @@
3045
3268
  }
3046
3269
  },
3047
3270
  "DefinitionNotFoundResp": {
3048
- "description": "Definition could be not found",
3271
+ "type": "object",
3272
+ "description": "Error response returned when a workflow definition or flow template is not found.",
3049
3273
  "properties": {
3050
3274
  "message": {
3051
- "type": "string"
3275
+ "type": "string",
3276
+ "description": "Human-readable message indicating the resource was not found.",
3277
+ "example": "Definition with id 'abc123' not found"
3052
3278
  }
3053
3279
  }
3054
3280
  },
3055
3281
  "ClosingReasonNotFoundResp": {
3056
- "description": "Closing reason could be not found",
3282
+ "type": "object",
3283
+ "description": "Error response returned when a closing reason is not found.",
3057
3284
  "properties": {
3058
3285
  "message": {
3059
- "type": "string"
3286
+ "type": "string",
3287
+ "description": "Human-readable message indicating the closing reason was not found.",
3288
+ "example": "Closing reason with id 'xyz789' not found"
3060
3289
  }
3061
3290
  }
3062
3291
  },
@@ -3143,9 +3372,12 @@
3143
3372
  },
3144
3373
  "ErrorResp": {
3145
3374
  "type": "object",
3375
+ "description": "Standard error response returned when an API request fails.",
3146
3376
  "properties": {
3147
3377
  "message": {
3148
- "type": "string"
3378
+ "type": "string",
3379
+ "description": "Human-readable error message describing what went wrong.",
3380
+ "example": "Invalid request body: name is required"
3149
3381
  }
3150
3382
  }
3151
3383
  },
@@ -3296,11 +3528,12 @@
3296
3528
  ]
3297
3529
  },
3298
3530
  "DynamicDueDate": {
3299
- "description": "set a Duedate for a step then a specific",
3531
+ "description": "Configuration for calculating a due date dynamically based on workflow events.\nThe due date is computed by adding a duration (numberOfUnits + timePeriod) to\na reference point defined by actionTypeCondition (e.g., when workflow started,\nwhen a step closed, or when a phase finished).\n",
3300
3532
  "type": "object",
3301
3533
  "properties": {
3302
3534
  "numberOfUnits": {
3303
- "type": "number"
3535
+ "type": "number",
3536
+ "description": "Number of time units to add to the reference point."
3304
3537
  },
3305
3538
  "timePeriod": {
3306
3539
  "$ref": "#/components/schemas/TimeUnit"
@@ -3350,5 +3583,6 @@
3350
3583
  ]
3351
3584
  }
3352
3585
  }
3353
- }
3586
+ },
3587
+ "servers": []
3354
3588
  }
@@ -3507,6 +3507,10 @@
3507
3507
  "singleClosingReasonSelection": {
3508
3508
  "type": "boolean",
3509
3509
  "description": "Indicates whether only a single closing reason can be selected when closing the flow execution"
3510
+ },
3511
+ "linear": {
3512
+ "type": "boolean",
3513
+ "description": "Copied from the flow template at start. When true, task enablement is computed at runtime from the graph (a task is enabled only when all of its direct predecessor tasks in its branch are done) instead of from each task's explicit requirements."
3510
3514
  }
3511
3515
  }
3512
3516
  },
@@ -3751,6 +3755,10 @@
3751
3755
  "scheduled_at": {
3752
3756
  "type": "string",
3753
3757
  "description": "The resolved absolute timestamp (ISO 8601, UTC) at which the task is\narmed to run. Set by the backend when the schedule is armed and the\ntask transitions to SCHEDULED. Absent while the task is still\npending/unscheduled.\n\nNote: intentionally typed as plain `string` (not\n`format: date-time`). `schedule` is embedded in the AutomationTask /\nDecisionTask schemas; if a future request body ever accepts a task\n(or schedule) and `safeParse`s it, `format: date-time` would make\nopenapi-zod-client emit `z.string().datetime({ offset: true })` and\nreject any round-tripped value that is empty or tz-less — the exact\nmechanism behind the May 2026 due_date incident (513ed597 added the\nformat, ee574b43 activated it via an unrelated regen; see commit\n2c91ff35). This field is server-written via `toISOString()` so it is\nalways a valid UTC instant; the datetime validator adds no\nprotection, only latent risk.\n"
3758
+ },
3759
+ "error_reason": {
3760
+ "type": "string",
3761
+ "description": "Set by the backend when scheduling this task FAILED (e.g. the\nreferenced date attribute is empty/unreadable, or the resolved fire\ntime is already in the past). A JSON string\n({ error_code, error_reason, error_info }) describing why, so the UI\ncan show a specific warning and ask the user to fix the date\nattribute and re-schedule. Cleared when the task is successfully\n(re-)armed. This is the decision-task counterpart of\nAutomationInfo.error_reason (decision tasks have no automation_config).\n"
3754
3762
  }
3755
3763
  }
3756
3764
  },
@@ -3812,6 +3820,10 @@
3812
3820
  "scheduled_at": {
3813
3821
  "type": "string",
3814
3822
  "description": "The resolved absolute timestamp (ISO 8601, UTC) at which the task is\narmed to run. Set by the backend when the schedule is armed and the\ntask transitions to SCHEDULED. Absent while the task is still\npending/unscheduled.\n\nNote: intentionally typed as plain `string` (not\n`format: date-time`). `schedule` is embedded in the AutomationTask /\nDecisionTask schemas; if a future request body ever accepts a task\n(or schedule) and `safeParse`s it, `format: date-time` would make\nopenapi-zod-client emit `z.string().datetime({ offset: true })` and\nreject any round-tripped value that is empty or tz-less — the exact\nmechanism behind the May 2026 due_date incident (513ed597 added the\nformat, ee574b43 activated it via an unrelated regen; see commit\n2c91ff35). This field is server-written via `toISOString()` so it is\nalways a valid UTC instant; the datetime validator adds no\nprotection, only latent risk.\n"
3823
+ },
3824
+ "error_reason": {
3825
+ "type": "string",
3826
+ "description": "Set by the backend when scheduling this task FAILED (e.g. the\nreferenced date attribute is empty/unreadable, or the resolved fire\ntime is already in the past). A JSON string\n({ error_code, error_reason, error_info }) describing why, so the UI\ncan show a specific warning and ask the user to fix the date\nattribute and re-schedule. Cleared when the task is successfully\n(re-)armed. This is the decision-task counterpart of\nAutomationInfo.error_reason (decision tasks have no automation_config).\n"
3815
3827
  }
3816
3828
  },
3817
3829
  "required": [