LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
missing organization_id in statestore for worker (#1308)
alib80afd58f913
diff --git a/backend/workflow_manager/workflow_v2/file_execution_tasks.py b/backend/workflow_manager/workflow_v2/file_execution_tasks.pyindex 5098c72d8..4ccb66a51 100644--- a/backend/workflow_manager/workflow_v2/file_execution_tasks.py+++ b/backend/workflow_manager/workflow_v2/file_execution_tasks.py@@ -2,6 +2,7 @@ import loggingfrom typing import Anyfrom uuid import UUID+from account_v2.constants import Commonfrom plugins.workflow_manager.workflow_v2.utils import WorkflowUtilfrom tool_instance_v2.constants import ToolInstanceKeyfrom tool_instance_v2.models import ToolInstance@@ -130,7 +131,11 @@ class FileExecutionTasks:workflow_id = file_data.workflow_id# Reconstruct necessary objectsworkflow = FileExecutionTasks.get_workflow_by_id(str(workflow_id))- workflow_execution = WorkflowExecution.objects.get(id=UUID(execution_id))+ workflow_execution: WorkflowExecution = WorkflowExecution.objects.get(+ id=UUID(execution_id)+ )+ log_events_id = workflow_execution.execution_log_id+ StateStore.set(Common.LOG_EVENTS_ID, log_events_id)total_files = len(file_batch_data.files)q_file_no_list = (@@ -212,6 +217,8 @@ class FileExecutionTasks:organization = workflow.organizationorganization_id = organization.organization_idpipeline_id = str(workflow_execution.pipeline_id)+ log_events_id = workflow_execution.execution_log_id+ StateStore.set(Common.LOG_EVENTS_ID, log_events_id)# Set organization ID in StateStoreStateStore.set(Account.ORGANIZATION_ID, organization_id)diff --git a/backend/workflow_manager/workflow_v2/workflow_helper.py b/backend/workflow_manager/workflow_v2/workflow_helper.pyindex 30a2f1cdf..414a20440 100644--- a/backend/workflow_manager/workflow_v2/workflow_helper.py+++ b/backend/workflow_manager/workflow_v2/workflow_helper.py@@ -710,11 +710,13 @@ class WorkflowHelper:or workflow_execution.execution_type != WorkflowExecution.Type.COMPLETE):raise InvalidRequest(WorkflowErrors.INVALID_EXECUTION_ID)+ organization_identifier = UserContext.get_organization_identifier()return WorkflowHelper.run_workflow(workflow=workflow,workflow_execution=workflow_execution,hash_values_of_files=hash_values_of_files,use_file_history=use_file_history,+ organization_id=organization_identifier,)except WorkflowExecution.DoesNotExist:return WorkflowHelper.create_and_make_execution_response(