feat: execute workflow bridge nodes in graph runtime

This commit is contained in:
2026-04-07 10:42:59 +02:00
parent 6ad34ceed2
commit c17b7d2e8f
7 changed files with 699 additions and 22 deletions
@@ -228,12 +228,9 @@ async def dispatch_workflow_endpoint(
the caller can track progress.
"""
from pydantic import ValidationError as _ValidationError
from app.domains.rendering.workflow_executor import (
dispatch_prepared_workflow,
prepare_workflow_context,
)
from app.domains.rendering.workflow_executor import prepare_workflow_context
from app.domains.rendering.workflow_graph_runtime import execute_graph_workflow
from app.domains.rendering.workflow_run_service import (
apply_graph_dispatch_result,
create_workflow_run,
mark_workflow_run_failed,
)
@@ -269,7 +266,9 @@ async def dispatch_workflow_endpoint(
await db.commit()
try:
dispatch_result = dispatch_prepared_workflow(workflow_context)
dispatch_result = await db.run_sync(
lambda sync_session: execute_graph_workflow(sync_session, workflow_context)
)
except Exception as exc:
failed_result = await db.execute(
select(WorkflowRun)
@@ -280,14 +279,6 @@ async def dispatch_workflow_endpoint(
mark_workflow_run_failed(failed_run, str(exc))
await db.commit()
raise
run_result = await db.execute(
select(WorkflowRun)
.where(WorkflowRun.id == run_id)
.options(selectinload(WorkflowRun.node_results))
)
run = run_result.scalar_one()
apply_graph_dispatch_result(run, workflow_context, dispatch_result)
await db.commit()
refreshed_result = await db.execute(