vellum-ai 0.13.8__py3-none-any.whl → 0.13.10__py3-none-any.whl

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 (49) hide show
  1. vellum/client/core/client_wrapper.py +1 -1
  2. vellum/plugins/vellum_mypy.py +6 -2
  3. vellum/workflows/descriptors/utils.py +1 -1
  4. vellum/workflows/nodes/bases/base.py +1 -2
  5. vellum/workflows/nodes/displayable/api_node/node.py +4 -1
  6. vellum/workflows/nodes/displayable/bases/api_node/node.py +4 -1
  7. vellum/workflows/nodes/displayable/bases/base_prompt_node/node.py +4 -1
  8. vellum/workflows/nodes/displayable/bases/inline_prompt_node/node.py +4 -0
  9. vellum/workflows/nodes/displayable/bases/prompt_deployment_node.py +4 -0
  10. vellum/workflows/nodes/displayable/bases/search_node.py +4 -0
  11. vellum/workflows/nodes/displayable/code_execution_node/node.py +4 -1
  12. vellum/workflows/nodes/displayable/conditional_node/node.py +4 -0
  13. vellum/workflows/nodes/displayable/final_output_node/node.py +4 -0
  14. vellum/workflows/nodes/displayable/guardrail_node/node.py +4 -1
  15. vellum/workflows/nodes/displayable/inline_prompt_node/node.py +4 -0
  16. vellum/workflows/nodes/displayable/merge_node/node.py +3 -1
  17. vellum/workflows/nodes/displayable/note_node/node.py +4 -0
  18. vellum/workflows/nodes/displayable/prompt_deployment_node/node.py +4 -0
  19. vellum/workflows/nodes/displayable/search_node/node.py +4 -0
  20. vellum/workflows/nodes/displayable/subworkflow_deployment_node/node.py +4 -1
  21. vellum/workflows/nodes/utils.py +6 -18
  22. {vellum_ai-0.13.8.dist-info → vellum_ai-0.13.10.dist-info}/METADATA +1 -1
  23. {vellum_ai-0.13.8.dist-info → vellum_ai-0.13.10.dist-info}/RECORD +49 -48
  24. vellum_ee/workflows/display/nodes/base_node_display.py +103 -3
  25. vellum_ee/workflows/display/nodes/vellum/base_node.py +34 -105
  26. vellum_ee/workflows/display/nodes/vellum/conditional_node.py +2 -1
  27. vellum_ee/workflows/display/nodes/vellum/tests/test_try_node.py +63 -0
  28. vellum_ee/workflows/display/nodes/vellum/tests/test_utils.py +3 -4
  29. vellum_ee/workflows/display/nodes/vellum/try_node.py +28 -4
  30. vellum_ee/workflows/display/nodes/vellum/utils.py +1 -80
  31. vellum_ee/workflows/display/tests/test_vellum_workflow_display.py +56 -0
  32. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/conftest.py +3 -2
  33. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_adornments_serialization.py +143 -26
  34. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_attributes_serialization.py +10 -10
  35. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_outputs_serialization.py +6 -6
  36. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_ports_serialization.py +32 -34
  37. vellum_ee/workflows/display/tests/workflow_serialization/generic_nodes/test_trigger_serialization.py +4 -4
  38. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +1 -2
  39. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +5 -5
  40. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_generic_node_serialization.py +1 -1
  41. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +6 -3
  42. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +6 -3
  43. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_merge_node_serialization.py +3 -3
  44. vellum_ee/workflows/display/utils/vellum.py +74 -4
  45. vellum_ee/workflows/display/workflows/base_workflow_display.py +22 -24
  46. vellum_ee/workflows/display/workflows/vellum_workflow_display.py +6 -15
  47. {vellum_ai-0.13.8.dist-info → vellum_ai-0.13.10.dist-info}/LICENSE +0 -0
  48. {vellum_ai-0.13.8.dist-info → vellum_ai-0.13.10.dist-info}/WHEEL +0 -0
  49. {vellum_ai-0.13.8.dist-info → vellum_ai-0.13.10.dist-info}/entry_points.txt +0 -0
@@ -40,10 +40,10 @@ def test_serialize_node__basic(serialize_node):
40
40
  "test_ports_serialization",
41
41
  ],
42
42
  },
43
- "trigger": {"id": "9d3a1b3d-4a38-4f2e-bbf1-dd8be152bce8", "merge_behavior": "AWAIT_ANY"},
43
+ "trigger": {"id": "9d3a1b3d-4a38-4f2e-bbf1-dd8be152bce8", "merge_behavior": "AWAIT_ATTRIBUTES"},
44
44
  "ports": [
45
45
  {
46
- "id": "4fbf0fff-a42e-4410-852a-238b5059198e",
46
+ "id": "89dccfa5-cc1a-4612-bd87-86cb444f6dd4",
47
47
  "name": "default",
48
48
  "type": "DEFAULT",
49
49
  }
@@ -87,10 +87,10 @@ def test_serialize_node__if(serialize_node):
87
87
  "test_ports_serialization",
88
88
  ],
89
89
  },
90
- "trigger": {"id": "a8afaebc-7333-4e3f-b221-24452b4a1d47", "merge_behavior": "AWAIT_ANY"},
90
+ "trigger": {"id": "a8afaebc-7333-4e3f-b221-24452b4a1d47", "merge_behavior": "AWAIT_ATTRIBUTES"},
91
91
  "ports": [
92
92
  {
93
- "id": "7605b4c0-a432-4517-b759-5858045a5146",
93
+ "id": "d713e346-b55a-4871-91de-f1470bfb3479",
94
94
  "type": "IF",
95
95
  "name": "if_branch",
96
96
  "expression": {
@@ -150,10 +150,10 @@ def test_serialize_node__if_else(serialize_node):
150
150
  "test_ports_serialization",
151
151
  ],
152
152
  },
153
- "trigger": {"id": "5b4f6553-69ca-4844-bbe4-9e5594bc8cae", "merge_behavior": "AWAIT_ANY"},
153
+ "trigger": {"id": "5b4f6553-69ca-4844-bbe4-9e5594bc8cae", "merge_behavior": "AWAIT_ATTRIBUTES"},
154
154
  "ports": [
155
155
  {
156
- "id": "3eeb7f03-7d65-45aa-b0e5-c7a453f5cbdf",
156
+ "id": "1b02eabf-f2bd-45bd-ab26-fe4034ed5978",
157
157
  "type": "IF",
158
158
  "name": "if_branch",
159
159
  "expression": {
@@ -173,7 +173,7 @@ def test_serialize_node__if_else(serialize_node):
173
173
  },
174
174
  },
175
175
  {
176
- "id": "b8472c77-74d5-4432-bf8b-6cd65d3dde06",
176
+ "id": "2c858834-8f65-4b6b-89d8-07b394764666",
177
177
  "type": "ELSE",
178
178
  "name": "else_branch",
179
179
  "expression": None,
@@ -184,7 +184,6 @@ def test_serialize_node__if_else(serialize_node):
184
184
  "outputs": [],
185
185
  },
186
186
  serialized_node,
187
- ignore_order=True,
188
187
  )
189
188
 
190
189
 
@@ -220,10 +219,10 @@ def test_serialize_node__if_elif_else(serialize_node):
220
219
  "test_ports_serialization",
221
220
  ],
222
221
  },
223
- "trigger": {"id": "22d55b5b-3545-4498-8658-9d0464202e78", "merge_behavior": "AWAIT_ANY"},
222
+ "trigger": {"id": "22d55b5b-3545-4498-8658-9d0464202e78", "merge_behavior": "AWAIT_ATTRIBUTES"},
224
223
  "ports": [
225
224
  {
226
- "id": "f6e0a2c0-192d-452f-bde4-32fb938e91bc",
225
+ "id": "dcaa1d8e-01c6-48b4-a851-8828b49d0f57",
227
226
  "type": "IF",
228
227
  "name": "if_branch",
229
228
  "expression": {
@@ -243,7 +242,7 @@ def test_serialize_node__if_elif_else(serialize_node):
243
242
  },
244
243
  },
245
244
  {
246
- "id": "7e44de04-e816-4da8-9251-cf389442a5d6",
245
+ "id": "e00351f8-f1f9-4f7b-bf7a-c24e3db40d6c",
247
246
  "type": "ELIF",
248
247
  "name": "elif_branch",
249
248
  "expression": {
@@ -263,7 +262,7 @@ def test_serialize_node__if_elif_else(serialize_node):
263
262
  },
264
263
  },
265
264
  {
266
- "id": "00db3698-ddf5-413b-8408-fff664c212d7",
265
+ "id": "90caeb67-5ab7-46aa-b65e-01c27f549eed",
267
266
  "type": "ELSE",
268
267
  "expression": None,
269
268
  "name": "else_branch",
@@ -274,7 +273,6 @@ def test_serialize_node__if_elif_else(serialize_node):
274
273
  "outputs": [],
275
274
  },
276
275
  serialized_node,
277
- ignore_order=True,
278
276
  )
279
277
 
280
278
 
@@ -323,10 +321,10 @@ def test_serialize_node__node_output_reference(serialize_node):
323
321
  ],
324
322
  },
325
323
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
326
- "trigger": {"id": "449072ba-f7b6-4314-ac96-682123f225e5", "merge_behavior": "AWAIT_ANY"},
324
+ "trigger": {"id": "449072ba-f7b6-4314-ac96-682123f225e5", "merge_behavior": "AWAIT_ATTRIBUTES"},
327
325
  "ports": [
328
326
  {
329
- "id": "ec9a79b8-65c3-4de8-bd29-42c914d72d4f",
327
+ "id": "eecccf2b-82af-4559-8a1b-0c5de5890ac2",
330
328
  "type": "IF",
331
329
  "name": "if_branch",
332
330
  "expression": {
@@ -387,10 +385,10 @@ def test_serialize_node__vellum_secret_reference(serialize_node):
387
385
  ],
388
386
  },
389
387
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
390
- "trigger": {"id": "2709539b-352d-455a-bb86-dba070b59aa1", "merge_behavior": "AWAIT_ANY"},
388
+ "trigger": {"id": "2709539b-352d-455a-bb86-dba070b59aa1", "merge_behavior": "AWAIT_ATTRIBUTES"},
391
389
  "ports": [
392
390
  {
393
- "id": "a353d3f6-2a1f-457c-b8d1-13db5b45be8f",
391
+ "id": "b6387c9c-2cce-4667-9567-97e433503e72",
394
392
  "type": "IF",
395
393
  "name": "if_branch",
396
394
  "expression": {
@@ -456,10 +454,10 @@ def test_serialize_node__execution_count_reference(serialize_node):
456
454
  ],
457
455
  },
458
456
  "base": {"name": "BaseNode", "module": ["vellum", "workflows", "nodes", "bases", "base"]},
459
- "trigger": {"id": "68a91426-4c30-4194-a4c0-cff224d3c0f3", "merge_behavior": "AWAIT_ANY"},
457
+ "trigger": {"id": "68a91426-4c30-4194-a4c0-cff224d3c0f3", "merge_behavior": "AWAIT_ATTRIBUTES"},
460
458
  "ports": [
461
459
  {
462
- "id": "1794c2eb-5cab-49fe-9354-dfc29f11b374",
460
+ "id": "13ab561e-09c9-48ed-b22b-a4de4d9df887",
463
461
  "type": "IF",
464
462
  "name": "if_branch",
465
463
  "expression": {
@@ -473,7 +471,7 @@ def test_serialize_node__execution_count_reference(serialize_node):
473
471
  "type": "CONSTANT_VALUE",
474
472
  "value": {
475
473
  "type": "NUMBER",
476
- "value": 5,
474
+ "value": 5.0,
477
475
  },
478
476
  },
479
477
  },
@@ -518,10 +516,10 @@ def test_serialize_node__null(serialize_node):
518
516
  "test_ports_serialization",
519
517
  ],
520
518
  },
521
- "trigger": {"id": "26b257ed-6a7d-4ca3-a5c8-d17ba1e776ba", "merge_behavior": "AWAIT_ANY"},
519
+ "trigger": {"id": "26b257ed-6a7d-4ca3-a5c8-d17ba1e776ba", "merge_behavior": "AWAIT_ATTRIBUTES"},
522
520
  "ports": [
523
521
  {
524
- "id": "51932d23-492e-4b3b-8b03-6ad7303a80c9",
522
+ "id": "76a2867d-dd4c-409c-b97f-94b168a2233a",
525
523
  "type": "IF",
526
524
  "name": "if_branch",
527
525
  "expression": {
@@ -578,10 +576,10 @@ def test_serialize_node__between(serialize_node):
578
576
  "test_ports_serialization",
579
577
  ],
580
578
  },
581
- "trigger": {"id": "086a355e-d9ef-4039-af35-9f1211497b32", "merge_behavior": "AWAIT_ANY"},
579
+ "trigger": {"id": "086a355e-d9ef-4039-af35-9f1211497b32", "merge_behavior": "AWAIT_ATTRIBUTES"},
582
580
  "ports": [
583
581
  {
584
- "id": "a86bd19f-a9f7-45c3-80ff-73330b1b75af",
582
+ "id": "71493245-0778-46f2-8bda-863af50d910d",
585
583
  "type": "IF",
586
584
  "name": "if_branch",
587
585
  "expression": {
@@ -595,14 +593,14 @@ def test_serialize_node__between(serialize_node):
595
593
  "type": "CONSTANT_VALUE",
596
594
  "value": {
597
595
  "type": "NUMBER",
598
- "value": 1,
596
+ "value": 1.0,
599
597
  },
600
598
  },
601
599
  "rhs": {
602
600
  "type": "CONSTANT_VALUE",
603
601
  "value": {
604
602
  "type": "NUMBER",
605
- "value": 10,
603
+ "value": 10.0,
606
604
  },
607
605
  },
608
606
  },
@@ -647,10 +645,10 @@ def test_serialize_node__or(serialize_node):
647
645
  "test_ports_serialization",
648
646
  ],
649
647
  },
650
- "trigger": {"id": "dc245f37-9be7-4097-a50a-4f7196e24313", "merge_behavior": "AWAIT_ANY"},
648
+ "trigger": {"id": "dc245f37-9be7-4097-a50a-4f7196e24313", "merge_behavior": "AWAIT_ATTRIBUTES"},
651
649
  "ports": [
652
650
  {
653
- "id": "652a42f9-f4e7-4791-8167-8903ff839520",
651
+ "id": "9b4511aa-2d57-44f9-8156-d41dd8b5f98e",
654
652
  "type": "IF",
655
653
  "name": "if_branch",
656
654
  "expression": {
@@ -731,10 +729,10 @@ def test_serialize_node__and_then_or(serialize_node):
731
729
  "test_ports_serialization",
732
730
  ],
733
731
  },
734
- "trigger": {"id": "33cfa8f4-bfc5-40b3-8df8-ab86371c26e0", "merge_behavior": "AWAIT_ANY"},
732
+ "trigger": {"id": "33cfa8f4-bfc5-40b3-8df8-ab86371c26e0", "merge_behavior": "AWAIT_ATTRIBUTES"},
735
733
  "ports": [
736
734
  {
737
- "id": "42c89e95-6bbf-4e85-8f26-d4b6fc55d99c",
735
+ "id": "91174ae5-6ce0-4f6c-9c05-ecfbfb4058f6",
738
736
  "type": "IF",
739
737
  "name": "if_branch",
740
738
  "expression": {
@@ -834,10 +832,10 @@ def test_serialize_node__parenthesized_and_then_or(serialize_node):
834
832
  "test_ports_serialization",
835
833
  ],
836
834
  },
837
- "trigger": {"id": "91ac3b05-c931-4a4c-bb48-c2ba0e883867", "merge_behavior": "AWAIT_ANY"},
835
+ "trigger": {"id": "91ac3b05-c931-4a4c-bb48-c2ba0e883867", "merge_behavior": "AWAIT_ATTRIBUTES"},
838
836
  "ports": [
839
837
  {
840
- "id": "cc07394b-f20b-4370-8a5b-af90e847a73f",
838
+ "id": "915f923b-f398-48af-93a4-5f7e66b8aa76",
841
839
  "type": "IF",
842
840
  "name": "if_branch",
843
841
  "expression": {
@@ -937,10 +935,10 @@ def test_serialize_node__or_then_and(serialize_node):
937
935
  "test_ports_serialization",
938
936
  ],
939
937
  },
940
- "trigger": {"id": "dfa53d32-36cc-4b1d-adad-d4de21ac1e5a", "merge_behavior": "AWAIT_ANY"},
938
+ "trigger": {"id": "dfa53d32-36cc-4b1d-adad-d4de21ac1e5a", "merge_behavior": "AWAIT_ATTRIBUTES"},
941
939
  "ports": [
942
940
  {
943
- "id": "daaff604-da1e-45e6-b3df-5bc8de8d55fe",
941
+ "id": "413bba3d-6a16-4f96-ba45-b5372f819277",
944
942
  "type": "IF",
945
943
  "name": "if_branch",
946
944
  "expression": {
@@ -34,10 +34,10 @@ def test_serialize_node__basic(serialize_node):
34
34
  "test_trigger_serialization",
35
35
  ],
36
36
  },
37
- "trigger": {"id": "9d3a1b3d-4a38-4f2e-bbf1-dd8be152bce8", "merge_behavior": "AWAIT_ANY"},
37
+ "trigger": {"id": "9d3a1b3d-4a38-4f2e-bbf1-dd8be152bce8", "merge_behavior": "AWAIT_ATTRIBUTES"},
38
38
  "ports": [
39
39
  {
40
- "id": "4fbf0fff-a42e-4410-852a-238b5059198e",
40
+ "id": "89dccfa5-cc1a-4612-bd87-86cb444f6dd4",
41
41
  "name": "default",
42
42
  "type": "DEFAULT",
43
43
  }
@@ -80,7 +80,7 @@ def test_serialize_node__await_any(serialize_node):
80
80
  "trigger": {"id": "ffa72187-9a18-453f-ae55-b77aad332630", "merge_behavior": "AWAIT_ANY"},
81
81
  "ports": [
82
82
  {
83
- "id": "3e219c0a-e5f8-443a-ac78-1a458b189009",
83
+ "id": "38b83138-cb07-40cb-82d2-83982ded6883",
84
84
  "name": "default",
85
85
  "type": "DEFAULT",
86
86
  }
@@ -123,7 +123,7 @@ def test_serialize_node__await_all(serialize_node):
123
123
  "trigger": {"id": "62074276-c817-476d-b59d-da523ae3f218", "merge_behavior": "AWAIT_ALL"},
124
124
  "ports": [
125
125
  {
126
- "id": "9797e93f-9fe6-48b2-a48e-476abbd20e32",
126
+ "id": "9edef179-a1c2-4624-b185-593bb84f08a0",
127
127
  "name": "default",
128
128
  "type": "DEFAULT",
129
129
  }
@@ -685,8 +685,7 @@ def test_serialize_workflow__try_wrapped():
685
685
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
686
686
  },
687
687
  ],
688
- final_output_nodes,
689
- ignore_order=True,
688
+ sorted(final_output_nodes, key=lambda x: x["id"], reverse=True),
690
689
  )
691
690
 
692
691
  # AND each edge should be serialized correctly
@@ -672,7 +672,7 @@ def test_serialize_workflow():
672
672
  "source_node_id": "9b619e4d-b0a7-4121-9060-100d457868cb",
673
673
  "source_handle_id": "3a45b81f-95e4-4cbd-8997-bfdbe30251e8",
674
674
  "target_node_id": "0d959311-c836-4641-a867-58f63df9dfea",
675
- "target_handle_id": "7beba198-c452-4749-a38a-ea9420d84e14",
675
+ "target_handle_id": "139c6965-68f0-4bae-a6d9-3ee68d6347c0",
676
676
  "type": "DEFAULT",
677
677
  },
678
678
  {
@@ -680,7 +680,7 @@ def test_serialize_workflow():
680
680
  "source_node_id": "9b619e4d-b0a7-4121-9060-100d457868cb",
681
681
  "source_handle_id": "7202f702-1ebc-4067-ab1e-ec67e49158ee",
682
682
  "target_node_id": "68c02b7c-5077-4087-803d-841474a8081f",
683
- "target_handle_id": "1dc4eebe-b6db-4229-96e5-115ff8cedb76",
683
+ "target_handle_id": "6d2c998b-1525-475f-9327-d8495b5e2692",
684
684
  "type": "DEFAULT",
685
685
  },
686
686
  {
@@ -688,7 +688,7 @@ def test_serialize_workflow():
688
688
  "source_node_id": "9b619e4d-b0a7-4121-9060-100d457868cb",
689
689
  "source_handle_id": "cf45705d-1a47-43a6-9d24-a7fdf78baae0",
690
690
  "target_node_id": "8df781b1-ff28-48a5-98a2-d7d796b932b0",
691
- "target_handle_id": "b73c39be-cbfe-4225-86e6-e6e4c161881e",
691
+ "target_handle_id": "4584996a-4c1e-45d0-8f49-6918d69b755e",
692
692
  "type": "DEFAULT",
693
693
  },
694
694
  {
@@ -696,7 +696,7 @@ def test_serialize_workflow():
696
696
  "source_node_id": "9b619e4d-b0a7-4121-9060-100d457868cb",
697
697
  "source_handle_id": "f04610dd-61cf-41b0-b337-2235e101cdb0",
698
698
  "target_node_id": "ed7caf01-9ae7-47a3-b15a-16697abaf486",
699
- "target_handle_id": "76fe7aec-5cd4-4c1a-b386-cfe09ebe66e4",
699
+ "target_handle_id": "8da86a9b-0d22-442c-b622-63afe1b569ab",
700
700
  "type": "DEFAULT",
701
701
  },
702
702
  {
@@ -704,7 +704,7 @@ def test_serialize_workflow():
704
704
  "source_node_id": "9b619e4d-b0a7-4121-9060-100d457868cb",
705
705
  "source_handle_id": "f9dde637-ea90-465f-a871-caf8380ae377",
706
706
  "target_node_id": "148c61bd-e8b0-4d4b-8734-b043a72b90ed",
707
- "target_handle_id": "c88839af-3a79-4310-abbd-e1553d981dce",
707
+ "target_handle_id": "f81bbac8-d7f1-4bfd-95ec-9d0b93e28114",
708
708
  "type": "DEFAULT",
709
709
  },
710
710
  {
@@ -123,7 +123,7 @@ def test_serialize_workflow(vellum_client):
123
123
  "source_node_id": "f1e4678f-c470-400b-a40e-c8922cc99a86",
124
124
  "source_handle_id": "40201804-8beb-43ad-8873-a027759512f1",
125
125
  "target_node_id": "c2ed23f7-f6cb-4a56-a91c-2e5f9d8fda7f",
126
- "target_handle_id": "b7bfb298-959a-4d2b-8b85-bbd0d2522703",
126
+ "target_handle_id": "9d3a1b3d-4a38-4f2e-bbf1-dd8be152bce8",
127
127
  "type": "DEFAULT",
128
128
  },
129
129
  {
@@ -140,9 +140,12 @@ def test_serialize_workflow():
140
140
  "name": "StartNode",
141
141
  "module": ["tests", "workflows", "basic_inline_subworkflow", "workflow"],
142
142
  },
143
- "trigger": {"id": "a95a34f2-e894-4fb6-a2c9-15d12c1e3135", "merge_behavior": "AWAIT_ANY"},
143
+ "trigger": {
144
+ "id": "a95a34f2-e894-4fb6-a2c9-15d12c1e3135",
145
+ "merge_behavior": "AWAIT_ATTRIBUTES",
146
+ },
144
147
  "ports": [
145
- {"id": "4a62dea3-6a4a-4390-88d8-4af5d2c81474", "type": "DEFAULT", "name": "default"}
148
+ {"id": "1e739e86-a285-4438-9725-a152c15a63e3", "type": "DEFAULT", "name": "default"}
146
149
  ],
147
150
  "adornments": None,
148
151
  "attributes": [
@@ -271,7 +274,7 @@ def test_serialize_workflow():
271
274
  "source_node_id": "afa49a0f-db35-4552-9217-5b8f237e84bc",
272
275
  "source_handle_id": "9914a6a0-9a99-430d-8ddd-f7c13847fe1a",
273
276
  "target_node_id": "1381c078-efa2-4255-89a1-7b4cb742c7fc",
274
- "target_handle_id": "6492efcf-4437-4af1-9ad7-269795ccb27a",
277
+ "target_handle_id": "a95a34f2-e894-4fb6-a2c9-15d12c1e3135",
275
278
  "type": "DEFAULT",
276
279
  },
277
280
  {
@@ -129,9 +129,12 @@ def test_serialize_workflow():
129
129
  "name": "Iteration",
130
130
  "module": ["tests", "workflows", "basic_map_node", "workflow"],
131
131
  },
132
- "trigger": {"id": "01324747-9bc0-4ecd-a8ab-40dca5a94e2e", "merge_behavior": "AWAIT_ANY"},
132
+ "trigger": {
133
+ "id": "01324747-9bc0-4ecd-a8ab-40dca5a94e2e",
134
+ "merge_behavior": "AWAIT_ATTRIBUTES",
135
+ },
133
136
  "ports": [
134
- {"id": "36791877-95b0-4390-a794-10accd8f548e", "type": "DEFAULT", "name": "default"}
137
+ {"id": "71ada606-d791-4a59-a252-0795c5faeeaf", "type": "DEFAULT", "name": "default"}
135
138
  ],
136
139
  "adornments": None,
137
140
  "attributes": [
@@ -211,7 +214,7 @@ def test_serialize_workflow():
211
214
  "source_node_id": "ff9bfe6e-839d-4d40-b8fc-313b3bbd0ab0",
212
215
  "source_handle_id": "520d3616-8369-4e79-9da5-3febae299c2a",
213
216
  "target_node_id": "baf6d316-dc75-41e8-96c0-015aede96309",
214
- "target_handle_id": "551d5528-f4e1-42ea-bde0-9de4b4968253",
217
+ "target_handle_id": "01324747-9bc0-4ecd-a8ab-40dca5a94e2e",
215
218
  "type": "DEFAULT",
216
219
  },
217
220
  {
@@ -145,7 +145,7 @@ def test_serialize_workflow__await_all():
145
145
  "source_node_id": "dc8aecd0-49ba-4464-a45f-29d3bfd686e4",
146
146
  "source_handle_id": "017d40f5-8326-4e42-a409-b08995defaa8",
147
147
  "target_node_id": "59243c65-053f-4ea6-9157-3f3edb1477bf",
148
- "target_handle_id": "e622fe61-3bca-4aff-86e1-25dad7bdf9d4",
148
+ "target_handle_id": "75293c10-d6d8-4fc0-afae-ba6437af982e",
149
149
  "type": "DEFAULT",
150
150
  },
151
151
  {
@@ -153,7 +153,7 @@ def test_serialize_workflow__await_all():
153
153
  "source_node_id": "dc8aecd0-49ba-4464-a45f-29d3bfd686e4",
154
154
  "source_handle_id": "017d40f5-8326-4e42-a409-b08995defaa8",
155
155
  "target_node_id": "127ef456-91bc-43c6-bd8b-1772db5e3cb5",
156
- "target_handle_id": "e5cc41cb-71db-43ec-b3f0-c78706af3351",
156
+ "target_handle_id": "10c7392f-7dc0-4273-8380-ddc3497e6072",
157
157
  "type": "DEFAULT",
158
158
  },
159
159
  {
@@ -177,7 +177,7 @@ def test_serialize_workflow__await_all():
177
177
  "source_node_id": "37c10e8a-771b-432b-a767-31f5007851f0",
178
178
  "source_handle_id": "3bbc469f-0fb0-4b3d-a28b-746fefec2818",
179
179
  "target_node_id": "634f0202-9ea9-4c62-b152-1a58c595cffb",
180
- "target_handle_id": "acd48f48-54fb-4b2b-ab37-96d336f6dfb3",
180
+ "target_handle_id": "c0c993cd-1370-480b-b175-59590735aa46",
181
181
  "type": "DEFAULT",
182
182
  },
183
183
  {
@@ -1,7 +1,32 @@
1
- from typing import Any, TypeVar
1
+ from typing import TYPE_CHECKING, Any
2
2
 
3
+ from vellum.client.types.logical_operator import LogicalOperator
3
4
  from vellum.client.types.vellum_variable_type import VellumVariableType
4
5
  from vellum.workflows.descriptors.base import BaseDescriptor
6
+ from vellum.workflows.expressions.and_ import AndExpression
7
+ from vellum.workflows.expressions.begins_with import BeginsWithExpression
8
+ from vellum.workflows.expressions.between import BetweenExpression
9
+ from vellum.workflows.expressions.contains import ContainsExpression
10
+ from vellum.workflows.expressions.does_not_begin_with import DoesNotBeginWithExpression
11
+ from vellum.workflows.expressions.does_not_contain import DoesNotContainExpression
12
+ from vellum.workflows.expressions.does_not_end_with import DoesNotEndWithExpression
13
+ from vellum.workflows.expressions.does_not_equal import DoesNotEqualExpression
14
+ from vellum.workflows.expressions.ends_with import EndsWithExpression
15
+ from vellum.workflows.expressions.equals import EqualsExpression
16
+ from vellum.workflows.expressions.greater_than import GreaterThanExpression
17
+ from vellum.workflows.expressions.greater_than_or_equal_to import GreaterThanOrEqualToExpression
18
+ from vellum.workflows.expressions.in_ import InExpression
19
+ from vellum.workflows.expressions.is_nil import IsNilExpression
20
+ from vellum.workflows.expressions.is_not_nil import IsNotNilExpression
21
+ from vellum.workflows.expressions.is_not_null import IsNotNullExpression
22
+ from vellum.workflows.expressions.is_not_undefined import IsNotUndefinedExpression
23
+ from vellum.workflows.expressions.is_null import IsNullExpression
24
+ from vellum.workflows.expressions.is_undefined import IsUndefinedExpression
25
+ from vellum.workflows.expressions.less_than import LessThanExpression
26
+ from vellum.workflows.expressions.less_than_or_equal_to import LessThanOrEqualToExpression
27
+ from vellum.workflows.expressions.not_between import NotBetweenExpression
28
+ from vellum.workflows.expressions.not_in import NotInExpression
29
+ from vellum.workflows.expressions.or_ import OrExpression
5
30
  from vellum.workflows.nodes.displayable.bases.utils import primitive_to_vellum_value
6
31
  from vellum.workflows.references import OutputReference, WorkflowInputReference
7
32
  from vellum.workflows.references.execution_count import ExecutionCountReference
@@ -9,7 +34,6 @@ from vellum.workflows.references.node import NodeReference
9
34
  from vellum.workflows.references.vellum_secret import VellumSecretReference
10
35
  from vellum.workflows.utils.vellum_variables import primitive_type_to_vellum_variable_type
11
36
  from vellum.workflows.vellum_client import create_vellum_client
12
- from vellum_ee.workflows.display.types import WorkflowDisplayContext
13
37
  from vellum_ee.workflows.display.vellum import (
14
38
  ConstantValuePointer,
15
39
  ExecutionCounterData,
@@ -23,7 +47,8 @@ from vellum_ee.workflows.display.vellum import (
23
47
  WorkspaceSecretPointer,
24
48
  )
25
49
 
26
- _T = TypeVar("_T")
50
+ if TYPE_CHECKING:
51
+ from vellum_ee.workflows.display.types import WorkflowDisplayContext
27
52
 
28
53
 
29
54
  def infer_vellum_variable_type(value: Any) -> VellumVariableType:
@@ -47,7 +72,7 @@ def infer_vellum_variable_type(value: Any) -> VellumVariableType:
47
72
 
48
73
 
49
74
  def create_node_input_value_pointer_rule(
50
- value: Any, display_context: WorkflowDisplayContext
75
+ value: Any, display_context: "WorkflowDisplayContext"
51
76
  ) -> NodeInputValuePointerRule:
52
77
  if isinstance(value, OutputReference):
53
78
  upstream_node, output_display = display_context.global_node_output_displays[value]
@@ -82,3 +107,48 @@ def create_node_input_value_pointer_rule(
82
107
  return ConstantValuePointer(type="CONSTANT_VALUE", data=vellum_value)
83
108
 
84
109
  raise ValueError(f"Unsupported descriptor type: {value.__class__.__name__}")
110
+
111
+
112
+ def convert_descriptor_to_operator(descriptor: BaseDescriptor) -> LogicalOperator:
113
+ if isinstance(descriptor, EqualsExpression):
114
+ return "="
115
+ elif isinstance(descriptor, DoesNotEqualExpression):
116
+ return "!="
117
+ elif isinstance(descriptor, LessThanExpression):
118
+ return "<"
119
+ elif isinstance(descriptor, GreaterThanExpression):
120
+ return ">"
121
+ elif isinstance(descriptor, LessThanOrEqualToExpression):
122
+ return "<="
123
+ elif isinstance(descriptor, GreaterThanOrEqualToExpression):
124
+ return ">="
125
+ elif isinstance(descriptor, ContainsExpression):
126
+ return "contains"
127
+ elif isinstance(descriptor, BeginsWithExpression):
128
+ return "beginsWith"
129
+ elif isinstance(descriptor, EndsWithExpression):
130
+ return "endsWith"
131
+ elif isinstance(descriptor, DoesNotContainExpression):
132
+ return "doesNotContain"
133
+ elif isinstance(descriptor, DoesNotBeginWithExpression):
134
+ return "doesNotBeginWith"
135
+ elif isinstance(descriptor, DoesNotEndWithExpression):
136
+ return "doesNotEndWith"
137
+ elif isinstance(descriptor, (IsNullExpression, IsNilExpression, IsUndefinedExpression)):
138
+ return "null"
139
+ elif isinstance(descriptor, (IsNotNullExpression, IsNotNilExpression, IsNotUndefinedExpression)):
140
+ return "notNull"
141
+ elif isinstance(descriptor, InExpression):
142
+ return "in"
143
+ elif isinstance(descriptor, NotInExpression):
144
+ return "notIn"
145
+ elif isinstance(descriptor, BetweenExpression):
146
+ return "between"
147
+ elif isinstance(descriptor, NotBetweenExpression):
148
+ return "notBetween"
149
+ elif isinstance(descriptor, AndExpression):
150
+ return "and"
151
+ elif isinstance(descriptor, OrExpression):
152
+ return "or"
153
+ else:
154
+ raise ValueError(f"Unsupported descriptor type: {descriptor}")
@@ -11,7 +11,7 @@ from vellum.workflows.descriptors.base import BaseDescriptor
11
11
  from vellum.workflows.edges import Edge
12
12
  from vellum.workflows.expressions.coalesce_expression import CoalesceExpression
13
13
  from vellum.workflows.nodes.bases import BaseNode
14
- from vellum.workflows.nodes.utils import get_wrapped_node, has_wrapped_node
14
+ from vellum.workflows.nodes.utils import get_wrapped_node
15
15
  from vellum.workflows.ports import Port
16
16
  from vellum.workflows.references import OutputReference, WorkflowInputReference
17
17
  from vellum.workflows.types.core import JsonObject
@@ -138,19 +138,18 @@ class BaseWorkflowDisplay(
138
138
  ):
139
139
  """This method recursively adds nodes wrapped in decorators to the node_output_displays dictionary."""
140
140
 
141
+ inner_node = get_wrapped_node(node)
142
+ if inner_node:
143
+ inner_node_display = self._get_node_display(inner_node)
144
+ self._enrich_global_node_output_displays(inner_node, inner_node_display, node_output_displays)
145
+
141
146
  for node_output in node.Outputs:
142
147
  if node_output in node_output_displays:
143
148
  continue
144
149
 
145
- if has_wrapped_node(node):
146
- inner_node = get_wrapped_node(node)
147
- if inner_node._is_wrapped_node:
148
- inner_node_display = self._get_node_display(inner_node)
149
- self._enrich_global_node_output_displays(inner_node, inner_node_display, node_output_displays)
150
-
151
150
  # TODO: Make sure this output ID matches the workflow output ID of the subworkflow node's workflow
152
151
  # https://app.shortcut.com/vellum/story/5660/fix-output-id-in-subworkflow-nodes
153
- node_output_displays[node_output] = node, node_display.get_node_output_display(node_output)
152
+ node_output_displays[node_output] = node_display.get_node_output_display(node_output)
154
153
 
155
154
  def _enrich_node_port_displays(
156
155
  self,
@@ -160,16 +159,15 @@ class BaseWorkflowDisplay(
160
159
  ):
161
160
  """This method recursively adds nodes wrapped in decorators to the port_displays dictionary."""
162
161
 
162
+ inner_node = get_wrapped_node(node)
163
+ if inner_node:
164
+ inner_node_display = self._get_node_display(inner_node)
165
+ self._enrich_node_port_displays(inner_node, inner_node_display, port_displays)
166
+
163
167
  for port in node.Ports:
164
168
  if port in port_displays:
165
169
  continue
166
170
 
167
- if has_wrapped_node(node):
168
- inner_node = get_wrapped_node(node)
169
- if inner_node._is_wrapped_node:
170
- inner_node_display = self._get_node_display(inner_node)
171
- self._enrich_node_port_displays(inner_node, inner_node_display, port_displays)
172
-
173
171
  port_displays[port] = node_display.get_node_port_display(port)
174
172
 
175
173
  def _get_node_display(self, node: Type[BaseNode]) -> NodeDisplayType:
@@ -209,20 +207,20 @@ class BaseWorkflowDisplay(
209
207
  # TODO: We should still serialize nodes that are in the workflow's directory but aren't used in the graph.
210
208
  # https://app.shortcut.com/vellum/story/5394
211
209
  for node in self._workflow.get_nodes():
212
- if node in global_node_displays:
213
- continue
214
210
  node_display = self._get_node_display(node)
215
- node_displays[node] = node_display
216
- global_node_displays[node] = node_display
211
+
212
+ if node not in node_displays:
213
+ node_displays[node] = node_display
214
+
215
+ if node not in global_node_displays:
216
+ global_node_displays[node] = node_display
217
217
 
218
218
  # Nodes wrapped in a decorator need to be in our node display dictionary for later retrieval
219
- if has_wrapped_node(node):
220
- inner_node = get_wrapped_node(node)
219
+ inner_node = get_wrapped_node(node)
220
+ if inner_node:
221
221
  inner_node_display = self._get_node_display(inner_node)
222
-
223
- if inner_node._is_wrapped_node:
224
- node_displays[inner_node] = inner_node_display
225
- global_node_displays[inner_node] = inner_node_display
222
+ node_displays[inner_node] = inner_node_display
223
+ global_node_displays[inner_node] = inner_node_display
226
224
 
227
225
  self._enrich_global_node_output_displays(node, node_display, global_node_output_displays)
228
226
  self._enrich_node_port_displays(node, node_display, port_displays)