-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
langflow/src/backend/base/langflow/api/v1/chat.py
Lines 556 to 624 in 8a1b64e
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} |
EVENT_DELIVERY=direct
Reproduction
- Set
EVENT DELIVERY=direct
- 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
Labels
bugSomething isn't workingSomething isn't working