vellum-workflow-server 1.6.4.post2__py3-none-any.whl → 1.6.4.post3__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.

Potentially problematic release.


This version of vellum-workflow-server might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-workflow-server
3
- Version: 1.6.4.post2
3
+ Version: 1.6.4.post3
4
4
  Summary:
5
5
  License: AGPL
6
6
  Requires-Python: >=3.9.0,<4
@@ -5,7 +5,7 @@ workflow_server/api/healthz_view.py,sha256=itiRvBDBXncrw8Kbbc73UZLwqMAhgHOR3uSre
5
5
  workflow_server/api/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  workflow_server/api/tests/test_input_display_mapping.py,sha256=drBZqMudFyB5wgiUOcMgRXz7E7ge-Qgxbstw4E4f0zE,2211
7
7
  workflow_server/api/tests/test_workflow_view.py,sha256=d46UNMZUJbIKLiTJkjIsVpgqCJMwCe4LL6RjFkfx_Y4,29178
8
- workflow_server/api/tests/test_workflow_view_stream_workflow_route.py,sha256=FaEIgGsbq8M7ZF2opVjBdGCYeRPF_vqsUhFTruLInxA,31358
8
+ workflow_server/api/tests/test_workflow_view_stream_workflow_route.py,sha256=VXQMBNhXl6J-MIjk7UYzmfiafAi3KWu_1WF5XMWhFwE,33807
9
9
  workflow_server/api/workflow_view.py,sha256=pqqgeQMVU3YjozjP26Q_f9qSsL_pjkpOQctsq_xwHfE,20447
10
10
  workflow_server/code_exec_runner.py,sha256=5uTjHJ231aX6vMwPKRvLcQdbsIxhjTsGMk8G0MEnasU,2152
11
11
  workflow_server/config.py,sha256=qmmTr6ty3ZN5LDOFs3TfUxYshYe6Mmn_LanplHHeE9Q,1796
@@ -28,7 +28,7 @@ workflow_server/utils/tests/test_sentry_integration.py,sha256=LGmWiaLhFrx-jslrRj
28
28
  workflow_server/utils/tests/test_system_utils.py,sha256=_4GwXvVvU5BrATxUEWwQIPg0bzQXMWBtiBmjP8MTxJM,4314
29
29
  workflow_server/utils/tests/test_utils.py,sha256=0Nq6du8o-iBtTrip9_wgHES53JSiJbVdSXaBnPobw3s,6930
30
30
  workflow_server/utils/utils.py,sha256=ZPoM1Suhid22dpB8oEFLux8wx-9iyzmSfWuYxSCrgWk,4774
31
- vellum_workflow_server-1.6.4.post2.dist-info/METADATA,sha256=NQOzPqJUMupffF4wb8lRMqZaBK7dtiAW4WBZbmM8Ccg,2273
32
- vellum_workflow_server-1.6.4.post2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- vellum_workflow_server-1.6.4.post2.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
34
- vellum_workflow_server-1.6.4.post2.dist-info/RECORD,,
31
+ vellum_workflow_server-1.6.4.post3.dist-info/METADATA,sha256=7d6od1WTHcO1fc9dUNwtNdylX6i5FeiPayryxPVZNR8,2273
32
+ vellum_workflow_server-1.6.4.post3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
+ vellum_workflow_server-1.6.4.post3.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
34
+ vellum_workflow_server-1.6.4.post3.dist-info/RECORD,,
@@ -1031,3 +1031,72 @@ class Workflow(BaseWorkflow):
1031
1031
  assert len(event_names) == 2, "Should include 2 events"
1032
1032
  assert "workflow.execution.initiated" in event_names, "Should include workflow.execution.initiated event"
1033
1033
  assert "workflow.execution.fulfilled" in event_names, "Should include workflow.execution.fulfilled event"
1034
+
1035
+
1036
+ def test_stream_workflow_route__with_invalid_nested_set_graph(both_stream_types):
1037
+ """
1038
+ Tests that a workflow with an invalid nested set graph structure raises a clear error in the stream response.
1039
+ """
1040
+ # GIVEN a Flask application and invalid workflow content with nested set graph
1041
+ span_id = uuid4()
1042
+
1043
+ invalid_workflow_content = """
1044
+ from vellum.workflows import BaseWorkflow
1045
+ from vellum.workflows.nodes import BaseNode
1046
+
1047
+ class TestNode(BaseNode):
1048
+ class Outputs(BaseNode.Outputs):
1049
+ value = "test"
1050
+
1051
+ class InvalidWorkflow(BaseWorkflow):
1052
+ graph = {TestNode, {TestNode}}
1053
+
1054
+ class Outputs(BaseWorkflow.Outputs):
1055
+ result = TestNode.Outputs.value
1056
+ """
1057
+
1058
+ request_body = {
1059
+ "timeout": 360,
1060
+ "execution_id": str(span_id),
1061
+ "inputs": [],
1062
+ "environment_api_key": "test",
1063
+ "module": "workflow",
1064
+ "files": {
1065
+ "__init__.py": "",
1066
+ "workflow.py": invalid_workflow_content,
1067
+ },
1068
+ }
1069
+
1070
+ # WHEN we call the stream route
1071
+ status_code, events = both_stream_types(request_body)
1072
+
1073
+ # THEN we get a 200 response
1074
+ assert status_code == 200, events
1075
+
1076
+ # THEN we get the expected events: vembda initiated, workflow initiated, workflow rejected, vembda fulfilled
1077
+ assert len(events) == 4
1078
+
1079
+ # AND the first event should be vembda execution initiated
1080
+ assert events[0]["name"] == "vembda.execution.initiated"
1081
+ assert events[0]["span_id"] == str(span_id)
1082
+
1083
+ # AND the second event should be workflow execution initiated
1084
+ assert events[1]["name"] == "workflow.execution.initiated"
1085
+
1086
+ # AND the third event should be workflow execution rejected
1087
+ assert events[2]["name"] == "workflow.execution.rejected"
1088
+ assert events[1]["span_id"] == events[2]["span_id"]
1089
+
1090
+ # AND the error message should contain information about the invalid graph structure
1091
+ error_message = events[2]["body"]["error"]["message"]
1092
+ expected_message = (
1093
+ "Failed to initialize workflow: Invalid graph structure detected. "
1094
+ "Nested sets or unsupported graph types are not allowed. "
1095
+ "Please contact Vellum support for assistance with Workflow configuration."
1096
+ )
1097
+ assert error_message == expected_message
1098
+
1099
+ # AND the fourth event should be vembda execution fulfilled
1100
+ assert events[3]["name"] == "vembda.execution.fulfilled"
1101
+ assert events[3]["span_id"] == str(span_id)
1102
+ assert events[3]["body"]["exit_code"] == 0