Files
langflow/src
ogabrielluiz 6eaae2ca4d feat(lfx serve): v2 workflow endpoints (sync + stream) on lfx serve
Gives the production runtime (lfx serve) the same v2 contract as the langflow
backend's POST /api/v2/workflows, built on the shared lfx.workflow layer.

- New POST /workflows endpoint: WorkflowRunRequest in, WorkflowExecutionResponse
  (sync) or an SSE stream (langflow/agui protocols) out. flow_id resolves against
  the serve registry; per-request deepcopy+stamp mirrors the run/stream endpoints.
- sync runs via run_graph_internal (the same primitive the backend sync path
  uses) so the converter sees the aggregated RunOutputs shape.
- stream drives the run with a token-stream EventManager wired into
  execute_graph_with_capture and feeds queue events through the shared
  StreamAdapter; emits a terminal end so the adapter closes the run cleanly.
- background and public modes are rejected (422); tweaks/data/files/globals and
  partial-run boundaries are rejected too (no per-request graph rebuild yet).
- execute_graph_with_capture gains an optional event_manager param.

Tests build a real ChatInput->ChatOutput flow (no mocks) and exercise sync, both
stream protocols, and the guards. 329 lfx serve + contract tests pass.
2026-06-23 14:06:34 -03:00
..