vellum-workflow-server 1.1.1__tar.gz → 1.1.2.post1__tar.gz

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.

Files changed (33) hide show
  1. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/PKG-INFO +2 -2
  2. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/pyproject.toml +2 -2
  3. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/workflow_view.py +13 -0
  4. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/executor.py +33 -2
  5. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/workflow_executor_context.py +1 -0
  6. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/README.md +0 -0
  7. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/__init__.py +0 -0
  8. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/__init__.py +0 -0
  9. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/auth_middleware.py +0 -0
  10. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/healthz_view.py +0 -0
  11. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/tests/__init__.py +0 -0
  12. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
  13. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
  14. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +0 -0
  15. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/code_exec_runner.py +0 -0
  16. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/config.py +0 -0
  17. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/__init__.py +0 -0
  18. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/cancel_workflow.py +0 -0
  19. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/events.py +0 -0
  20. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/core/utils.py +0 -0
  21. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/server.py +0 -0
  22. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/start.py +0 -0
  23. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/__init__.py +0 -0
  24. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/exit_handler.py +0 -0
  25. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/log_proxy.py +0 -0
  26. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/oom_killer.py +0 -0
  27. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/sentry.py +0 -0
  28. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/system_utils.py +0 -0
  29. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/tests/__init__.py +0 -0
  30. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
  31. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
  32. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/tests/test_utils.py +0 -0
  33. {vellum_workflow_server-1.1.1 → vellum_workflow_server-1.1.2.post1}/src/workflow_server/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-workflow-server
3
- Version: 1.1.1
3
+ Version: 1.1.2.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.1.1)
32
+ Requires-Dist: vellum-ai (==1.1.2)
33
33
  Description-Content-Type: text/markdown
34
34
 
35
35
  # Vellum Workflow Runner Server
@@ -3,7 +3,7 @@ name = "vellum-workflow-server"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "vellum-workflow-server"
6
- version = "1.1.1"
6
+ version = "1.1.2.post1"
7
7
  description = ""
8
8
  readme = "README.md"
9
9
  authors = []
@@ -45,7 +45,7 @@ flask = "2.3.3"
45
45
  orderly-set = "5.2.2"
46
46
  pebble = "5.0.7"
47
47
  gunicorn = "23.0.0"
48
- vellum-ai = "1.1.1"
48
+ vellum-ai = "1.1.2"
49
49
  python-dotenv = "1.0.1"
50
50
  retrying = "1.3.4"
51
51
  sentry-sdk = {extras = ["flask"], version = "2.20.0"}
@@ -61,6 +61,17 @@ CUSTOM_NODES_DIRECTORY = "vellum_custom_nodes"
61
61
  WORKFLOW_INITIATION_TIMEOUT_SECONDS = 60
62
62
 
63
63
 
64
+ def _events_emission_enabled(context: Union[WorkflowExecutorContext, NodeExecutorContext]) -> bool:
65
+ flags = context.feature_flags
66
+ if not (flags and flags.get("vembda-event-emitting-enabled")):
67
+ return False
68
+ try:
69
+ module = importlib.import_module("vellum.workflows.events.emitters.vellum")
70
+ return hasattr(module, "VellumEmitter")
71
+ except Exception:
72
+ return False
73
+
74
+
64
75
  @bp.route("/stream", methods=["POST"])
65
76
  def stream_workflow_route() -> Response:
66
77
  data = request.get_json()
@@ -97,6 +108,7 @@ def stream_workflow_route() -> Response:
97
108
  headers = {
98
109
  "X-Vellum-SDK-Version": vembda_initiated_event.body.sdk_version,
99
110
  "X-Vellum-Server-Version": vembda_initiated_event.body.server_version,
111
+ "X-Vellum-Events-Emitted": str(_events_emission_enabled(context)),
100
112
  }
101
113
 
102
114
  # We can exceed the concurrency count currently with long running workflows due to a knative issue. So here
@@ -403,6 +415,7 @@ def stream_node_route() -> Response:
403
415
  headers = {
404
416
  "X-Vellum-SDK-Version": vembda_initiated_event.body.sdk_version,
405
417
  "X-Vellum-Server-Version": vembda_initiated_event.body.server_version,
418
+ "X-Vellum-Events-Emitted": str(_events_emission_enabled(context)),
406
419
  }
407
420
 
408
421
  resp = Response(
@@ -12,7 +12,7 @@ from threading import Event as ThreadingEvent
12
12
  import time
13
13
  from traceback import format_exc
14
14
  from uuid import UUID, uuid4
15
- from typing import Any, Callable, Generator, Iterator, Optional, Tuple, Type
15
+ from typing import TYPE_CHECKING, Any, Callable, Generator, Iterator, Optional, Tuple, Type
16
16
 
17
17
  from pebble import concurrent
18
18
  from vellum_ee.workflows.display.workflows import BaseWorkflowDisplay
@@ -47,6 +47,15 @@ from workflow_server.core.workflow_executor_context import (
47
47
  )
48
48
  from workflow_server.utils.log_proxy import redirect_log
49
49
 
50
+ if TYPE_CHECKING:
51
+ # Imported for typing only to avoid runtime dependency issues
52
+ from vellum.workflows.events.emitters.base import BaseWorkflowEmitter
53
+
54
+ try:
55
+ from vellum.workflows.events.emitters.vellum import VellumEmitter as _VellumEmitter
56
+ except Exception:
57
+ _VellumEmitter = None
58
+
50
59
  logger = logging.getLogger(__name__)
51
60
 
52
61
 
@@ -331,13 +340,35 @@ def _create_workflow(executor_context: WorkflowExecutorContext, namespace: str)
331
340
  VembdaExecutionFulfilledEvent.model_rebuild(
332
341
  # Not sure why this is needed, but it is required for the VembdaExecutionFulfilledEvent to be
333
342
  # properly rebuilt with the recursive types.
343
+ # use flag here to determine which emitter to use
334
344
  _types_namespace={
335
345
  "BaseWorkflow": BaseWorkflow,
336
346
  "BaseNode": BaseNode,
337
347
  },
338
348
  )
339
349
 
340
- return Workflow(context=workflow_context, store=EmptyStore())
350
+ # Determine whether to enable the Vellum Emitter for event publishing
351
+ use_vellum_emitter = bool((executor_context.feature_flags or {}).get("vembda-event-emitting-enabled"))
352
+
353
+ emitters: list["BaseWorkflowEmitter"] = []
354
+ if use_vellum_emitter:
355
+ if _VellumEmitter is not None:
356
+ try:
357
+ emitters = [_VellumEmitter()]
358
+ except Exception:
359
+ emitters = []
360
+ else:
361
+ # Emitter is not available at import time; continue without it
362
+ logger.warning("VellumEmitter not available; continuing without it")
363
+
364
+ # Explicit constructor call to satisfy typing
365
+ workflow = Workflow(
366
+ context=workflow_context,
367
+ store=EmptyStore(),
368
+ emitters=emitters or None,
369
+ )
370
+
371
+ return workflow
341
372
 
342
373
 
343
374
  def _create_workflow_context(executor_context: BaseExecutorContext) -> WorkflowContext:
@@ -24,6 +24,7 @@ class BaseExecutorContext(UniversalBaseModel):
24
24
  vembda_public_url: Optional[str] = None
25
25
  node_output_mocks: Optional[list[Any]] = None
26
26
  environment_variables: Optional[dict[str, str]] = None
27
+ feature_flags: Optional[dict[str, bool]] = None
27
28
 
28
29
  @property
29
30
  def container_overhead_latency(self) -> int: