LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
fix: WF execution created before WF async call (#883)
Chandrasekharan M1bf253f7138e
diff --git a/backend/api_v2/deployment_helper.py b/backend/api_v2/deployment_helper.pyindex ceaef536d..3a17d8350 100644--- a/backend/api_v2/deployment_helper.py+++ b/backend/api_v2/deployment_helper.py@@ -1,5 +1,4 @@import logging-import uuidfrom typing import Any, Optionalfrom urllib.parse import urlencode@@ -24,7 +23,8 @@ from workflow_manager.endpoint_v2.destination import DestinationConnectorfrom workflow_manager.endpoint_v2.source import SourceConnectorfrom workflow_manager.workflow_v2.dto import ExecutionResponsefrom workflow_manager.workflow_v2.enums import ExecutionStatus-from workflow_manager.workflow_v2.models.workflow import Workflow+from workflow_manager.workflow_v2.execution import WorkflowExecutionServiceHelper+from workflow_manager.workflow_v2.models import Workflow, WorkflowExecutionfrom workflow_manager.workflow_v2.workflow_helper import WorkflowHelperlogger = logging.getLogger(__name__)@@ -152,7 +152,12 @@ class DeploymentHelper(BaseAPIKeyValidator):"""workflow_id = api.workflow.idpipeline_id = api.id- execution_id = str(uuid.uuid4())+ workflow_execution = WorkflowExecutionServiceHelper.create_workflow_execution(+ workflow_id=workflow_id,+ pipeline_id=pipeline_id,+ mode=WorkflowExecution.Mode.QUEUE,+ )+ execution_id = workflow_execution.idhash_values_of_files = SourceConnector.add_input_file_to_api_storage(workflow_id=workflow_id,diff --git a/backend/workflow_manager/workflow_v2/workflow_helper.py b/backend/workflow_manager/workflow_v2/workflow_helper.pyindex 8df5fc575..3a119e875 100644--- a/backend/workflow_manager/workflow_v2/workflow_helper.py+++ b/backend/workflow_manager/workflow_v2/workflow_helper.py@@ -465,8 +465,12 @@ class WorkflowHelper:WorkflowExecutionServiceHelper.update_execution_err(execution_id, str(error))- logger.error(f"Errors while job enqueueing {str(error)}")- logger.error(f"Error {traceback.format_exc()}")+ logger.error(+ f"Error while enqueuing async job for WF '{workflow_id}', "+ f"execution '{execution_id}': {str(error)}",+ exc_info=True,+ stack_info=True,+ )return ExecutionResponse(workflow_id,execution_id,