vellum-ai 0.10.3__py3-none-any.whl → 0.10.6__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. vellum/client/core/client_wrapper.py +1 -1
  2. vellum/workflows/events/tests/test_event.py +30 -0
  3. vellum/workflows/events/types.py +57 -3
  4. vellum/workflows/nodes/__init__.py +6 -7
  5. vellum/workflows/nodes/bases/base.py +0 -1
  6. vellum/workflows/nodes/core/inline_subworkflow_node/node.py +2 -1
  7. vellum/workflows/nodes/core/map_node/node.py +1 -1
  8. vellum/workflows/nodes/core/retry_node/node.py +1 -0
  9. vellum/workflows/nodes/core/templating_node/node.py +5 -1
  10. vellum/workflows/nodes/core/try_node/node.py +66 -27
  11. vellum/workflows/nodes/core/try_node/tests/test_node.py +39 -8
  12. vellum/workflows/nodes/displayable/__init__.py +2 -0
  13. vellum/workflows/nodes/displayable/bases/api_node/node.py +3 -3
  14. vellum/workflows/nodes/displayable/code_execution_node/node.py +5 -2
  15. vellum/workflows/nodes/displayable/final_output_node/node.py +6 -2
  16. vellum/workflows/nodes/displayable/note_node/__init__.py +5 -0
  17. vellum/workflows/nodes/displayable/note_node/node.py +10 -0
  18. vellum/workflows/nodes/displayable/tests/test_inline_text_prompt_node.py +10 -11
  19. vellum/workflows/nodes/utils.py +2 -0
  20. vellum/workflows/outputs/base.py +26 -2
  21. vellum/workflows/runner/runner.py +41 -27
  22. vellum/workflows/state/tests/test_state.py +2 -0
  23. vellum/workflows/types/tests/test_utils.py +9 -0
  24. vellum/workflows/types/utils.py +1 -1
  25. vellum/workflows/utils/vellum_variables.py +13 -1
  26. vellum/workflows/workflows/base.py +24 -1
  27. {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/METADATA +8 -6
  28. {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/RECORD +61 -56
  29. vellum_cli/CONTRIBUTING.md +66 -0
  30. vellum_cli/README.md +3 -0
  31. vellum_ee/workflows/display/base.py +2 -1
  32. vellum_ee/workflows/display/nodes/base_node_display.py +27 -4
  33. vellum_ee/workflows/display/nodes/vellum/__init__.py +2 -0
  34. vellum_ee/workflows/display/nodes/vellum/api_node.py +3 -3
  35. vellum_ee/workflows/display/nodes/vellum/code_execution_node.py +4 -4
  36. vellum_ee/workflows/display/nodes/vellum/conditional_node.py +86 -41
  37. vellum_ee/workflows/display/nodes/vellum/guardrail_node.py +3 -3
  38. vellum_ee/workflows/display/nodes/vellum/inline_prompt_node.py +4 -5
  39. vellum_ee/workflows/display/nodes/vellum/inline_subworkflow_node.py +9 -9
  40. vellum_ee/workflows/display/nodes/vellum/map_node.py +5 -5
  41. vellum_ee/workflows/display/nodes/vellum/note_node.py +32 -0
  42. vellum_ee/workflows/display/nodes/vellum/prompt_deployment_node.py +5 -5
  43. vellum_ee/workflows/display/nodes/vellum/search_node.py +6 -10
  44. vellum_ee/workflows/display/nodes/vellum/subworkflow_deployment_node.py +2 -2
  45. vellum_ee/workflows/display/nodes/vellum/templating_node.py +4 -5
  46. vellum_ee/workflows/display/nodes/vellum/try_node.py +16 -4
  47. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_code_execution_node_serialization.py +7 -3
  48. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_conditional_node_serialization.py +127 -101
  49. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_guardrail_node_serialization.py +6 -5
  50. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_inline_subworkflow_serialization.py +77 -64
  51. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_map_node_serialization.py +4 -3
  52. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_prompt_deployment_serialization.py +6 -6
  53. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_subworkflow_deployment_serialization.py +6 -6
  54. vellum_ee/workflows/display/tests/workflow_serialization/test_basic_terminal_node_serialization.py +4 -3
  55. vellum_ee/workflows/display/tests/workflow_serialization/test_complex_terminal_node_serialization.py +7 -6
  56. vellum_ee/workflows/display/workflows/base_workflow_display.py +14 -9
  57. vellum_ee/workflows/display/workflows/get_vellum_workflow_display_class.py +2 -7
  58. vellum_ee/workflows/display/workflows/vellum_workflow_display.py +18 -16
  59. {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/LICENSE +0 -0
  60. {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/WHEEL +0 -0
  61. {vellum_ai-0.10.3.dist-info → vellum_ai-0.10.6.dist-info}/entry_points.txt +0 -0
@@ -3,17 +3,6 @@ from unittest import mock
3
3
 
4
4
  from deepdiff import DeepDiff
5
5
 
6
- from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
7
- from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import (
8
- create_simple_workflow,
9
- )
10
- from vellum_ee.workflows.display.nodes.base_node_vellum_display import (
11
- BaseNodeVellumDisplay,
12
- )
13
- from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
14
- from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import (
15
- get_workflow_display,
16
- )
17
6
  from vellum.workflows.expressions.begins_with import BeginsWithExpression
18
7
  from vellum.workflows.expressions.between import BetweenExpression
19
8
  from vellum.workflows.expressions.contains import ContainsExpression
@@ -36,6 +25,18 @@ from vellum.workflows.expressions.less_than_or_equal_to import (
36
25
  )
37
26
  from vellum.workflows.expressions.not_between import NotBetweenExpression
38
27
  from vellum.workflows.expressions.not_in import NotInExpression
28
+ from vellum_ee.workflows.display.nodes.base_node_vellum_display import (
29
+ BaseNodeVellumDisplay,
30
+ )
31
+ from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
32
+ from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import (
33
+ get_workflow_display,
34
+ )
35
+
36
+ from tests.workflows.basic_conditional_node.workflow import CategoryWorkflow
37
+ from tests.workflows.basic_conditional_node.workflow_with_only_one_conditional_node import (
38
+ create_simple_workflow,
39
+ )
39
40
 
40
41
 
41
42
  def test_serialize_workflow():
@@ -67,9 +68,9 @@ def test_serialize_workflow():
67
68
  "id": "eece050a-432e-4a2c-8c87-9480397e4cbf",
68
69
  "key": "category",
69
70
  "type": "STRING",
70
- "required": None,
71
+ "required": True,
71
72
  "default": None,
72
- "extensions": None,
73
+ "extensions": {"color": None},
73
74
  },
74
75
  ],
75
76
  input_variables,
@@ -150,8 +151,8 @@ def test_serialize_workflow():
150
151
  "type": "CONDITIONAL",
151
152
  "inputs": [
152
153
  {
153
- "id": "eb8f9320-7030-45bc-81fb-fb45017b6a89",
154
- "key": "708bb538-4c77-4ae9-8e87-0706346e2947.field",
154
+ "id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
155
+ "key": "e0490a35-c863-422b-a12a-f18858d75241.field",
155
156
  "value": {
156
157
  "rules": [
157
158
  {
@@ -165,8 +166,8 @@ def test_serialize_workflow():
165
166
  },
166
167
  },
167
168
  {
168
- "id": "1fb4cf46-f8b3-418f-be30-f7ec57f92285",
169
- "key": "708bb538-4c77-4ae9-8e87-0706346e2947.value",
169
+ "id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
170
+ "key": "e0490a35-c863-422b-a12a-f18858d75241.value",
170
171
  "value": {
171
172
  "rules": [
172
173
  {
@@ -178,8 +179,8 @@ def test_serialize_workflow():
178
179
  },
179
180
  },
180
181
  {
181
- "id": "ca3a865e-e99a-43b7-a649-18df57180a4f",
182
- "key": "ddee5d1d-46e9-4ae8-b0a8-311747ebadd4.field",
182
+ "id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
183
+ "key": "f7818d41-3f66-42c7-8218-de5c30379906.field",
183
184
  "value": {
184
185
  "rules": [
185
186
  {
@@ -193,8 +194,8 @@ def test_serialize_workflow():
193
194
  },
194
195
  },
195
196
  {
196
- "id": "40957176-de6e-4131-bfa7-55c633312af0",
197
- "key": "ddee5d1d-46e9-4ae8-b0a8-311747ebadd4.value",
197
+ "id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
198
+ "key": "f7818d41-3f66-42c7-8218-de5c30379906.value",
198
199
  "value": {
199
200
  "rules": [
200
201
  {
@@ -206,8 +207,8 @@ def test_serialize_workflow():
206
207
  },
207
208
  },
208
209
  {
209
- "id": "9a685f10-f849-445b-9b26-f1a99e1bc625",
210
- "key": "73157578-205a-4816-8985-cf726063647c.field",
210
+ "id": "a593293c-9c17-45c5-8c99-fc867aad580e",
211
+ "key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.field",
211
212
  "value": {
212
213
  "rules": [
213
214
  {
@@ -221,8 +222,8 @@ def test_serialize_workflow():
221
222
  },
222
223
  },
223
224
  {
224
- "id": "93f06582-aff7-4ce5-8c60-f923090ffebc",
225
- "key": "73157578-205a-4816-8985-cf726063647c.value",
225
+ "id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
226
+ "key": "38483416-c474-4e50-bfbc-7e92de2b4c2c.value",
226
227
  "value": {
227
228
  "rules": [
228
229
  {
@@ -234,8 +235,8 @@ def test_serialize_workflow():
234
235
  },
235
236
  },
236
237
  {
237
- "id": "965010fa-5f14-4f3c-92cb-ede4fad35b92",
238
- "key": "e805add5-7f7f-443d-b9bc-11ad15eeb49c.field",
238
+ "id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
239
+ "key": "aa692069-9672-4adb-b874-74da98745f24.field",
239
240
  "value": {
240
241
  "rules": [
241
242
  {
@@ -249,8 +250,8 @@ def test_serialize_workflow():
249
250
  },
250
251
  },
251
252
  {
252
- "id": "e759091b-3609-4581-9014-5f46f438a4c9",
253
- "key": "e805add5-7f7f-443d-b9bc-11ad15eeb49c.value",
253
+ "id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
254
+ "key": "aa692069-9672-4adb-b874-74da98745f24.value",
254
255
  "value": {
255
256
  "rules": [
256
257
  {
@@ -262,8 +263,8 @@ def test_serialize_workflow():
262
263
  },
263
264
  },
264
265
  {
265
- "id": "6b592d70-93ab-4dcf-aeae-03834f37ef83",
266
- "key": "f47d72ff-665f-4143-ada3-6fa66f5bda42.field",
266
+ "id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
267
+ "key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.field",
267
268
  "value": {
268
269
  "rules": [
269
270
  {
@@ -277,8 +278,8 @@ def test_serialize_workflow():
277
278
  },
278
279
  },
279
280
  {
280
- "id": "e915cd85-ae55-48be-b31c-f2285db9db10",
281
- "key": "f47d72ff-665f-4143-ada3-6fa66f5bda42.value",
281
+ "id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
282
+ "key": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658.value",
282
283
  "value": {
283
284
  "rules": [
284
285
  {
@@ -290,8 +291,8 @@ def test_serialize_workflow():
290
291
  },
291
292
  },
292
293
  {
293
- "id": "deb43b7d-d084-4453-bed9-0f0b940d0639",
294
- "key": "d3359d60-9bb4-4c6e-8009-b7ea46ab28a7.field",
294
+ "id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
295
+ "key": "e59504e1-4134-46dc-8055-114c6a606af8.field",
295
296
  "value": {
296
297
  "rules": [
297
298
  {
@@ -305,8 +306,8 @@ def test_serialize_workflow():
305
306
  },
306
307
  },
307
308
  {
308
- "id": "e5d75ae4-cd46-437e-9695-9df2d79578b4",
309
- "key": "d3359d60-9bb4-4c6e-8009-b7ea46ab28a7.value",
309
+ "id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
310
+ "key": "e59504e1-4134-46dc-8055-114c6a606af8.value",
310
311
  "value": {
311
312
  "rules": [
312
313
  {
@@ -330,13 +331,13 @@ def test_serialize_workflow():
330
331
  "id": "2ccd0730-26d1-4fb4-baa9-1a2a182dd9a0",
331
332
  "rules": [
332
333
  {
333
- "id": "708bb538-4c77-4ae9-8e87-0706346e2947",
334
+ "id": "e0490a35-c863-422b-a12a-f18858d75241",
334
335
  "rules": None,
335
336
  "combinator": None,
336
337
  "negated": False,
337
- "field_node_input_id": "eb8f9320-7030-45bc-81fb-fb45017b6a89",
338
+ "field_node_input_id": "c99fb71e-a8ad-4627-b9a2-aa36bf1fdc02",
338
339
  "operator": "=",
339
- "value_node_input_id": "1fb4cf46-f8b3-418f-be30-f7ec57f92285",
340
+ "value_node_input_id": "7aaebb17-b670-4366-80f9-fb569c8f8f85",
340
341
  }
341
342
  ],
342
343
  "combinator": "AND",
@@ -354,13 +355,13 @@ def test_serialize_workflow():
354
355
  "id": "cc3f0d92-b603-42cc-b2e9-83e3b23b3bcb",
355
356
  "rules": [
356
357
  {
357
- "id": "ddee5d1d-46e9-4ae8-b0a8-311747ebadd4",
358
+ "id": "f7818d41-3f66-42c7-8218-de5c30379906",
358
359
  "rules": None,
359
360
  "combinator": None,
360
361
  "negated": False,
361
- "field_node_input_id": "ca3a865e-e99a-43b7-a649-18df57180a4f",
362
+ "field_node_input_id": "d8675161-1aa1-4f10-8b98-ea6384211c87",
362
363
  "operator": "=",
363
- "value_node_input_id": "40957176-de6e-4131-bfa7-55c633312af0",
364
+ "value_node_input_id": "4c77a541-9a13-41b2-b68e-ed1487d195d3",
364
365
  }
365
366
  ],
366
367
  "combinator": "AND",
@@ -378,13 +379,13 @@ def test_serialize_workflow():
378
379
  "id": "a5a0f391-7052-452f-9fe1-a5781a491591",
379
380
  "rules": [
380
381
  {
381
- "id": "73157578-205a-4816-8985-cf726063647c",
382
+ "id": "38483416-c474-4e50-bfbc-7e92de2b4c2c",
382
383
  "rules": None,
383
384
  "combinator": None,
384
385
  "negated": False,
385
- "field_node_input_id": "9a685f10-f849-445b-9b26-f1a99e1bc625",
386
+ "field_node_input_id": "a593293c-9c17-45c5-8c99-fc867aad580e",
386
387
  "operator": "=",
387
- "value_node_input_id": "93f06582-aff7-4ce5-8c60-f923090ffebc",
388
+ "value_node_input_id": "d9ea5424-44d5-481a-b769-3bce5ef6c353",
388
389
  }
389
390
  ],
390
391
  "combinator": "AND",
@@ -402,34 +403,34 @@ def test_serialize_workflow():
402
403
  "id": "efe7a851-2a67-4189-99ec-bc193242b270",
403
404
  "rules": [
404
405
  {
405
- "id": "e805add5-7f7f-443d-b9bc-11ad15eeb49c",
406
+ "id": "aa692069-9672-4adb-b874-74da98745f24",
406
407
  "rules": None,
407
408
  "combinator": None,
408
409
  "negated": False,
409
- "field_node_input_id": "965010fa-5f14-4f3c-92cb-ede4fad35b92",
410
+ "field_node_input_id": "2066a9e9-7a55-4ef0-8897-7df32e31f0e8",
410
411
  "operator": "=",
411
- "value_node_input_id": "e759091b-3609-4581-9014-5f46f438a4c9",
412
+ "value_node_input_id": "fbbef65b-0d3b-4a10-9479-ebe07b8e3a82",
412
413
  },
413
414
  {
414
415
  "id": "2c78817b-8b73-43fd-8dab-a8923018da9d",
415
416
  "rules": [
416
417
  {
417
- "id": "f47d72ff-665f-4143-ada3-6fa66f5bda42",
418
+ "id": "25aaa0ca-9312-49d7-9ad5-b6f40f8a0658",
418
419
  "rules": None,
419
420
  "combinator": None,
420
421
  "negated": False,
421
- "field_node_input_id": "6b592d70-93ab-4dcf-aeae-03834f37ef83",
422
+ "field_node_input_id": "3c1186a8-5a0f-4b6b-8637-9c09aea9c14d",
422
423
  "operator": "=",
423
- "value_node_input_id": "e915cd85-ae55-48be-b31c-f2285db9db10",
424
+ "value_node_input_id": "78e99399-ed5a-4d26-8a42-c4f355cf60e3",
424
425
  },
425
426
  {
426
- "id": "d3359d60-9bb4-4c6e-8009-b7ea46ab28a7",
427
+ "id": "e59504e1-4134-46dc-8055-114c6a606af8",
427
428
  "rules": None,
428
429
  "combinator": None,
429
430
  "negated": False,
430
- "field_node_input_id": "deb43b7d-d084-4453-bed9-0f0b940d0639",
431
+ "field_node_input_id": "5b7e4b08-68eb-471e-9eda-36c768f8eb46",
431
432
  "operator": "=",
432
- "value_node_input_id": "e5d75ae4-cd46-437e-9695-9df2d79578b4",
433
+ "value_node_input_id": "02d26ab6-8faa-4da3-84b1-190581a6fd66",
433
434
  },
434
435
  ],
435
436
  "combinator": "AND",
@@ -446,6 +447,12 @@ def test_serialize_workflow():
446
447
  "value_node_input_id": None,
447
448
  },
448
449
  },
450
+ {
451
+ "id": "c2fa8a44-923b-462a-b0d2-fa800a152e52",
452
+ "type": "ELSE",
453
+ "source_handle_id": "493024f4-8010-4e1a-abae-b6adbc6fb208",
454
+ "data": None,
455
+ },
449
456
  ],
450
457
  "version": "2",
451
458
  },
@@ -958,14 +965,15 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
958
965
 
959
966
  # AND the conditional node should be what we expect
960
967
  conditional_node = workflow_raw_data["nodes"][1]
968
+ print(conditional_node)
961
969
  assert not DeepDiff(
962
970
  {
963
971
  "id": "a9143814-6bb0-4cb3-a817-4fc076417121",
964
972
  "type": "CONDITIONAL",
965
973
  "inputs": [
966
974
  {
967
- "id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
968
- "key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
975
+ "id": "738a274f-962d-466e-9aee-7774d3e05ab9",
976
+ "key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
969
977
  "value": {
970
978
  "rules": [
971
979
  {
@@ -977,8 +985,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
977
985
  },
978
986
  },
979
987
  {
980
- "id": "aadade8a-c253-483a-8620-31fe8171c0fd",
981
- "key": "abe7afac-952f-4cfc-ab07-47b47f34105f.value",
988
+ "id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
989
+ "key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
982
990
  "value": {
983
991
  "rules": [
984
992
  {
@@ -1002,13 +1010,13 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
1002
1010
  "id": "650e7105-3e76-43ca-858f-b290970b438b",
1003
1011
  "rules": [
1004
1012
  {
1005
- "id": "abe7afac-952f-4cfc-ab07-47b47f34105f",
1013
+ "id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
1006
1014
  "rules": None,
1007
1015
  "combinator": None,
1008
1016
  "negated": False,
1009
- "field_node_input_id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
1017
+ "field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
1010
1018
  "operator": f"{operator}",
1011
- "value_node_input_id": "aadade8a-c253-483a-8620-31fe8171c0fd",
1019
+ "value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
1012
1020
  }
1013
1021
  ],
1014
1022
  "combinator": "AND",
@@ -1017,14 +1025,28 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
1017
1025
  "operator": None,
1018
1026
  "value_node_input_id": None,
1019
1027
  },
1020
- }
1028
+ },
1029
+ {
1030
+ "id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
1031
+ "type": "ELSE",
1032
+ "source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
1033
+ "data": None,
1034
+ },
1021
1035
  ],
1022
1036
  "version": "2",
1023
1037
  },
1024
1038
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
1025
1039
  "definition": {
1040
+ "name": "SimpleConditionalNode",
1041
+ "module": [
1042
+ "tests",
1043
+ "workflows",
1044
+ "basic_conditional_node",
1045
+ "workflow_with_only_one_conditional_node",
1046
+ ],
1026
1047
  "bases": [
1027
1048
  {
1049
+ "name": "ConditionalNode",
1028
1050
  "module": [
1029
1051
  "vellum",
1030
1052
  "workflows",
@@ -1033,16 +1055,8 @@ def test_conditional_node_serialize_all_operators_with_lhs_and_rhs(
1033
1055
  "conditional_node",
1034
1056
  "node",
1035
1057
  ],
1036
- "name": "ConditionalNode",
1037
1058
  }
1038
1059
  ],
1039
- "module": [
1040
- "tests",
1041
- "workflows",
1042
- "basic_conditional_node",
1043
- "workflow_with_only_one_conditional_node",
1044
- ],
1045
- "name": "SimpleConditionalNode",
1046
1060
  },
1047
1061
  },
1048
1062
  conditional_node,
@@ -1084,8 +1098,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
1084
1098
  "type": "CONDITIONAL",
1085
1099
  "inputs": [
1086
1100
  {
1087
- "id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
1088
- "key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
1101
+ "id": "738a274f-962d-466e-9aee-7774d3e05ab9",
1102
+ "key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
1089
1103
  "value": {
1090
1104
  "rules": [
1091
1105
  {
@@ -1109,13 +1123,13 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
1109
1123
  "id": "650e7105-3e76-43ca-858f-b290970b438b",
1110
1124
  "rules": [
1111
1125
  {
1112
- "id": "abe7afac-952f-4cfc-ab07-47b47f34105f",
1126
+ "id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
1113
1127
  "rules": None,
1114
1128
  "combinator": None,
1115
1129
  "negated": False,
1116
- "field_node_input_id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
1130
+ "field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
1117
1131
  "operator": f"{operator}",
1118
- "value_node_input_id": None,
1132
+ "value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
1119
1133
  }
1120
1134
  ],
1121
1135
  "combinator": "AND",
@@ -1124,14 +1138,28 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
1124
1138
  "operator": None,
1125
1139
  "value_node_input_id": None,
1126
1140
  },
1127
- }
1141
+ },
1142
+ {
1143
+ "id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
1144
+ "type": "ELSE",
1145
+ "source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
1146
+ "data": None,
1147
+ },
1128
1148
  ],
1129
1149
  "version": "2",
1130
1150
  },
1131
1151
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
1132
1152
  "definition": {
1153
+ "name": "SimpleConditionalNode",
1154
+ "module": [
1155
+ "tests",
1156
+ "workflows",
1157
+ "basic_conditional_node",
1158
+ "workflow_with_only_one_conditional_node",
1159
+ ],
1133
1160
  "bases": [
1134
1161
  {
1162
+ "name": "ConditionalNode",
1135
1163
  "module": [
1136
1164
  "vellum",
1137
1165
  "workflows",
@@ -1140,16 +1168,8 @@ def test_conditional_node_serialize_all_operators_with_expression(descriptor, op
1140
1168
  "conditional_node",
1141
1169
  "node",
1142
1170
  ],
1143
- "name": "ConditionalNode",
1144
1171
  }
1145
1172
  ],
1146
- "module": [
1147
- "tests",
1148
- "workflows",
1149
- "basic_conditional_node",
1150
- "workflow_with_only_one_conditional_node",
1151
- ],
1152
- "name": "SimpleConditionalNode",
1153
1173
  },
1154
1174
  },
1155
1175
  conditional_node,
@@ -1195,8 +1215,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
1195
1215
  "type": "CONDITIONAL",
1196
1216
  "inputs": [
1197
1217
  {
1198
- "id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
1199
- "key": "abe7afac-952f-4cfc-ab07-47b47f34105f.field",
1218
+ "id": "738a274f-962d-466e-9aee-7774d3e05ab9",
1219
+ "key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.field",
1200
1220
  "value": {
1201
1221
  "rules": [
1202
1222
  {
@@ -1208,8 +1228,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
1208
1228
  },
1209
1229
  },
1210
1230
  {
1211
- "id": "aadade8a-c253-483a-8620-31fe8171c0fd",
1212
- "key": "abe7afac-952f-4cfc-ab07-47b47f34105f.value",
1231
+ "id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
1232
+ "key": "f497b2bf-7d35-43af-b162-ced2d8abd46f.value",
1213
1233
  "value": {
1214
1234
  "rules": [
1215
1235
  {
@@ -1233,13 +1253,13 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
1233
1253
  "id": "650e7105-3e76-43ca-858f-b290970b438b",
1234
1254
  "rules": [
1235
1255
  {
1236
- "id": "abe7afac-952f-4cfc-ab07-47b47f34105f",
1256
+ "id": "f497b2bf-7d35-43af-b162-ced2d8abd46f",
1237
1257
  "rules": None,
1238
1258
  "combinator": None,
1239
1259
  "negated": False,
1240
- "field_node_input_id": "2262b7b4-a2f2-408b-9d4d-362940ca1ed3",
1260
+ "field_node_input_id": "738a274f-962d-466e-9aee-7774d3e05ab9",
1241
1261
  "operator": f"{operator}",
1242
- "value_node_input_id": "aadade8a-c253-483a-8620-31fe8171c0fd",
1262
+ "value_node_input_id": "f30bceb4-39bf-433a-9229-b6871dbdbe00",
1243
1263
  }
1244
1264
  ],
1245
1265
  "combinator": "AND",
@@ -1248,14 +1268,28 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
1248
1268
  "operator": None,
1249
1269
  "value_node_input_id": None,
1250
1270
  },
1251
- }
1271
+ },
1272
+ {
1273
+ "id": "342e5497-ea2b-4e5c-99cf-e6492f133a3c",
1274
+ "type": "ELSE",
1275
+ "source_handle_id": "4df924c0-7bed-4f4a-9db4-2bfe51841755",
1276
+ "data": None,
1277
+ },
1252
1278
  ],
1253
1279
  "version": "2",
1254
1280
  },
1255
1281
  "display_data": {"position": {"x": 0.0, "y": 0.0}},
1256
1282
  "definition": {
1283
+ "name": "SimpleConditionalNode",
1284
+ "module": [
1285
+ "tests",
1286
+ "workflows",
1287
+ "basic_conditional_node",
1288
+ "workflow_with_only_one_conditional_node",
1289
+ ],
1257
1290
  "bases": [
1258
1291
  {
1292
+ "name": "ConditionalNode",
1259
1293
  "module": [
1260
1294
  "vellum",
1261
1295
  "workflows",
@@ -1264,16 +1298,8 @@ def test_conditional_node_serialize_all_operators_with_value_and_start_and_end(
1264
1298
  "conditional_node",
1265
1299
  "node",
1266
1300
  ],
1267
- "name": "ConditionalNode",
1268
1301
  }
1269
1302
  ],
1270
- "module": [
1271
- "tests",
1272
- "workflows",
1273
- "basic_conditional_node",
1274
- "workflow_with_only_one_conditional_node",
1275
- ],
1276
- "name": "SimpleConditionalNode",
1277
1303
  },
1278
1304
  },
1279
1305
  conditional_node,
@@ -1,9 +1,10 @@
1
1
  from deepdiff import DeepDiff
2
2
 
3
- from tests.workflows.basic_guardrail_node.workflow import BasicGuardrailNodeWorkflow
4
3
  from vellum_ee.workflows.display.workflows import VellumWorkflowDisplay
5
4
  from vellum_ee.workflows.display.workflows.get_vellum_workflow_display_class import get_workflow_display
6
5
 
6
+ from tests.workflows.basic_guardrail_node.workflow import BasicGuardrailNodeWorkflow
7
+
7
8
 
8
9
  def test_serialize_workflow():
9
10
  # GIVEN a workflow that uses a guardrail node
@@ -26,17 +27,17 @@ def test_serialize_workflow():
26
27
  "id": "eb1b1913-9fb8-4b8c-8901-09d9b9edc1c3",
27
28
  "key": "actual",
28
29
  "type": "STRING",
29
- "required": None,
30
+ "required": True,
30
31
  "default": None,
31
- "extensions": None,
32
+ "extensions": { "color": None },
32
33
  },
33
34
  {
34
35
  "id": "545ff95e-e86f-4d06-a991-602781e72605",
35
36
  "key": "expected",
36
37
  "type": "STRING",
37
- "required": None,
38
+ "required": True,
38
39
  "default": None,
39
- "extensions": None,
40
+ "extensions": { "color": None },
40
41
  },
41
42
  ],
42
43
  input_variables,