Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

fix: Removed assert on task ID NULL, (#1147)

Chandrasekharan Mf96dedcb6a2e
diff --git a/backend/workflow_manager/workflow_v2/execution.py b/backend/workflow_manager/workflow_v2/execution.py
index 770f9e8d4..2464200c5 100644
--- a/backend/workflow_manager/workflow_v2/execution.py
+++ b/backend/workflow_manager/workflow_v2/execution.py
@@ -415,9 +415,11 @@ class WorkflowExecutionServiceHelper(WorkflowExecutionService):
@staticmethod
def update_execution_task(execution_id: str, task_id: str) -> None:
try:
- assert (
- task_id is not None
- ), f"task_id is NULL for execution_id: {execution_id}"
+ if not task_id:
+ logger.warning(
+ f"task_id: '{task_id}' is NULL / empty for "
+ f"execution_id: {execution_id}, expected to have a UUID"
+ )
execution = WorkflowExecution.objects.get(pk=execution_id)
# TODO: Review if status should be updated to EXECUTING
execution.task_id = task_id
diff --git a/backend/workflow_manager/workflow_v2/workflow_helper.py b/backend/workflow_manager/workflow_v2/workflow_helper.py
index d6643289d..f4c8a8582 100644
--- a/backend/workflow_manager/workflow_v2/workflow_helper.py
+++ b/backend/workflow_manager/workflow_v2/workflow_helper.py
@@ -752,18 +752,21 @@ class WorkflowHelper:
)
return response
else:
- execution_result = WorkflowHelper.execute_bin(
- schema_name=org_schema,
+ task_id = current_task.request.id
+ # TODO: Remove this if scheduled runs work
+ StateStore.set(Account.ORGANIZATION_ID, org_schema)
+ execution_result = WorkflowHelper.execute_workflow(
+ organization_id=org_schema,
+ task_id=task_id,
workflow_id=workflow.id,
execution_id=workflow_execution.id,
hash_values_of_files=hash_values_of_files,
scheduled=True,
execution_mode=execution_mode,
pipeline_id=pipeline_id,
- log_events_id=log_events_id,
use_file_history=use_file_history,
+ log_events_id=log_events_id,
)
-
updated_execution = WorkflowExecution.objects.get(id=execution_id)
execution_response = ExecutionResponse(
workflow.id,