vellum-workflow-server 1.4.0.post1__py3-none-any.whl → 1.4.1.post1__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.4.0.post1
3
+ Version: 1.4.1.post1
4
4
  Summary:
5
5
  License: AGPL
6
6
  Requires-Python: >=3.9.0,<4
@@ -29,7 +29,7 @@ Requires-Dist: pyjwt (==2.10.0)
29
29
  Requires-Dist: python-dotenv (==1.0.1)
30
30
  Requires-Dist: retrying (==1.3.4)
31
31
  Requires-Dist: sentry-sdk[flask] (==2.20.0)
32
- Requires-Dist: vellum-ai (==1.4.0)
32
+ Requires-Dist: vellum-ai (==1.4.1)
33
33
  Description-Content-Type: text/markdown
34
34
 
35
35
  # Vellum Workflow Runner Server
@@ -6,13 +6,13 @@ workflow_server/api/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
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=RlAw1tHeIlnOXGrFQN-w3EOLPZkhp6Dfy6d1r7kU5oc,22573
8
8
  workflow_server/api/tests/test_workflow_view_stream_workflow_route.py,sha256=Qo8u6mPyRCmE2jamY1yIh8l44hgo4-Nwlq03z61ND5g,27031
9
- workflow_server/api/workflow_view.py,sha256=4XaBbhzQte4bRbbUPhrqAXDBXTXoc67Twzr1Pp5bPpw,21800
9
+ workflow_server/api/workflow_view.py,sha256=_WhjNgimTPoS10C-npRWDfJixzg4eHTJ5xIKACStZf4,21943
10
10
  workflow_server/code_exec_runner.py,sha256=lBnMIorPZL8zZBye6TjeCIs06WTJM7P2HR07B1fjJJI,2533
11
11
  workflow_server/config.py,sha256=qmmTr6ty3ZN5LDOFs3TfUxYshYe6Mmn_LanplHHeE9Q,1796
12
12
  workflow_server/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  workflow_server/core/cancel_workflow.py,sha256=Ffkc3mzmrdMEUcD-sHfEhX4IwVrka-E--SxKA1dUfIU,2185
14
14
  workflow_server/core/events.py,sha256=24MA66DVQuaLJJcZrS8IL1Zq4Ohi9CoouKZ5VgoH3Cs,1402
15
- workflow_server/core/executor.py,sha256=srpxx2xkjAE0QNBo1sfQV6Ovwyq3tWQdjicTySxSrpc,18092
15
+ workflow_server/core/executor.py,sha256=bNryNvXBbg7IHW3BFzzFaGoCO1rGufeEE4FrY9TDA90,18294
16
16
  workflow_server/core/utils.py,sha256=aIpSINstLGslP2PIoDLM82_1GlJ1uC_0AIrP-V7Yobo,3230
17
17
  workflow_server/core/workflow_executor_context.py,sha256=w3OhV_AXpgh7AxpjEsc0vo-IJypgJcgr5DXJCqGptOU,1587
18
18
  workflow_server/server.py,sha256=QBU12AaAfAgLqfCDBd24qIJl_mbheiq0-hfcWV7rZM4,1234
@@ -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.4.0.post1.dist-info/METADATA,sha256=fY2l-73g7b-QbDRuJzHYfA40CIhE3t5o6CaXCdidCKI,2273
32
- vellum_workflow_server-1.4.0.post1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
- vellum_workflow_server-1.4.0.post1.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
34
- vellum_workflow_server-1.4.0.post1.dist-info/RECORD,,
31
+ vellum_workflow_server-1.4.1.post1.dist-info/METADATA,sha256=sXR0B1bNZZvRQswy2hK4IqACrHG67fw6XLErZfqRoRE,2273
32
+ vellum_workflow_server-1.4.1.post1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
33
+ vellum_workflow_server-1.4.1.post1.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
34
+ vellum_workflow_server-1.4.1.post1.dist-info/RECORD,,
@@ -23,6 +23,7 @@ from vellum_ee.workflows.display.types import WorkflowDisplayContext
23
23
  from vellum_ee.workflows.display.workflows import BaseWorkflowDisplay
24
24
  from vellum_ee.workflows.server.virtual_file_loader import VirtualFileFinder
25
25
 
26
+ from vellum.workflows import BaseWorkflow
26
27
  from vellum.workflows.exceptions import WorkflowInitializationException
27
28
  from vellum.workflows.nodes import BaseNode
28
29
  from workflow_server.config import ENABLE_PROCESS_WRAPPER, MEMORY_LIMIT_MB
@@ -458,7 +459,10 @@ def serialize_route() -> Response:
458
459
  try:
459
460
  result = BaseWorkflowDisplay.serialize_module(namespace, client=client)
460
461
  except Exception as e:
461
- raise WorkflowInitializationException(str(e)) from e
462
+ raise WorkflowInitializationException(
463
+ message=str(e),
464
+ workflow_definition=BaseWorkflow,
465
+ ) from e
462
466
 
463
467
  return Response(
464
468
  json.dumps(result.model_dump()),
@@ -174,7 +174,7 @@ def stream_workflow(
174
174
  cancel_signal: Optional[ThreadingEvent] = None,
175
175
  ) -> tuple[Iterator[dict], UUID]:
176
176
  workflow, namespace = _gather_workflow(executor_context)
177
- workflow_inputs = _get_workflow_inputs(executor_context)
177
+ workflow_inputs = _get_workflow_inputs(executor_context, workflow.__class__)
178
178
  display_context = _gather_display_context(workflow, namespace)
179
179
  workflow_state = (
180
180
  workflow.deserialize_state(
@@ -258,21 +258,18 @@ def stream_node(
258
258
  executor_context: NodeExecutorContext,
259
259
  disable_redirect: bool = True,
260
260
  ) -> Iterator[dict]:
261
- namespace = _get_file_namespace(executor_context)
262
-
263
261
  def call_node() -> Generator[dict[str, Any], Any, None]:
264
- sys.meta_path.append(VirtualFileFinder(executor_context.files, namespace))
265
- workflow_context = _create_workflow_context(executor_context)
262
+ workflow, namespace = _gather_workflow(executor_context)
266
263
  node_module = importlib.import_module(f"{namespace}.{executor_context.node_module}")
267
264
 
268
265
  Node = getattr(node_module, executor_context.node_name)
269
266
 
270
- workflow_inputs = _get_workflow_inputs(executor_context)
267
+ workflow_inputs = _get_workflow_inputs(executor_context, workflow.__class__)
271
268
  workflow_state = _get_workflow_state(executor_context, workflow_inputs=workflow_inputs)
272
269
 
273
270
  node = Node(
274
271
  state=workflow_state,
275
- context=workflow_context,
272
+ context=workflow._context,
276
273
  )
277
274
 
278
275
  executor_context.stream_start_time = time.time_ns()
@@ -339,7 +336,7 @@ def _call_stream(
339
336
  yield vembda_fulfilled_event.model_dump(mode="json")
340
337
 
341
338
 
342
- def _create_workflow(executor_context: WorkflowExecutorContext, namespace: str) -> BaseWorkflow:
339
+ def _create_workflow(executor_context: BaseExecutorContext, namespace: str) -> BaseWorkflow:
343
340
  workflow_context = _create_workflow_context(executor_context)
344
341
  Workflow = BaseWorkflow.load_from_module(namespace)
345
342
  VembdaExecutionFulfilledEvent.model_rebuild(
@@ -431,7 +428,9 @@ def _dump_event(event: BaseEvent, executor_context: BaseExecutorContext, client:
431
428
  return dump
432
429
 
433
430
 
434
- def _get_workflow_inputs(executor_context: BaseExecutorContext) -> Optional[BaseInputs]:
431
+ def _get_workflow_inputs(
432
+ executor_context: BaseExecutorContext, workflow_class: Type[BaseWorkflow]
433
+ ) -> Optional[BaseInputs]:
435
434
  if not executor_context.inputs:
436
435
  return None
437
436
 
@@ -443,17 +442,22 @@ def _get_workflow_inputs(executor_context: BaseExecutorContext) -> Optional[Base
443
442
  try:
444
443
  inputs_module = importlib.import_module(inputs_module_path)
445
444
  except Exception as e:
446
- raise WorkflowInitializationException(f"Failed to initialize workflow inputs: {e}") from e
445
+ raise WorkflowInitializationException(
446
+ message=f"Failed to initialize workflow inputs: {e}",
447
+ workflow_definition=workflow_class,
448
+ ) from e
447
449
 
448
450
  if not hasattr(inputs_module, "Inputs"):
449
451
  raise WorkflowInitializationException(
450
- f"Inputs module {inputs_module_path} does not have a required Inputs class"
452
+ message=f"Inputs module {inputs_module_path} does not have a required Inputs class",
453
+ workflow_definition=workflow_class,
451
454
  )
452
455
 
453
456
  if not issubclass(inputs_module.Inputs, BaseInputs):
454
457
  raise WorkflowInitializationException(
455
- f"""The class {inputs_module_path}.Inputs was expected to be a subclass of BaseInputs, \
456
- but found {inputs_module.Inputs.__class__.__name__}"""
458
+ message=f"""The class {inputs_module_path}.Inputs was expected to be a subclass of BaseInputs, \
459
+ but found {inputs_module.Inputs.__class__.__name__}""",
460
+ workflow_definition=workflow_class,
457
461
  )
458
462
 
459
463
  return inputs_module.Inputs(**executor_context.inputs)
@@ -493,7 +497,7 @@ def _get_run_from_node(executor_context: WorkflowExecutorContext, workflow: Base
493
497
  return None
494
498
 
495
499
 
496
- def _gather_workflow(context: WorkflowExecutorContext) -> Tuple[BaseWorkflow, str]:
500
+ def _gather_workflow(context: BaseExecutorContext) -> Tuple[BaseWorkflow, str]:
497
501
  try:
498
502
  namespace = _get_file_namespace(context)
499
503
  if namespace != LOCAL_WORKFLOW_MODULE:
@@ -505,7 +509,10 @@ def _gather_workflow(context: WorkflowExecutorContext) -> Tuple[BaseWorkflow, st
505
509
  return workflow, namespace
506
510
  except Exception as e:
507
511
  logger.exception("Failed to initialize Workflow")
508
- raise WorkflowInitializationException(f"Failed to initialize workflow: {e}") from e
512
+ raise WorkflowInitializationException(
513
+ message=f"Failed to initialize workflow: {e}",
514
+ workflow_definition=BaseWorkflow,
515
+ ) from e
509
516
 
510
517
 
511
518
  def _gather_display_context(workflow: BaseWorkflow, namespace: str) -> Optional["WorkflowEventDisplayContext"]: