Skip to content

build_public_tmp does not support EVENT_DELIVERY=direct #7525

Closed
@saber-wang

Description

@saber-wang

Bug Description

async def build_public_tmp(
*,
background_tasks: LimitVertexBuildBackgroundTasks,
flow_id: uuid.UUID,
inputs: Annotated[InputValueRequest | None, Body(embed=True)] = None,
data: Annotated[FlowDataRequest | None, Body(embed=True)] = None,
files: list[str] | None = None,
stop_component_id: str | None = None,
start_component_id: str | None = None,
log_builds: bool | None = True,
flow_name: str | None = None,
request: Request,
queue_service: Annotated[JobQueueService, Depends(get_queue_service)],
):
"""Build a public flow without requiring authentication.
This endpoint is specifically for public flows that don't require authentication.
It uses a client_id cookie to create a deterministic flow ID for tracking purposes.
The endpoint:
1. Verifies the requested flow is marked as public in the database
2. Creates a deterministic UUID based on client_id and flow_id
3. Uses the flow owner's permissions to build the flow
Requirements:
- The flow must be marked as PUBLIC in the database
- The request must include a client_id cookie
Args:
flow_id: UUID of the public flow to build
background_tasks: Background tasks manager
inputs: Optional input values for the flow
data: Optional flow data
files: Optional files to include
stop_component_id: Optional ID of component to stop at
start_component_id: Optional ID of component to start from
log_builds: Whether to log the build process
flow_name: Optional name for the flow
request: FastAPI request object (needed for cookie access)
queue_service: Queue service for job management
Returns:
Dict with job_id that can be used to poll for build status
"""
try:
# Verify this is a public flow and get the associated user
client_id = request.cookies.get("client_id")
owner_user, new_flow_id = await verify_public_flow_and_get_user(flow_id=flow_id, client_id=client_id)
# Start the flow build using the new flow ID
job_id = await start_flow_build(
flow_id=new_flow_id,
background_tasks=background_tasks,
inputs=inputs,
data=data,
files=files,
stop_component_id=stop_component_id,
start_component_id=start_component_id,
log_builds=log_builds or False,
current_user=owner_user,
queue_service=queue_service,
flow_name=flow_name or f"{client_id}_{flow_id}",
)
except Exception as exc:
logger.exception("Error building public flow")
if isinstance(exc, HTTPException):
raise
raise HTTPException(status_code=500, detail=str(exc)) from exc
return {"job_id": job_id}
Lack of support for EVENT_DELIVERY=direct

Reproduction

  1. Set EVENT DELIVERY=direct
  2. publish flow

Expected behavior

support EVENT_DELIVERY=direct

Who can help?

No response

Operating System

linux

Langflow Version

1.3.2

Python Version

3.12

Screenshot

No response

Flow File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions