vellum-workflow-server 1.1.2__py3-none-any.whl → 1.1.2.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.
- {vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/METADATA +1 -1
- {vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/RECORD +7 -7
- workflow_server/api/workflow_view.py +13 -0
- workflow_server/core/executor.py +33 -2
- workflow_server/core/workflow_executor_context.py +1 -0
- {vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/WHEEL +0 -0
- {vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/entry_points.txt +0 -0
{vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/RECORD
RENAMED
|
@@ -6,15 +6,15 @@ 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=UxOwN9J3tI2YEXCGKsyMf890NiPnTNo0Rxyeidmx3oY,18620
|
|
8
8
|
workflow_server/api/tests/test_workflow_view_stream_workflow_route.py,sha256=7q5AiBzfXX-npCrp-Da2OWk6-M1Ai8QZPDLhLlkxb34,26051
|
|
9
|
-
workflow_server/api/workflow_view.py,sha256=
|
|
9
|
+
workflow_server/api/workflow_view.py,sha256=i19Ksgg_2EbPhPRAlwYRqmAKI_8VHvAGc61Q9k90Iow,21189
|
|
10
10
|
workflow_server/code_exec_runner.py,sha256=lBnMIorPZL8zZBye6TjeCIs06WTJM7P2HR07B1fjJJI,2533
|
|
11
11
|
workflow_server/config.py,sha256=DyTty8NrAwvtx-esM3KthnpsNh-nKdWNlovWQOgiGpg,1417
|
|
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
|
|
15
|
+
workflow_server/core/executor.py,sha256=68AINc5SlmJTrb0vvDxiPgc-qqgX1oVCKKKrVCKzfPQ,18046
|
|
16
16
|
workflow_server/core/utils.py,sha256=lgzxkAEjEXPxGXXQlUYTYuCdHht-eDJJmHj5AhEb3_o,1500
|
|
17
|
-
workflow_server/core/workflow_executor_context.py,sha256=
|
|
17
|
+
workflow_server/core/workflow_executor_context.py,sha256=SMbCRhYsjrxnlEUZ2lJg2WqnhxDBrZzlQwjpqnBzbOg,1538
|
|
18
18
|
workflow_server/server.py,sha256=QBU12AaAfAgLqfCDBd24qIJl_mbheiq0-hfcWV7rZM4,1234
|
|
19
19
|
workflow_server/start.py,sha256=qpIg0SgIgz8RNyc8Cu9LxyzXdOXZRv9qq3M3uSBbgD0,2180
|
|
20
20
|
workflow_server/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -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=qwK5Rmy3RQyjtlUrYAuGuDlBeRzZKsf1yS-y2IpUizQ,6452
|
|
30
30
|
workflow_server/utils/utils.py,sha256=Wqqn-1l2ugkGgy5paWWdt0AVxAyPMQCYcnRSSOMjXlA,4355
|
|
31
|
-
vellum_workflow_server-1.1.2.dist-info/METADATA,sha256=
|
|
32
|
-
vellum_workflow_server-1.1.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
33
|
-
vellum_workflow_server-1.1.2.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
|
|
34
|
-
vellum_workflow_server-1.1.2.dist-info/RECORD,,
|
|
31
|
+
vellum_workflow_server-1.1.2.post1.dist-info/METADATA,sha256=6fJa1OW8XEwsBnu6axLZTDNzRiXkP_AoZAhonFZt3Yo,2273
|
|
32
|
+
vellum_workflow_server-1.1.2.post1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
33
|
+
vellum_workflow_server-1.1.2.post1.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
|
|
34
|
+
vellum_workflow_server-1.1.2.post1.dist-info/RECORD,,
|
|
@@ -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(
|
workflow_server/core/executor.py
CHANGED
|
@@ -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
|
-
|
|
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:
|
{vellum_workflow_server-1.1.2.dist-info → vellum_workflow_server-1.1.2.post1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|