aggregate error code in workflow run response (#3508)

This commit is contained in:
LawyZheng
2025-09-24 11:39:35 +08:00
committed by GitHub
parent b1cc417086
commit dee4458685
2 changed files with 6 additions and 0 deletions

View File

@@ -191,3 +191,4 @@ class WorkflowRunResponseBase(BaseModel):
max_screenshot_scrolls: int | None = None
browser_address: str | None = None
script_run: ScriptRunResponse | None = None
errors: list[dict[str, Any]] | None = None

View File

@@ -1416,6 +1416,10 @@ class WorkflowService:
extracted_information.extend(WorkflowService._collect_extracted_information(output.value))
outputs[EXTRACTED_INFORMATION_KEY] = extracted_information
errors: list[dict[str, Any]] = []
for task in workflow_run_tasks:
errors.extend(task.errors)
total_steps = None
total_cost = None
if include_cost:
@@ -1461,6 +1465,7 @@ class WorkflowService:
task_v2=task_v2,
browser_address=workflow_run.browser_address,
script_run=workflow_run.script_run,
errors=errors,
)
async def clean_up_workflow(