Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
3eb7cd6
Update pyproject versions
jordanrfrazier Aug 27, 2025
cc975df
fix: Avoid namespace collision for Astra (#9544)
erichare Aug 27, 2025
e423526
fix: Revert to a working composio release for module import (#9569)
erichare Aug 27, 2025
7fec73d
fix: Knowledge base component refactor (#9543)
erichare Aug 27, 2025
d8b5731
fix: Fix env file handling in Windows build scripts (#9414)
Cristhianzl Aug 27, 2025
49ddc8c
fix: update agent_llm display name to "Model Provider" in AgentCompon…
edwinjosechittilappilly Aug 27, 2025
e494afb
fix: use custom file handler on chat view, disable mcp_composer by de…
lucaseduoli Aug 27, 2025
48fe917
fix: Use the newest file component in Vector Store RAG Template (#9571)
erichare Aug 27, 2025
45512a5
fix: AI/ML icon is missing (#9553)
deon-sanchez Aug 27, 2025
d38e8f4
fix: Allow updates to the file component in templates using it (#9572)
erichare Aug 27, 2025
7a4bcfb
fix: Fixes filtering so legacy components aren't shown by default (#9…
mfortman11 Aug 27, 2025
e07d489
fix: changed name on tool mode to slug, added close button to sidebar…
lucaseduoli Aug 28, 2025
9e871e2
fix: enhance scroll behavior on playground (#9586)
lucaseduoli Aug 28, 2025
f792525
fix: delete duplicate Serper api from google bundle (#9601)
lucaseduoli Aug 28, 2025
d9c005b
fix: allow deletion of mcp servers, add tests for mcp sidebar (#9587)
lucaseduoli Aug 29, 2025
5860a8b
fix: change zoom in and out limit, create tests for zooming in and ou…
lucaseduoli Aug 29, 2025
f82e514
fix: Add localStorage persistence for feature toggles (#9597)
Cristhianzl Aug 29, 2025
b4e4435
fix: Add help text to Lock Flow option (#9600)
Cristhianzl Aug 29, 2025
2c21fbd
fix: Add comprehensive tests and improve minimal condition logic (#9611)
Cristhianzl Aug 29, 2025
133fe6c
fix: change icon color for mcp, remove color setting of icons (#9594)
lucaseduoli Aug 29, 2025
d715fa1
fix: remove unsupported styling options from chats components (#9610)
italojohnny Aug 29, 2025
9798500
fix: disable mcp auto install for not installed applications, refacto…
lucaseduoli Aug 29, 2025
349295a
fix: Properly allow the non-specification of an OCR Engine (#9617)
erichare Sep 1, 2025
dfd4037
fix: Support objects with data attribute in body processing (#9644)
Cristhianzl Sep 2, 2025
f8da854
fix: Add comprehensive message sorting + tests (#9641)
Cristhianzl Sep 2, 2025
cfd10f8
fix: Fix audio recording resource cleanup (#9623)
Cristhianzl Sep 2, 2025
f854b70
fix: Add voice mode availability detection (#9621)
Cristhianzl Sep 2, 2025
8b0ddde
fix: Remove formatting from agent input text content (#9638)
Cristhianzl Sep 2, 2025
9f09250
fix: added most important types at the beginning of the extensions ar…
lucaseduoli Sep 2, 2025
8d26d52
fix: Include flow ID in webhook URLs (#9624)
Cristhianzl Sep 2, 2025
169fd32
fix(logger): add optional cache to configure; update caching behavior…
ogabrielluiz Sep 2, 2025
d10854a
fix: Update sidebar border styles (#9625)
mfortman11 Sep 2, 2025
a290c46
fix: Remove top padding from sidebar groups (#9636)
Cristhianzl Sep 2, 2025
ea49ead
fix: disable message editing on playground, fix new session not persi…
lucaseduoli Sep 2, 2025
9d04d56
fix: disable elevate edges on node select (#9658)
lucaseduoli Sep 2, 2025
e61cb46
fix: Properly respect the order parameter for Message History (#9605)
erichare Sep 3, 2025
e20ff66
fix: Return multi-row dataframe when Structured Output data supports …
erichare Sep 3, 2025
68288aa
fix: apply to fields in settings page (#9602)
edwinjosechittilappilly Sep 3, 2025
617e94b
fix: Segmented Sidebar switch to search on value change (#9615)
mfortman11 Sep 3, 2025
d1998b3
fix: deprecate claude 3 sonnet model (#9622)
edwinjosechittilappilly Sep 3, 2025
375e672
fix: Properly import Langchain ToolMessage for Message options (#9675)
erichare Sep 3, 2025
032c7fa
fix: fixed user settings test (#9690)
lucaseduoli Sep 3, 2025
bc13c5b
fix: Remove warning log for unset TRACELOOP_API_KEY in configuration …
ogabrielluiz Sep 3, 2025
57686a7
fix: knowledge base fixes for 1.6 pointing to release branch (#9683)
deon-sanchez Sep 3, 2025
320cd00
fix: remove github link on discord button (#9655)
lucaseduoli Sep 4, 2025
d9a97cc
fix: remove python code component, fix placeholder not appearing (#9660)
lucaseduoli Sep 4, 2025
f51575e
fix: add margins to <p> tag in markdown (#9656)
lucaseduoli Sep 4, 2025
bf32bdd
fix: delete unused components, delete [deprecated] tag on the compone…
lucaseduoli Sep 4, 2025
74952e8
fix: Ensure correct Docling Remote URL for API (#9708)
erichare Sep 4, 2025
5687903
feat: remove agent dual output (#9700)
edwinjosechittilappilly Sep 4, 2025
3b7601f
refactor: Agent component enhancements for release v1.6 (#9685)
deon-sanchez Sep 4, 2025
b551b0c
feat: mcp composer integration (#9506)
jordanrfrazier Sep 5, 2025
f2f6129
fix: Adjust padding and layout for improved spacing (#9711)
Cristhianzl Sep 5, 2025
2f9dc00
fix: remove Groq from Agents model provider list (#9616)
edwinjosechittilappilly Sep 5, 2025
06e00c6
fix: conditional scheduling logic to not run branch (#9722)
jordanrfrazier Sep 8, 2025
1c262de
fix: disable keys when flow is locked (#9726)
lucaseduoli Sep 8, 2025
cf08d19
fix: superuser credential handling and AUTO_LOGIN security (#9542)
edwinjosechittilappilly Sep 8, 2025
6cabf2a
chore: Update version to 1.6.0 in package files (#9746)
ogabrielluiz Sep 8, 2025
d9c4802
fix: update logs position to be absolute (#9724)
lucaseduoli Sep 8, 2025
8cddf6c
fix: make entire playground chat area be clickable (#9721)
lucaseduoli Sep 8, 2025
86815cb
fix: Restore old description from file description. (#9752)
erichare Sep 8, 2025
5a8f988
fix: Preserve flows and components during project updates (#9750)
Cristhianzl Sep 9, 2025
c8e1efb
fix(langwatch): prevent trace errors with proper API key validation (…
italojohnny Sep 9, 2025
eed7a87
fix(URLComponent): filter out `None` in headers to avoid silent seria…
ogabrielluiz Sep 9, 2025
4bba723
fix: put knowledge bases under feature flag (#9749)
lucaseduoli Sep 9, 2025
ecd7214
refactor: Padding misaligned for sidebar icons and other issues fix f…
deon-sanchez Sep 9, 2025
b09964e
fix: Updated Agent Starter Projects with new Templates (#9772)
deon-sanchez Sep 9, 2025
17cb077
fix: remove agents from skipped components list in setup (#9785)
edwinjosechittilappilly Sep 9, 2025
a91ff1e
fix: improve error handling for missing OCR dependencies (#9753)
italojohnny Sep 9, 2025
938542b
fix: adjust casing on Add MCP Server buttons (#9774)
lucaseduoli Sep 9, 2025
56f4abc
fix: set gpt4.1 as default model (#9780)
edwinjosechittilappilly Sep 9, 2025
b0124e8
feat: double clicking a component will add it to the canvas (#9730)
deon-sanchez Sep 9, 2025
d700afd
fix: release branch tests (#9820)
jordanrfrazier Sep 11, 2025
10919ef
fix: Properly serialize documents for Graph RAG in Astra (#9777)
erichare Sep 11, 2025
aad68cf
fix: Standardize content dict format for LLM provider compatibility (…
Cristhianzl Sep 11, 2025
9749c0c
fix: make components added with filter come with the output pre-selec…
lucaseduoli Sep 11, 2025
2be9bb5
fix: make mcp tools refresh when changing server with the same name (…
lucaseduoli Sep 11, 2025
c95be64
fix: remove extra spaces from playground, added separator (#9779)
lucaseduoli Sep 11, 2025
6b332da
fix: Update message schema tests for image_url structure (#9823)
Cristhianzl Sep 11, 2025
28fc31f
fix: Restore Embedding Model Connections in Vector Store RAG (#9776)
erichare Sep 11, 2025
bfc7c8b
fix: update CORS configuration and add env vars to allow for user co…
jordanrfrazier Sep 11, 2025
481a921
fix: handle pandas Series in get_message boolean evaluation (#9765)
italojohnny Sep 11, 2025
f1ae031
fix: Add VLM support for Docling and improve deps (#9757)
erichare Sep 11, 2025
a97032a
fix: make cursor position not go to end on input list component (#9782)
lucaseduoli Sep 11, 2025
e58bc43
fix: remove metadata building to speed up load times (#9819)
ogabrielluiz Sep 12, 2025
5a104d1
fix: turn mcp composer feature on by default on frontend (#9831)
lucaseduoli Sep 12, 2025
6266b10
fix: make astra db component not disconnect, fix handle color when ty…
lucaseduoli Sep 12, 2025
36a6d48
fix: Handle ImportError for parse_api_endpoint and remove debug loggi…
ogabrielluiz Sep 12, 2025
ed19cb9
fix: make session_id visible in Message History Retrieve mode (#9557)
Vigtu Sep 12, 2025
fd88a3c
feat: Enhance logging configuration with caller information and condi…
ogabrielluiz Sep 12, 2025
567d0fa
ref: update auto login behavior to use secure defaults (#9825)
jordanrfrazier Sep 12, 2025
fbee06d
skip unimplemented cors tests
jordanrfrazier Sep 12, 2025
b6e2d09
fix: make mcp tools update when auth settings is null (#9844)
lucaseduoli Sep 12, 2025
d4f727a
fix: adjust tools title and description padding (#9847)
lucaseduoli Sep 12, 2025
6041389
fix: Apply a per-user uniqueness for mcp (#9840)
erichare Sep 12, 2025
8e266db
fix: make file button clickable after focusing on chat (#9863)
lucaseduoli Sep 15, 2025
839295d
fix: make input clickable on chat (#9864)
lucaseduoli Sep 15, 2025
11e9b1a
test: Increase loading performance test timeout (#9873)
Cristhianzl Sep 15, 2025
1918be1
Revert "ref: update auto login behavior to use secure defaults (#9825)"
jordanrfrazier Sep 15, 2025
75f34b3
refactor: update skip_auth_auto_login behavior and update messaging t…
jordanrfrazier Sep 15, 2025
75212fe
fix: Remove the uniqueness constraint on file names (#9872)
erichare Sep 15, 2025
09a2a61
Merge branch 'release-1.6.0' into merge/release-1.6.0-to-main
jordanrfrazier Sep 16, 2025
3860368
Move mcp composer service to lfx
jordanrfrazier Sep 16, 2025
60f5601
MCP Composer service factory fixes
jordanrfrazier Sep 16, 2025
c555ac1
Add back script changes for lfx
jordanrfrazier Sep 17, 2025
09e8f9b
Clean up mcp project imports
jordanrfrazier Sep 17, 2025
2d718cc
Update d37bc4322900_drop_single_constraint_on_files_name_.py
erichare Sep 17, 2025
d810add
Fix mcp imports
jordanrfrazier Sep 17, 2025
63c2c28
fix: Load flows autologin false (#9578)
phact Sep 17, 2025
a09dd24
Update CORS deprecation notice
jordanrfrazier Sep 17, 2025
2dce27a
Add back the external options in dropdown input
jordanrfrazier Sep 17, 2025
d7d859a
Add back starter projects
jordanrfrazier Sep 17, 2025
3efb092
Remove old components/data init file and update starter projects
jordanrfrazier Sep 17, 2025
9d92542
remove todo
jordanrfrazier Sep 17, 2025
bdd1d94
Re-adds the clean_data param for chat output
jordanrfrazier Sep 17, 2025
6a8cc75
merged main into 1.6.0
lucaseduoli Sep 17, 2025
64ba9c5
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 17, 2025
6ebb414
Update starter projects with clean_data
jordanrfrazier Sep 17, 2025
e757f62
Update oauth timeouts and fix socket binding check
jordanrfrazier Sep 17, 2025
3378502
Fix import and main duplicate code
jordanrfrazier Sep 18, 2025
4ac38ec
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 18, 2025
2e1506d
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Sep 18, 2025
3fa88bb
Import and test fixes
jordanrfrazier Sep 18, 2025
a3afcf6
Merge branch 'main' into merge/release-1.6.0-to-main
jordanrfrazier Sep 18, 2025
0bada8d
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 18, 2025
a7efa4b
Temporarily skipping knowledge bases import issue to allow other CI t…
jordanrfrazier Sep 18, 2025
5869a7d
Add python function to lfx test
jordanrfrazier Sep 18, 2025
c2890aa
fix: Move docling dependency into core dependencies instead of dev (#…
erichare Sep 18, 2025
e25e45b
fixed typesStore test
lucaseduoli Sep 18, 2025
5e9b9a0
Merge branch 'main' into merge/release-1.6.0-to-main
jordanrfrazier Sep 18, 2025
3fcbff7
Ruff and image unit test fixes
jordanrfrazier Sep 18, 2025
7d2450f
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 18, 2025
01dff70
📝 (image.py): Update function documentation to reflect changes in the…
Cristhianzl Sep 18, 2025
73264c4
merge fix
Cristhianzl Sep 18, 2025
0574ebc
Merge branch 'main' into merge/release-1.6.0-to-main
jordanrfrazier Sep 18, 2025
3871595
Knowledge bases update for merge
erichare Sep 18, 2025
67f61d5
Update __init__.py
erichare Sep 18, 2025
93bd2fd
Revert the changes to package lock
erichare Sep 18, 2025
64fc655
Fix kb tests to use client fixture instead of mocks
jordanrfrazier Sep 18, 2025
cb705c3
Clean up mcp init task
jordanrfrazier Sep 18, 2025
722ce3b
Fix other kb tests
jordanrfrazier Sep 18, 2025
38c918f
fix: Make sure strings can be parsed in the python interpreter (#9908)
erichare Sep 18, 2025
a46da1c
Merge branch 'release-1.6.0' into merge/release-1.6.0-to-main-v2
jordanrfrazier Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ LANGFLOW_STORE_ENVIRONMENT_VARIABLES=
# Should enable the MCP composer feature in MCP projects
# Values: true, false
# Default: true
LANGFLOW_FEATURE_MCP_COMPOSER=
LANGFLOW_MCP_COMPOSER_ENABLED=

# STORE_URL
# Example: LANGFLOW_STORE_URL=https://api.langflow.store
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,6 @@ src/frontend/temp
*.mcp.json

news-aggregated.json
CLAUDE.md
CLAUDE.md

member_servers.json
1 change: 1 addition & 0 deletions docker/build_and_push.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ ENV LANGFLOW_HOST=0.0.0.0
ENV LANGFLOW_PORT=7860

CMD ["langflow", "run"]

Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@
"tool_mode": false,
"trace_as_metadata": true,
"type": "str",
"value": "gpt-4o"
"value": "gpt-4.1"
},
"openai_api_base": {
"_input_type": "StrInput",
Expand Down Expand Up @@ -1200,7 +1200,7 @@
"tool_mode": false,
"trace_as_metadata": true,
"type": "str",
"value": "gpt-4o-mini"
"value": "gpt-4.1"
},
"prompt": {
"_input_type": "MessageTextInput",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,7 @@
"tool_mode": false,
"trace_as_metadata": true,
"type": "str",
"value": "gpt-4o"
"value": "gpt-4.1"
},
"openai_api_base": {
"_input_type": "StrInput",
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/Integrations/Notion/Meeting_Notes_Agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@
"placeholder": "",
"show": true,
"name": "model_name",
"value": "gpt-4o",
"value": "gpt-4.1",
"display_name": "Model Name",
"advanced": true,
"dynamic": false,
Expand Down Expand Up @@ -1878,7 +1878,7 @@
"placeholder": "",
"show": true,
"name": "model_name",
"value": "gpt-4o",
"value": "gpt-4.1",
"display_name": "Model Name",
"advanced": true,
"dynamic": false,
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ dependencies = [
"cleanlab-tlm>=1.1.2",
'gassist>=0.0.1; sys_platform == "win32"',
"twelvelabs>=0.4.7",
"docling_core>=2.36.1",
"docling>=2.36.1",
"filelock>=3.18.0",
"jigsawstack==0.2.7",
"structlog>=25.4.0",
"aiosqlite==0.21.0",
"fastparquet>=2024.11.0",
"traceloop-sdk>=0.43.1",
"easyocr>=1.7.2",
"opencv-python>=4.11",
]

[dependency-groups]
Expand Down Expand Up @@ -179,7 +181,6 @@ dev = [
"pytest-timeout>=2.3.1",
"pyyaml>=6.0.2",
"pyleak>=0.1.14",
"docling>=2.36.1"
]

[tool.uv.sources]
Expand Down
4 changes: 2 additions & 2 deletions src/backend/base/langflow/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ async def _create_superuser(username: str, password: str, auth_token: str | None
if settings_service.auth_settings.AUTO_LOGIN:
# Force default credentials for AUTO_LOGIN mode
username = DEFAULT_SUPERUSER
password = DEFAULT_SUPERUSER_PASSWORD
password = DEFAULT_SUPERUSER_PASSWORD.get_secret_value()
else:
# Production mode - prompt for credentials if not provided
if not username:
Expand Down Expand Up @@ -711,7 +711,7 @@ async def _create_superuser(username: str, password: str, auth_token: str | None
raise typer.Exit(1)

typer.echo(f"AUTO_LOGIN enabled. Creating default superuser '{username}'...")
typer.echo(f"Note: Default credentials are {DEFAULT_SUPERUSER}/{DEFAULT_SUPERUSER_PASSWORD}")
# Do not echo the default password to avoid exposing it in logs.
# AUTO_LOGIN is false - production mode
elif is_first_setup:
typer.echo("No superusers found. Creating first superuser...")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
"""Drop single constraint on file.name column

Revision ID: d37bc4322900
Revises: 0882f9657f22
Create Date: 2025-09-15 11:11:37.610294

"""
import logging

from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

logger = logging.getLogger(__name__)

# revision identifiers, used by Alembic.
revision: str = "d37bc4322900"
down_revision: Union[str, None] = "0882f9657f22"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
"""Remove single UNIQUE constraint on name column while preserving composite constraint."""
conn = op.get_bind()
inspector = sa.inspect(conn)

# Check if file table exists
table_names = inspector.get_table_names()
if "file" not in table_names:
logger.info("file table does not exist, skipping")
return

db_dialect = conn.dialect.name
logger.info(f"Running migration on {db_dialect} database")

try:
if db_dialect == "sqlite":
# SQLite: Recreate table without single UNIQUE constraint
logger.info("SQLite: Recreating table to remove single UNIQUE constraint on name")

# Guard against schema drift: ensure expected columns before destructive rebuild
res = conn.execute(sa.text('PRAGMA table_info("file")'))
cols = [row[1] for row in res]
expected = ['id', 'user_id', 'name', 'path', 'size', 'provider', 'created_at', 'updated_at']
if set(cols) != set(expected):
raise RuntimeError(f"SQLite: Unexpected columns on file table: {cols}. Aborting migration to avoid data loss.")

# Create the new table without the single UNIQUE(name) constraint
op.execute("""
CREATE TABLE file_new (
id CHAR(32) NOT NULL,
user_id CHAR(32) NOT NULL,
name VARCHAR NOT NULL,
path VARCHAR NOT NULL,
size INTEGER NOT NULL,
provider VARCHAR,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
CONSTRAINT file_name_user_id_key UNIQUE (name, user_id),
FOREIGN KEY(user_id) REFERENCES user (id)
)
""")

# Copy data from old table to new table
op.execute("""
INSERT INTO file_new (id, user_id, name, path, size, provider, created_at, updated_at)
SELECT id, user_id, name, path, size, provider, created_at, updated_at
FROM file
""")

# Drop old table and rename new table
op.execute("PRAGMA foreign_keys=OFF")
try:
op.execute("DROP TABLE file")
op.execute("ALTER TABLE file_new RENAME TO file")
finally:
op.execute("PRAGMA foreign_keys=ON")

logger.info("SQLite: Successfully recreated file table without single UNIQUE constraint on name")

elif db_dialect == "postgresql":
# PostgreSQL: Find and drop single-column unique constraints on 'name'
logger.info("PostgreSQL: Finding and dropping single UNIQUE constraints and indexes on name")

# Determine target schema
schema = sa.inspect(conn).default_schema_name or "public"

# Get constraint names that are single-column unique on 'name'
result = conn.execute(sa.text("""
SELECT conname
FROM pg_constraint c
JOIN pg_class t ON c.conrelid = t.oid
JOIN pg_namespace n ON t.relnamespace = n.oid
WHERE t.relname = 'file'
AND n.nspname = :schema
AND c.contype = 'u'
AND array_length(c.conkey, 1) = 1
AND EXISTS (
SELECT 1 FROM pg_attribute a
WHERE a.attrelid = t.oid
AND a.attnum = c.conkey[1]
AND a.attname = 'name'
)
"""), {"schema": schema})

constraints_to_drop = [row[0] for row in result.fetchall()]

if constraints_to_drop:
for constraint_name in constraints_to_drop:
op.drop_constraint(constraint_name, "file", type_="unique", schema=schema)
logger.info(f"PostgreSQL: Dropped constraint {constraint_name}")
else:
logger.info("PostgreSQL: No single UNIQUE constraints found on name column")

# Also drop any single-column UNIQUE indexes on name not backed by constraints
idx_result = conn.execute(sa.text("""
SELECT i.relname
FROM pg_class t
JOIN pg_namespace n ON n.oid = t.relnamespace
JOIN pg_index ix ON ix.indrelid = t.oid
JOIN pg_class i ON i.oid = ix.indexrelid
WHERE t.relname = 'file'
AND n.nspname = :schema
AND ix.indisunique = TRUE
AND array_length(ix.indkey, 1) = 1
AND NOT EXISTS (SELECT 1 FROM pg_constraint c WHERE c.conindid = ix.indexrelid)
AND (SELECT a.attname FROM pg_attribute a
WHERE a.attrelid = t.oid AND a.attnum = ix.indkey[1]) = 'name'
"""), {"schema": schema})
for (index_name,) in idx_result.fetchall():
op.drop_index(index_name, table_name="file", schema=schema)
logger.info(f"PostgreSQL: Dropped unique index {index_name}")

else:
raise ValueError(f"Unsupported database dialect: {db_dialect}")

except Exception as e:
logger.error(f"Error during constraint removal: {e}")
raise


def downgrade() -> None:
"""Add back the single unique constraint on name column."""
conn = op.get_bind()
inspector = sa.inspect(conn)

# Check if file table exists
table_names = inspector.get_table_names()
if "file" not in table_names:
logger.info("file table does not exist, skipping downgrade")
return

db_dialect = conn.dialect.name

try:
# Pre-check for duplicates that would violate UNIQUE(name)
dup = conn.execute(sa.text("SELECT name FROM file GROUP BY name HAVING COUNT(*) > 1 LIMIT 1")).first()
if dup:
raise RuntimeError(
"Downgrade aborted: duplicates in file.name would violate UNIQUE(name). "
"Deduplicate before downgrading."
)
if db_dialect == "sqlite":
# Add the same column validation as upgrade
res = conn.execute(sa.text('PRAGMA table_info("file")'))
cols = [row[1] for row in res]
expected = ['id', 'user_id', 'name', 'path', 'size', 'provider', 'created_at', 'updated_at']
if set(cols) != set(expected):
raise RuntimeError(f"SQLite: Unexpected columns on file table: {cols}. Aborting downgrade.")
# SQLite: Recreate table with both constraints
logger.info("SQLite: Recreating table with both constraints")

op.execute("""
CREATE TABLE file_new (
id CHAR(32) NOT NULL,
user_id CHAR(32) NOT NULL,
name VARCHAR NOT NULL,
path VARCHAR NOT NULL,
size INTEGER NOT NULL,
provider VARCHAR,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
CONSTRAINT file_name_user_id_key UNIQUE (name, user_id),
FOREIGN KEY(user_id) REFERENCES user (id),
UNIQUE (name)
)
""")

# Copy data
op.execute("""
INSERT INTO file_new (id, user_id, name, path, size, provider, created_at, updated_at)
SELECT id, user_id, name, path, size, provider, created_at, updated_at
FROM file
""")

# Replace table
op.execute("PRAGMA foreign_keys=OFF")
try:
op.execute("DROP TABLE file")
op.execute("ALTER TABLE file_new RENAME TO file")
finally:
op.execute("PRAGMA foreign_keys=ON")

logger.info("SQLite: Restored single unique constraint on name column")

elif db_dialect == "postgresql":
# PostgreSQL: Add constraint back
schema = sa.inspect(conn).default_schema_name or "public"
op.create_unique_constraint("file_name_unique", "file", ["name"], schema=schema)
logger.info("PostgreSQL: Added back single unique constraint on 'name' column")

else:
logger.info(f"Downgrade not supported for dialect: {db_dialect}")

except Exception as e:
logger.error(f"Error during downgrade: {e}")
if "constraint" not in str(e).lower():
raise
9 changes: 7 additions & 2 deletions src/backend/base/langflow/api/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,14 @@ async def _build_vertex(vertex_id: str, graph: Graph, event_manager: EventManage
result_data_response.duration = duration
result_data_response.timedelta = timedelta
vertex.add_build_time(timedelta)
inactivated_vertices = list(graph.inactivated_vertices)
# Capture both inactivated and conditionally excluded vertices
inactivated_vertices = list(graph.inactivated_vertices.union(graph.conditionally_excluded_vertices))
graph.reset_inactivated_vertices()
graph.reset_activated_vertices()

# Note: Do not reset conditionally_excluded_vertices each iteration
# This is handled by the ConditionalRouter component

# graph.stop_vertex tells us if the user asked
# to stop the build of the graph at a certain vertex
# if it is in next_vertices_ids, we need to remove other
Expand Down Expand Up @@ -407,7 +412,7 @@ async def build_vertices(
try:
vertex_build_response: VertexBuildResponse = await _build_vertex(vertex_id, graph, event_manager)
except asyncio.CancelledError as exc:
await logger.aerror(f"Build cancelled: {exc}")
await logger.ainfo(f"Build cancelled: {exc}")
raise

# send built event or error event
Expand Down
Loading