langflow-ai/langflow · error · HTTPException
Starter project and default project not found. Please create
Error message
Starter project and default project not found. Please create a project and add flows to it.
What it means
404 from GET /api/v1/flows/ (the list endpoint): neither the 'Starter' folder (STARTER_FOLDER_NAME) nor the default folder (DEFAULT_FOLDER_NAME) exists in the database. The listing is folder-anchored — it needs at least one of these seed folders to scope the query — so an installation whose initial-setup folder seeding never ran (or was deleted) cannot list flows at all.
Source
Thrown at src/backend/base/langflow/api/v1/flows.py:157
components_only: bool = False,
get_all: bool = True,
folder_id: UUID | None = None,
flow_type: FlowType | None = None,
params: Annotated[Params, Depends()],
header_flows: bool = False,
):
"""Retrieve a list of flows with optional pagination, filtering, and header-only mode."""
try:
auth_settings = get_settings_service().auth_settings
default_folder = (await session.exec(select(Folder).where(Folder.name == DEFAULT_FOLDER_NAME))).first()
default_folder_id = default_folder.id if default_folder else None
starter_folder = (await session.exec(select(Folder).where(Folder.name == STARTER_FOLDER_NAME))).first()
starter_folder_id = starter_folder.id if starter_folder else None
if not starter_folder and not default_folder:
raise HTTPException(
status_code=404,
detail="Starter project and default project not found. Please create a project and add flows to it.",
)
if not folder_id:
folder_id = default_folder_id
# Rows the caller owns outright. Under AUTO_LOGIN the legacy owner-scoped
# query also surfaces null-owner flows; keep that in the fallback path
# (``fallback_clause``). The SQL prefilter union, however, must NOT
# blanket-include null-owner rows: the in-memory fallback routes them
# through ``batch_enforce`` (``filter_visible_resources``'s owner_extractor
# returns None, which never equals a real user id), so the prefilter keeps
# them out of the owned half and a null-owner flow is visible only when the
# plugin lists its id. AUTHZ_ENABLED and AUTO_LOGIN are independent flags,
# so both can be set — this keeps the two paths consistent regardless.
owned_clause = Flow.user_id == current_user.id
fallback_clause = owned_clauseView on GitHub (pinned to 976ec789d2)
Solutions
- Let Langflow run its initial setup against this database (start the server so it seeds the default folder) and retry
- Or create the folders via the API/UI so at least the default folder exists, then add flows
- If folders were deleted accidentally, restore from a DB backup
Example fix
-- before: no default folder rows SELECT name FROM folder; -- neither 'Starter' nor the default name -- after: re-seed the default folder (name must match DEFAULT_FOLDER_NAME) INSERT INTO folder (id, name, user_id) VALUES (gen_random_uuid(), '<DEFAULT_FOLDER_NAME>', NULL);
Defensive patterns
Strategy: fallback
Validate before calling
const { data: folders } = await axios.get('/api/v1/folders/');
const seeded = folders.some((f) => f.name === DEFAULT_FOLDER_NAME || f.name === STARTER_FOLDER_NAME); Try / catch
catch (e) {
if (e.response?.status === 404 && /Starter project and default project/.test(e.response.data?.detail))
showSetupPrompt();
throw e;
} Prevention
- Run the server once against a fresh DB so initial setup seeds folders before clients connect
- Include folder-seed verification in deployment smoke tests
- When restoring databases, restore the seed folders too
When it happens
Trigger: Calling the flows listing on a fresh/custom database where initial setup did not create the seed folders, after someone deleted both folders and their flows, or against a database initialized by an external tool that skipped langflow's initial_setup.
Common situations: Pointing LANGFLOW_DATABASE_URL at a manually-created schema; running with a DB restored without the seed rows; setups that deliberately strip example content but also removed the folders.
Related errors
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/33effd4ee5c43722.
Report an issue: GitHub.