OpenBMB/ChatDev · error · WorkflowExecutionError
Failed to run workflow: {exc}
Error message
Failed to run workflow: {exc} What it means
An unexpected exception escaped the synchronous workflow run (not FileNotFoundError and not ValidationError). It is logged as 'Failed to run workflow via sync API' and re-raised as WorkflowExecutionError with the original message.
Source
Thrown at server/routes/execute_sync.py:183
if not accepts_stream:
try:
result = await run_in_threadpool(
run_workflow,
request.yaml_file,
task_prompt=request.task_prompt,
attachments=request.attachments,
session_name=request.session_name,
variables=request.variables,
log_level=resolved_log_level,
)
except FileNotFoundError as exc:
raise HTTPException(status_code=404, detail=str(exc))
except ValidationError as exc:
raise HTTPException(status_code=400, detail=str(exc))
except Exception as exc:
logger = get_server_logger()
logger.log_exception(exc, "Failed to run workflow via sync API")
raise WorkflowExecutionError(f"Failed to run workflow: {exc}")
final_message = result.final_message.text_content() if result.final_message else ""
meta = result.meta_info
logger = get_server_logger()
logger.info(
"Workflow execution completed via sync API",
log_type=LogType.WORKFLOW,
session_id=meta.session_name,
yaml_path=meta.yaml_file,
)
return {
"status": "completed",
"final_message": final_message,
"token_usage": meta.token_usage,
"output_dir": str(meta.output_dir.resolve()),
}View on GitHub (pinned to 4fb2db0ea9)
Solutions
- Read the server log entry 'Failed to run workflow via sync API' for the underlying traceback and address that
- Reproduce with log_level=DEBUG for fuller output
- Simplify the workflow to isolate the failing step
- Update to the latest server version if the traceback points to engine internals
Defensive patterns
Strategy: try-catch
Validate before calling
# pre-flight: validate workflow YAML with the /schema/validate endpoint
report = client.schema_validate(open(yaml_file).read())
assert report.get('valid'), report Try / catch
try:
result = client.run_workflow_sync(req)
except WorkflowExecutionError as e:
capture_server_log('Failed to run workflow via sync API')
if transient(str(e)): retry_with_backoff(req) Prevention
- Validate workflow YAML before running
- Run with log_level=DEBUG when diagnosing; keep server version current
When it happens
Trigger: POST /workflow/run where the workflow itself or the sync execution machinery raises: engine bugs, IO failures mid-run, serialization errors building the final message.
Common situations: Bugs in workflow steps, corrupted state in the session store, disk-full conditions while writing artifacts, version mismatches between workflow definition and engine.
Related errors
- Failed to start workflow: {exc}
- YAML root must be a mapping
- Failed to download session
- YAML root must be a mapping
- Design validation failed for '{config_path}': {formatted}
AI-assisted analysis of OpenBMB/ChatDev@4fb2db0ea9 (2026-08-27).
Data as JSON: /api/errors/66067d731d7aebac.
Report an issue: GitHub.