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: Truncate error message before storing in DB (#673)
Chandrasekharan Mf2c559e96789
diff --git a/backend/workflow_manager/workflow/execution.py b/backend/workflow_manager/workflow/execution.pyindex bbdb89be6..c388c71c4 100644--- a/backend/workflow_manager/workflow/execution.py+++ b/backend/workflow_manager/workflow/execution.py@@ -159,7 +159,7 @@ class WorkflowExecutionServiceHelper(WorkflowExecutionService):if execution_time is not None:execution.execution_time = execution_timeif error:- execution.error_message = error+ execution.error_message = error[:EXECUTION_ERROR_LENGTH]if increment_attempt:execution.attempts += 1@@ -387,7 +387,7 @@ class WorkflowExecutionServiceHelper(WorkflowExecutionService):try:execution = WorkflowExecution.objects.get(pk=execution_id)execution.status = ExecutionStatus.ERROR.value- execution.error_message = err_msg+ execution.error_message = err_msg[:EXECUTION_ERROR_LENGTH]execution.save()return executionexcept WorkflowExecution.DoesNotExist:diff --git a/backend/workflow_manager/workflow/models/workflow.py b/backend/workflow_manager/workflow/models/workflow.pyindex 94505da55..7954b9559 100644--- a/backend/workflow_manager/workflow/models/workflow.py+++ b/backend/workflow_manager/workflow/models/workflow.py@@ -7,7 +7,6 @@ from utils.models.base_model import BaseModelPROMPT_NAME_LENGTH = 32WORKFLOW_STATUS_LENGTH = 16-EXECUTION_ERROR_LENGTH = 256DESCRIPTION_FIELD_LENGTH = 490WORKFLOW_NAME_SIZE = 128diff --git a/backend/workflow_manager/workflow_v2/execution.py b/backend/workflow_manager/workflow_v2/execution.pyindex 2f07a2219..d8b9f85f7 100644--- a/backend/workflow_manager/workflow_v2/execution.py+++ b/backend/workflow_manager/workflow_v2/execution.py@@ -156,7 +156,7 @@ class WorkflowExecutionServiceHelper(WorkflowExecutionService):if execution_time is not None:execution.execution_time = execution_timeif error:- execution.error_message = error+ execution.error_message = error[:EXECUTION_ERROR_LENGTH]if increment_attempt:execution.attempts += 1diff --git a/backend/workflow_manager/workflow_v2/models/workflow.py b/backend/workflow_manager/workflow_v2/models/workflow.pyindex dcdaa5dae..bfde5e86e 100644--- a/backend/workflow_manager/workflow_v2/models/workflow.py+++ b/backend/workflow_manager/workflow_v2/models/workflow.py@@ -10,7 +10,6 @@ from utils.models.organization_mixin import (PROMPT_NAME_LENGTH = 32WORKFLOW_STATUS_LENGTH = 16-EXECUTION_ERROR_LENGTH = 256DESCRIPTION_FIELD_LENGTH = 490WORKFLOW_NAME_SIZE = 128