vellum-workflow-server 1.9.0.post1__tar.gz → 1.9.0.post2__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.
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/PKG-INFO +1 -1
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/pyproject.toml +1 -1
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/executor.py +17 -37
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/workflow_executor_context.py +1 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/README.md +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/auth_middleware.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/healthz_view.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/status_view.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/tests/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/tests/test_input_display_mapping.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/tests/test_workflow_view.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/tests/test_workflow_view_stream_workflow_route.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/api/workflow_view.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/code_exec_runner.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/config.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/cancel_workflow.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/events.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/core/utils.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/logging_config.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/server.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/start.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/exit_handler.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/log_proxy.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/oom_killer.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/sentry.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/system_utils.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/tests/__init__.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/tests/test_sentry_integration.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/tests/test_system_utils.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/tests/test_utils.py +0 -0
- {vellum_workflow_server-1.9.0.post1 → vellum_workflow_server-1.9.0.post2}/src/workflow_server/utils/utils.py +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
import importlib
|
|
3
2
|
from io import StringIO
|
|
4
3
|
import json
|
|
5
4
|
import logging
|
|
@@ -32,6 +31,7 @@ from vellum.workflows.resolvers.base import BaseWorkflowResolver
|
|
|
32
31
|
from vellum.workflows.resolvers.resolver import VellumResolver
|
|
33
32
|
from vellum.workflows.state.context import WorkflowContext
|
|
34
33
|
from vellum.workflows.state.store import EmptyStore
|
|
34
|
+
from vellum.workflows.triggers import BaseTrigger
|
|
35
35
|
from vellum.workflows.types import CancelSignal
|
|
36
36
|
from vellum.workflows.workflows.event_filters import workflow_sandbox_event_filter
|
|
37
37
|
from workflow_server.config import LOCAL_DEPLOYMENT, LOCAL_WORKFLOW_MODULE
|
|
@@ -150,7 +150,21 @@ def stream_workflow(
|
|
|
150
150
|
cancel_watcher_kill_switch = ThreadingEvent()
|
|
151
151
|
try:
|
|
152
152
|
workflow, namespace = _create_workflow(executor_context)
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
trigger_id = executor_context.trigger_id
|
|
155
|
+
|
|
156
|
+
inputs_or_trigger = workflow.deserialize_trigger(trigger_id=trigger_id, inputs=executor_context.inputs)
|
|
157
|
+
|
|
158
|
+
# Determine whether we have inputs or a trigger
|
|
159
|
+
if isinstance(inputs_or_trigger, BaseInputs):
|
|
160
|
+
workflow_inputs = inputs_or_trigger
|
|
161
|
+
trigger = None
|
|
162
|
+
elif isinstance(inputs_or_trigger, BaseTrigger):
|
|
163
|
+
workflow_inputs = None
|
|
164
|
+
trigger = inputs_or_trigger
|
|
165
|
+
else:
|
|
166
|
+
workflow_inputs = None
|
|
167
|
+
trigger = None
|
|
154
168
|
|
|
155
169
|
workflow_state = (
|
|
156
170
|
workflow.deserialize_state(
|
|
@@ -176,6 +190,7 @@ def stream_workflow(
|
|
|
176
190
|
entrypoint_nodes=[executor_context.node_id] if executor_context.node_id else None,
|
|
177
191
|
previous_execution_id=executor_context.previous_execution_id,
|
|
178
192
|
timeout=executor_context.timeout,
|
|
193
|
+
trigger=trigger,
|
|
179
194
|
)
|
|
180
195
|
except WorkflowInitializationException as e:
|
|
181
196
|
cancel_watcher_kill_switch.set()
|
|
@@ -473,38 +488,3 @@ def _dump_event(event: BaseEvent, executor_context: BaseExecutorContext) -> dict
|
|
|
473
488
|
dump["body"]["node_definition"]["module"] = module_base + dump["body"]["node_definition"]["module"][1:]
|
|
474
489
|
|
|
475
490
|
return dump
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
def _get_workflow_inputs(
|
|
479
|
-
executor_context: BaseExecutorContext, workflow_class: Type[BaseWorkflow]
|
|
480
|
-
) -> Optional[BaseInputs]:
|
|
481
|
-
if not executor_context.inputs:
|
|
482
|
-
return None
|
|
483
|
-
|
|
484
|
-
if not executor_context.files.get("inputs.py"):
|
|
485
|
-
return None
|
|
486
|
-
|
|
487
|
-
namespace = _get_file_namespace(executor_context)
|
|
488
|
-
inputs_module_path = f"{namespace}.inputs"
|
|
489
|
-
try:
|
|
490
|
-
inputs_module = importlib.import_module(inputs_module_path)
|
|
491
|
-
except Exception as e:
|
|
492
|
-
raise WorkflowInitializationException(
|
|
493
|
-
message=f"Failed to initialize workflow inputs: {e}",
|
|
494
|
-
workflow_definition=workflow_class,
|
|
495
|
-
) from e
|
|
496
|
-
|
|
497
|
-
if not hasattr(inputs_module, "Inputs"):
|
|
498
|
-
raise WorkflowInitializationException(
|
|
499
|
-
message=f"Inputs module {inputs_module_path} does not have a required Inputs class",
|
|
500
|
-
workflow_definition=workflow_class,
|
|
501
|
-
)
|
|
502
|
-
|
|
503
|
-
if not issubclass(inputs_module.Inputs, BaseInputs):
|
|
504
|
-
raise WorkflowInitializationException(
|
|
505
|
-
message=f"""The class {inputs_module_path}.Inputs was expected to be a subclass of BaseInputs, \
|
|
506
|
-
but found {inputs_module.Inputs.__class__.__name__}""",
|
|
507
|
-
workflow_definition=workflow_class,
|
|
508
|
-
)
|
|
509
|
-
|
|
510
|
-
return inputs_module.Inputs(**executor_context.inputs)
|
|
@@ -36,6 +36,7 @@ class BaseExecutorContext(UniversalBaseModel):
|
|
|
36
36
|
previous_execution_id: Optional[UUID] = None
|
|
37
37
|
feature_flags: Optional[dict[str, bool]] = None
|
|
38
38
|
is_new_server: bool = False
|
|
39
|
+
trigger_id: Optional[UUID] = None
|
|
39
40
|
|
|
40
41
|
@field_validator("inputs", mode="before")
|
|
41
42
|
@classmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|