langflow-ai/langflow · warning · HTTPException

Unsupported event_delivery {event_delivery!r}. Use one of: {

Error message

Unsupported event_delivery {event_delivery!r}. Use one of: {supported}. For multi-worker Redis deployments, all three values are supported; set LANGFLOW_EVENT_DELIVERY to override the default.

What it means

A defensive exhaustiveness check in the flow-events endpoint: event_delivery parsed to a value that is neither STREAMING, DIRECT, nor POLLING. Because the parameter is typed as the EventDeliveryType enum this normally cannot happen from valid input — it fires when a new enum member is added without wiring it into get_flow_events_response, or when a raw string bypasses FastAPI validation. 400 with the supported list in the message.

Source

Thrown at src/backend/base/langflow/api/build.py:273

            await touch(job_id)
        if event_delivery in (EventDeliveryType.STREAMING, EventDeliveryType.DIRECT):
            return await create_flow_response(
                queue=main_queue,
                event_manager=event_manager,
                event_task=event_task,
                queue_service=queue_service,
                job_id=job_id,
            )

        if event_delivery != EventDeliveryType.POLLING:
            # Defensive exhaustiveness check: if a new EventDeliveryType is added
            # without wiring it up here, surface a clear error instead of silently
            # treating it as polling. Each delivery mode has different cross-worker
            # guarantees (DIRECT/STREAMING use signal_cancel + heartbeat; POLLING
            # uses the watchdog), so silent fallthrough hides real configuration
            # bugs in multi-worker Redis setups.
            supported = ", ".join(sorted(t.value for t in EventDeliveryType))
            raise HTTPException(
                status_code=400,
                detail=(
                    f"Unsupported event_delivery {event_delivery!r}. "
                    f"Use one of: {supported}. "
                    "For multi-worker Redis deployments, all three values are supported; "
                    "set LANGFLOW_EVENT_DELIVERY to override the default."
                ),
            )

        # Polling mode - get all available events
        try:
            events: list = []
            # Get all available events from the queue without blocking
            while not main_queue.empty():
                _, value, _ = await main_queue.get()
                if value is None:
                    # End of stream, trigger end event
                    if event_task is not None:

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Use one of the supported values from the message: the sorted EventDeliveryType values (direct, polling, streaming).
  2. Set LANGFLOW_EVENT_DELIVERY to override the default instead of probing undocumented values.
  3. If you forked Langflow and added an enum member, wire its handling into get_flow_events_response.

Example fix

# before
GET /api/v1/build/{job_id}/events?event_delivery=websocket

# after
GET /api/v1/build/{job_id}/events?event_delivery=streaming
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {t.value for t in EventDeliveryType}  # {'direct','polling','streaming'}

def valid_delivery(value: str) -> str | None:
    return value if value in SUPPORTED else None

Type guard

def is_supported_delivery(v: str) -> TypeGuard[str]:
    return v in {t.value for t in EventDeliveryType}

Prevention

When it happens

Trigger: Sending event_delivery=<unrecognized value> to the events endpoint via a client that skips enum validation, or running a patched/forked backend that added an EventDeliveryType member without handling it here.

Common situations: Version skew between a custom frontend/SDK and the backend after a new delivery mode was partially introduced; direct HTTP calls with hand-written query strings.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/5aa645de2e68029c. Report an issue: GitHub.