diff --git a/404.html b/404.html index cfeef52150..0961af4c48 100644 --- a/404.html +++ b/404.html @@ -24,7 +24,7 @@ - +
diff --git a/agent-tutorial.html b/agent-tutorial.html index f95981ed05..5193c48493 100644 --- a/agent-tutorial.html +++ b/agent-tutorial.html @@ -24,7 +24,7 @@ - + diff --git a/agents-tools.html b/agents-tools.html index 2ff8d32c9f..46dc0c3862 100644 --- a/agents-tools.html +++ b/agents-tools.html @@ -24,7 +24,7 @@ - + diff --git a/agents.html b/agents.html index 623ae7588a..046b847ae5 100644 --- a/agents.html +++ b/agents.html @@ -24,7 +24,7 @@ - + diff --git a/api-build.html b/api-build.html index aee86d025a..b8d96be67b 100644 --- a/api-build.html +++ b/api-build.html @@ -24,7 +24,7 @@ - + diff --git a/api-files.html b/api-files.html index b474af9db4..5508450535 100644 --- a/api-files.html +++ b/api-files.html @@ -24,7 +24,7 @@ - + diff --git a/api-flows-run.html b/api-flows-run.html index c7ea6cfb88..154fcb23e5 100644 --- a/api-flows-run.html +++ b/api-flows-run.html @@ -24,7 +24,7 @@ - + diff --git a/api-flows.html b/api-flows.html index 932c23a5bd..1887577fc3 100644 --- a/api-flows.html +++ b/api-flows.html @@ -24,7 +24,7 @@ - + diff --git a/api-keys-and-authentication.html b/api-keys-and-authentication.html index 1eaf56dc6a..60d5e4c75d 100644 --- a/api-keys-and-authentication.html +++ b/api-keys-and-authentication.html @@ -24,7 +24,7 @@ - + diff --git a/api-logs.html b/api-logs.html index e9b7c0d326..6ab4a943e7 100644 --- a/api-logs.html +++ b/api-logs.html @@ -24,7 +24,7 @@ - + diff --git a/api-monitor.html b/api-monitor.html index f63fdd2ba2..d20b378d68 100644 --- a/api-monitor.html +++ b/api-monitor.html @@ -24,7 +24,7 @@ - + diff --git a/api-openai-responses.html b/api-openai-responses.html index 8b11f1ab2e..36c0d780cf 100644 --- a/api-openai-responses.html +++ b/api-openai-responses.html @@ -24,7 +24,7 @@ - + diff --git a/api-projects.html b/api-projects.html index b93f3e8e61..4e8bc8259e 100644 --- a/api-projects.html +++ b/api-projects.html @@ -24,7 +24,7 @@ - + diff --git a/api-reference-api-examples.html b/api-reference-api-examples.html index 8bc789dd02..42018b5243 100644 --- a/api-reference-api-examples.html +++ b/api-reference-api-examples.html @@ -24,7 +24,7 @@ - + diff --git a/api-request.html b/api-request.html index 2cf1ae700c..3ec9084afd 100644 --- a/api-request.html +++ b/api-request.html @@ -24,7 +24,7 @@ - + diff --git a/api-users.html b/api-users.html index e7ebf0d273..7e1cb6a0d4 100644 --- a/api-users.html +++ b/api-users.html @@ -24,7 +24,7 @@ - + diff --git a/api.html b/api.html index 52f32559c3..300647211c 100644 --- a/api.html +++ b/api.html @@ -24,7 +24,7 @@ - + diff --git a/api/openapi.json.html b/api/openapi.json.html index efbd60181c..89f56f62eb 100644 --- a/api/openapi.json.html +++ b/api/openapi.json.html @@ -24,7 +24,7 @@ - + diff --git a/api/openapi.yaml.html b/api/openapi.yaml.html index 32ba9ec40f..3ce856d999 100644 --- a/api/openapi.yaml.html +++ b/api/openapi.yaml.html @@ -24,7 +24,7 @@ - + diff --git a/assets/js/2eb731bc.36c717d9.js b/assets/js/2eb731bc.36c717d9.js new file mode 100644 index 0000000000..d113645948 --- /dev/null +++ b/assets/js/2eb731bc.36c717d9.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunklangflow_docs=globalThis.webpackChunklangflow_docs||[]).push([[3536],{85202:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>d,assets:()=>i,chCodeConfig:()=>p,contentTitle:()=>a,default:()=>u,frontMatter:()=>c,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Develop/configuration-custom-database","title":"Configure an external PostgreSQL database","description":"Langflow\'s default database is SQLite, but you can configure Langflow to use PostgreSQL instead.","source":"@site/docs/Develop/configuration-custom-database.mdx","sourceDirName":"Develop","slug":"/configuration-custom-database","permalink":"/configuration-custom-database","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Configure an external PostgreSQL database","slug":"/configuration-custom-database"},"sidebar":"docs","previous":{"title":"Use Session IDs","permalink":"/session-id"},"next":{"title":"Database guide for enterprise administrators","permalink":"/enterprise-database-guide"}}');var s=n(74848),r=n(28453),l=n(24754);const c={title:"Configure an external PostgreSQL database",slug:"/configuration-custom-database"},a=void 0,i={},d={annotations:l.hk,Code:l.Cy},p={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},h=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Connect Langflow to a local PostgreSQL database",id:"connect-langflow-to-a-local-postgresql-database",level:2},{value:"Deploy Langflow and PostgreSQL containers with docker-compose.yml",id:"deploy-langflow-and-postgresql-containers-with-docker-composeyml",level:2},{value:"Deploy multiple Langflow instances with a shared PostgreSQL database",id:"deploy-multiple-langflow-instances-with-a-shared-postgresql-database",level:2},{value:"See also",id:"see-also",level:2}];function g(e){const o={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return d||f("CH",!1),d.Code||f("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(o.p,{children:["Langflow's default database is ",(0,s.jsx)(o.a,{href:"https://www.sqlite.org/docs.html",children:"SQLite"}),", but you can configure Langflow to use PostgreSQL instead."]}),"\n",(0,s.jsxs)(o.p,{children:["This guide walks you through setting up an external database for Langflow by replacing the default SQLite connection string ",(0,s.jsx)(o.code,{children:"sqlite:///./langflow.db"})," with PostgreSQL, both in local and containerized environments."]}),"\n",(0,s.jsx)(o.p,{children:"In this configuration, all structured application data from Langflow, including flows, message history, and logs, is instead managed by PostgreSQL.\nPostgreSQL is better suited for production environments due to its robust support for concurrent users, advanced data integrity features, and scalability.\nLangflow can more efficiently handle multiple users and larger workloads by using PostgreSQL as the database."}),"\n",(0,s.jsx)(o.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["A ",(0,s.jsx)(o.a,{href:"https://www.pgadmin.org/download/",children:"PostgreSQL"})," database"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"connect-langflow-to-a-local-postgresql-database",children:"Connect Langflow to a local PostgreSQL database"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["If Langflow is running, stop Langflow with ",(0,s.jsx)("kbd",{children:"Ctrl+C"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Find your PostgreSQL database's connection string in the format ",(0,s.jsx)(o.code,{children:"postgresql://user:password@host:port/dbname"}),"."]}),"\n",(0,s.jsx)(o.p,{children:"The hostname in your connection string depends on how you're running PostgreSQL:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL directly on your machine, use ",(0,s.jsx)(o.code,{children:"localhost"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL in Docker Compose, use the service name, such as ",(0,s.jsx)(o.code,{children:"postgres"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL in a separate Docker container with ",(0,s.jsx)(o.code,{children:"docker run"}),", use the container's IP address or network alias."]}),"\n",(0,s.jsx)(o.li,{children:"If you're running a cloud-hosted PostgreSQL, your provider will share your connection string, which includes a username and password."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Edit or create a Langflow ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"touch .env",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["You can use the ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(o.code,{children:".env.example"})})," file in the Langflow repository as a template for your own ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In your ",(0,s.jsx)(o.code,{children:".env"})," file, set ",(0,s.jsx)(o.code,{children:"LANGFLOW_DATABASE_URL"})," to your PostgreSQL connection string:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DATABASE_URL="postgresql://user:password@localhost:5432/dbname"',props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["Langflow uses ",(0,s.jsx)(o.a,{href:"https://www.sqlalchemy.org/",children:"SQLAlchemy"})," with the ",(0,s.jsx)(o.a,{href:"https://www.psycopg.org/",children:"psycopg"})," driver to pass SSL parameters directly to the PostgreSQL connection."]}),"\n",(0,s.jsx)(o.admonition,{title:"PostgreSQL driver compatibility",type:"warning",children:(0,s.jsxs)(o.p,{children:["Langflow requires ",(0,s.jsx)(o.code,{children:"psycopg2-binary"})," or ",(0,s.jsx)(o.code,{children:"psycopg[binary]"})," as the PostgreSQL driver. The ",(0,s.jsx)(o.code,{children:"asyncpg"})," driver is not compatible with Langflow's current database schema due to stricter timezone handling requirements."]})}),"\n",(0,s.jsx)(o.p,{children:"The following SSL modes are supported:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=require"})}),": Requires SSL connection but doesn't verify server certificate. This option is the least secure, but acceptable for most use cases."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user:password@localhost:5432/dbname?sslmode=require"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=verify-ca"})}),": Requires SSL and verifies the server certificate against the Certificate Authority (CA). Add the certificate paths to your connection string:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user@localhost:5432/dbname?sslmode=verify-ca&sslcert=/path/to/client.crt&sslkey=/path/to/client.key&sslrootcert=/path/to/ca.crt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=verify-full"})}),": Requires SSL, verifies the server certificate, and checks the request hostname against the certificate hostname. The ",(0,s.jsx)(o.code,{children:"db.example.com"})," hostname in this example must match the server certificate's CN. This option is the most secure."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user@db.example.com:5432/dbname?sslmode=verify-full&sslcert=/path/to/client.crt&sslkey=/path/to/client.key&sslrootcert=/path/to/ca.crt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["Do not use the Langflow environment variables ",(0,s.jsx)(o.a,{href:"/environment-variables#server",children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_CERT_FILE"})})," and ",(0,s.jsx)(o.a,{href:"/environment-variables#server",children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_KEY_FILE"})})," for your PostgreSQL certificates: these variables are for enabling HTTPS on the Langflow server, not for PostgreSQL database connections."]}),"\n",(0,s.jsxs)(o.p,{children:["For more on managing SSL certificates in PostgreSQL, see the ",(0,s.jsx)(o.a,{href:"https://www.postgresql.org/docs/9.1/ssl-tcp.html",children:"PostgreSQL documentation"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Save your changes, and then start Langflow with your ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--env-file ",props:{style:{color:"#79C0FF"}}},{content:".env",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["For optional connection pooling and timeout settings, see ",(0,s.jsx)(o.a,{href:"/memory#configure-external-memory",children:"Configure external memory"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"In Langflow, run any flow to create traffic."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Inspect your PostgreSQL database's tables and activity to verify that new tables and traffic were created after you ran a flow."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"deploy-langflow-and-postgresql-containers-with-docker-composeyml",children:"Deploy Langflow and PostgreSQL containers with docker-compose.yml"}),"\n",(0,s.jsxs)(o.p,{children:["Launching Langflow and PostgreSQL containers in the same Docker network ensures proper connectivity between services.\nFor an example, see the ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/docker_example/docker-compose.yml",children:(0,s.jsx)(o.code,{children:"docker-compose.yml"})})," file in the Langflow repository."]}),"\n",(0,s.jsxs)(o.p,{children:["The configuration in the example ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," also sets up persistent volumes for both Langflow and PostgreSQL data.\nPersistent volumes map directories inside of containers to storage on the host machine, so data persists through container restarts."]}),"\n",(0,s.jsxs)(o.p,{children:["Docker Compose creates an isolated network for all services defined in ",(0,s.jsx)(o.code,{children:"docker-compose.yml"}),". This ensures that the services can communicate with each other using their service names as hostnames, such as ",(0,s.jsx)(o.code,{children:"postgres"})," in the database URL.\nIn contrast, if you run PostgreSQL separately with ",(0,s.jsx)(o.code,{children:"docker run"}),", it launches in a different network than the Langflow container, and this prevents Langflow from connecting to PostgreSQL using the service name."]}),"\n",(0,s.jsxs)(o.p,{children:["To start the Langflow and PostgreSQL services with the example Docker Compose file, navigate to the ",(0,s.jsx)(o.code,{children:"langflow/docker_example"})," directory, and then run ",(0,s.jsx)(o.code,{children:"docker-compose up"}),".\nIf you're using a different ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file, run the ",(0,s.jsx)(o.code,{children:"docker-compose up"})," command from the same directory as your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file."]}),"\n",(0,s.jsx)(o.h2,{id:"deploy-multiple-langflow-instances-with-a-shared-postgresql-database",children:"Deploy multiple Langflow instances with a shared PostgreSQL database"}),"\n",(0,s.jsxs)(o.p,{children:["To configure multiple Langflow instances that share the same PostgreSQL database, modify your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file to include multiple Langflow services."]}),"\n",(0,s.jsxs)(o.p,{children:["This example populates the values in ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," with values from your Langflow ",(0,s.jsx)(o.code,{children:".env"})," file.\nThis approach means you only have to manage deployment variables in one file, instead of copying values across multiple files."]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Update your ",(0,s.jsx)(o.code,{children:".env"})," file with values for your PostgreSQL database:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"POSTGRES_USER=langflow",props:{}}]},{tokens:[{content:"POSTGRES_PASSWORD=your_secure_password",props:{}}]},{tokens:[{content:"POSTGRES_DB=langflow",props:{}}]},{tokens:[{content:"POSTGRES_HOST=postgres",props:{}}]},{tokens:[{content:"POSTGRES_PORT=5432",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=app/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_PORT_1=7860",props:{}}]},{tokens:[{content:"LANGFLOW_PORT_2=7861",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=0.0.0.0",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["For optional connection pooling and timeout settings, see ",(0,s.jsx)(o.a,{href:"/memory#configure-external-memory",children:"Configure external memory"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Reference these variables in your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"}),".\nFor example:"]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"services",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" postgres",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"postgres:16",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_USER=${POSTGRES_USER}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_PASSWORD=${POSTGRES_PASSWORD}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_DB=${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${POSTGRES_PORT}:5432"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-postgres:/var/lib/postgresql/data",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-1",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" pull_policy",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"always",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${LANGFLOW_PORT_1}:7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" depends_on",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"postgres",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_CONFIG_DIR=${LANGFLOW_CONFIG_DIR}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_HOST=${LANGFLOW_HOST}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"PORT=7860",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-data-1:/app/langflow",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-2",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" pull_policy",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"always",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${LANGFLOW_PORT_2}:7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" depends_on",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"postgres",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_CONFIG_DIR=${LANGFLOW_CONFIG_DIR}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_HOST=${LANGFLOW_HOST}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"PORT=7860",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-data-2:/app/langflow",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-postgres",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-data-1",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-data-2",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Deploy the file with ",(0,s.jsx)(o.code,{children:"docker-compose up"}),".\nYou can access the first Langflow instance at ",(0,s.jsx)(o.code,{children:"http://localhost:7860"}),", and the second Langflow instance at ",(0,s.jsx)(o.code,{children:"http://localhost:7861"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To confirm both instances are using the same database, run the ",(0,s.jsx)(o.code,{children:"docker exec"})," command to start ",(0,s.jsx)(o.code,{children:"psql"})," in your PostgreSQL container.\nYour container name may vary."]}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"exec ",props:{style:{color:"#A5D6FF"}}},{content:"-it ",props:{style:{color:"#79C0FF"}}},{content:"docker-test-postgres-1 psql ",props:{style:{color:"#A5D6FF"}}},{content:"-U ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"-d ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Query the database for active connections:"}),"\n",(0,s.jsx)(d.Code,{codeConfig:p,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"langflow",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"# ",props:{style:{color:"#C9D1D9"}}},{content:"SELECT * FROM",props:{style:{color:"#FF7B72"}}},{content:" pg_stat_activity ",props:{style:{color:"#C9D1D9"}}},{content:"WHERE",props:{style:{color:"#FF7B72"}}},{content:" datname ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'langflow'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]}],lang:"sql"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Examine the query results for multiple connections with different ",(0,s.jsx)(o.code,{children:"client_addr"})," values, for example ",(0,s.jsx)(o.code,{children:"172.21.0.3"})," and ",(0,s.jsx)(o.code,{children:"172.21.0.4"}),".\nSince each Langflow instance runs in its own container on the Docker network, using different incoming IP addresses confirms that both instances are actively connected to the PostgreSQL database."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To quit ",(0,s.jsx)(o.code,{children:"psql"}),", type ",(0,s.jsx)(o.code,{children:"quit"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/memory",children:"Memory management options"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/logging",children:"Logs"})}),"\n"]})]})}function u(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function f(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/2eb731bc.e11d632a.js b/assets/js/2eb731bc.e11d632a.js deleted file mode 100644 index edb2b34897..0000000000 --- a/assets/js/2eb731bc.e11d632a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunklangflow_docs=globalThis.webpackChunklangflow_docs||[]).push([[3536],{85202:(e,o,n)=>{n.r(o),n.d(o,{CH:()=>p,assets:()=>i,chCodeConfig:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>c,metadata:()=>t,toc:()=>h});const t=JSON.parse('{"id":"Develop/configuration-custom-database","title":"Configure an external PostgreSQL database","description":"Langflow\'s default database is SQLite, but you can configure Langflow to use PostgreSQL instead.","source":"@site/docs/Develop/configuration-custom-database.mdx","sourceDirName":"Develop","slug":"/configuration-custom-database","permalink":"/configuration-custom-database","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Configure an external PostgreSQL database","slug":"/configuration-custom-database"},"sidebar":"docs","previous":{"title":"Use Session IDs","permalink":"/session-id"},"next":{"title":"Database guide for enterprise administrators","permalink":"/enterprise-database-guide"}}');var s=n(74848),r=n(28453),l=n(24754);const c={title:"Configure an external PostgreSQL database",slug:"/configuration-custom-database"},a=void 0,i={},p={annotations:l.hk,Code:l.Cy},d={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},h=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Connect Langflow to a local PostgreSQL database",id:"connect-langflow-to-a-local-postgresql-database",level:2},{value:"Deploy Langflow and PostgreSQL containers with docker-compose.yml",id:"deploy-langflow-and-postgresql-containers-with-docker-composeyml",level:2},{value:"Deploy multiple Langflow instances with a shared PostgreSQL database",id:"deploy-multiple-langflow-instances-with-a-shared-postgresql-database",level:2},{value:"See also",id:"see-also",level:2}];function g(e){const o={a:"a",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||f("CH",!1),p.Code||f("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,s.jsxs)(o.p,{children:["Langflow's default database is ",(0,s.jsx)(o.a,{href:"https://www.sqlite.org/docs.html",children:"SQLite"}),", but you can configure Langflow to use PostgreSQL instead."]}),"\n",(0,s.jsxs)(o.p,{children:["This guide walks you through setting up an external database for Langflow by replacing the default SQLite connection string ",(0,s.jsx)(o.code,{children:"sqlite:///./langflow.db"})," with PostgreSQL, both in local and containerized environments."]}),"\n",(0,s.jsx)(o.p,{children:"In this configuration, all structured application data from Langflow, including flows, message history, and logs, is instead managed by PostgreSQL.\nPostgreSQL is better suited for production environments due to its robust support for concurrent users, advanced data integrity features, and scalability.\nLangflow can more efficiently handle multiple users and larger workloads by using PostgreSQL as the database."}),"\n",(0,s.jsx)(o.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["A ",(0,s.jsx)(o.a,{href:"https://www.pgadmin.org/download/",children:"PostgreSQL"})," database"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"connect-langflow-to-a-local-postgresql-database",children:"Connect Langflow to a local PostgreSQL database"}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["If Langflow is running, stop Langflow with ",(0,s.jsx)("kbd",{children:"Ctrl+C"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Find your PostgreSQL database's connection string in the format ",(0,s.jsx)(o.code,{children:"postgresql://user:password@host:port/dbname"}),"."]}),"\n",(0,s.jsx)(o.p,{children:"The hostname in your connection string depends on how you're running PostgreSQL:"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL directly on your machine, use ",(0,s.jsx)(o.code,{children:"localhost"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL in Docker Compose, use the service name, such as ",(0,s.jsx)(o.code,{children:"postgres"}),"."]}),"\n",(0,s.jsxs)(o.li,{children:["If you're running PostgreSQL in a separate Docker container with ",(0,s.jsx)(o.code,{children:"docker run"}),", use the container's IP address or network alias."]}),"\n",(0,s.jsx)(o.li,{children:"If you're running a cloud-hosted PostgreSQL, your provider will share your connection string, which includes a username and password."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Edit or create a Langflow ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"touch .env",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["You can use the ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/.env.example",children:(0,s.jsx)(o.code,{children:".env.example"})})," file in the Langflow repository as a template for your own ",(0,s.jsx)(o.code,{children:".env"})," file."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["In your ",(0,s.jsx)(o.code,{children:".env"})," file, set ",(0,s.jsx)(o.code,{children:"LANGFLOW_DATABASE_URL"})," to your PostgreSQL connection string:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:'LANGFLOW_DATABASE_URL="postgresql://user:password@localhost:5432/dbname"',props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["Langflow uses ",(0,s.jsx)(o.a,{href:"https://www.sqlalchemy.org/",children:"SQLAlchemy"})," with the ",(0,s.jsx)(o.a,{href:"https://www.psycopg.org/",children:"psycopg"})," driver to pass SSL parameters directly to the PostgreSQL connection. The following SSL modes are supported:"]}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=require"})}),": Requires SSL connection but doesn't verify server certificate. This option is the least secure, but acceptable for most use cases."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user:password@localhost:5432/dbname?sslmode=require"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=verify-ca"})}),": Requires SSL and verifies the server certificate against the Certificate Authority (CA). Add the certificate paths to your connection string:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user@localhost:5432/dbname?sslmode=verify-ca&sslcert=/path/to/client.crt&sslkey=/path/to/client.key&sslrootcert=/path/to/ca.crt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:[(0,s.jsx)(o.strong,{children:(0,s.jsx)(o.code,{children:"sslmode=verify-full"})}),": Requires SSL, verifies the server certificate, and checks the request hostname against the certificate hostname. The ",(0,s.jsx)(o.code,{children:"db.example.com"})," hostname in this example must match the server certificate's CN. This option is the most secure."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"LANGFLOW_DATABASE_URL",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"postgresql://user@db.example.com:5432/dbname?sslmode=verify-full&sslcert=/path/to/client.crt&sslkey=/path/to/client.key&sslrootcert=/path/to/ca.crt"',props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["Do not use the Langflow environment variables ",(0,s.jsx)(o.a,{href:"/environment-variables#server",children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_CERT_FILE"})})," and ",(0,s.jsx)(o.a,{href:"/environment-variables#server",children:(0,s.jsx)(o.code,{children:"LANGFLOW_SSL_KEY_FILE"})})," for your PostgreSQL certificates: these variables are for enabling HTTPS on the Langflow server, not for PostgreSQL database connections."]}),"\n",(0,s.jsxs)(o.p,{children:["For more on managing SSL certificates in PostgreSQL, see the ",(0,s.jsx)(o.a,{href:"https://www.postgresql.org/docs/9.1/ssl-tcp.html",children:"PostgreSQL documentation"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Save your changes, and then start Langflow with your ",(0,s.jsx)(o.code,{children:".env"})," file:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"uv ",props:{style:{color:"#FFA657"}}},{content:"run langflow run ",props:{style:{color:"#A5D6FF"}}},{content:"--env-file ",props:{style:{color:"#79C0FF"}}},{content:".env",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["For optional connection pooling and timeout settings, see ",(0,s.jsx)(o.a,{href:"/memory#configure-external-memory",children:"Configure external memory"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"In Langflow, run any flow to create traffic."}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Inspect your PostgreSQL database's tables and activity to verify that new tables and traffic were created after you ran a flow."}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"deploy-langflow-and-postgresql-containers-with-docker-composeyml",children:"Deploy Langflow and PostgreSQL containers with docker-compose.yml"}),"\n",(0,s.jsxs)(o.p,{children:["Launching Langflow and PostgreSQL containers in the same Docker network ensures proper connectivity between services.\nFor an example, see the ",(0,s.jsx)(o.a,{href:"https://github.com/langflow-ai/langflow/blob/main/docker_example/docker-compose.yml",children:(0,s.jsx)(o.code,{children:"docker-compose.yml"})})," file in the Langflow repository."]}),"\n",(0,s.jsxs)(o.p,{children:["The configuration in the example ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," also sets up persistent volumes for both Langflow and PostgreSQL data.\nPersistent volumes map directories inside of containers to storage on the host machine, so data persists through container restarts."]}),"\n",(0,s.jsxs)(o.p,{children:["Docker Compose creates an isolated network for all services defined in ",(0,s.jsx)(o.code,{children:"docker-compose.yml"}),". This ensures that the services can communicate with each other using their service names as hostnames, such as ",(0,s.jsx)(o.code,{children:"postgres"})," in the database URL.\nIn contrast, if you run PostgreSQL separately with ",(0,s.jsx)(o.code,{children:"docker run"}),", it launches in a different network than the Langflow container, and this prevents Langflow from connecting to PostgreSQL using the service name."]}),"\n",(0,s.jsxs)(o.p,{children:["To start the Langflow and PostgreSQL services with the example Docker Compose file, navigate to the ",(0,s.jsx)(o.code,{children:"langflow/docker_example"})," directory, and then run ",(0,s.jsx)(o.code,{children:"docker-compose up"}),".\nIf you're using a different ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file, run the ",(0,s.jsx)(o.code,{children:"docker-compose up"})," command from the same directory as your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file."]}),"\n",(0,s.jsx)(o.h2,{id:"deploy-multiple-langflow-instances-with-a-shared-postgresql-database",children:"Deploy multiple Langflow instances with a shared PostgreSQL database"}),"\n",(0,s.jsxs)(o.p,{children:["To configure multiple Langflow instances that share the same PostgreSQL database, modify your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," file to include multiple Langflow services."]}),"\n",(0,s.jsxs)(o.p,{children:["This example populates the values in ",(0,s.jsx)(o.code,{children:"docker-compose.yml"})," with values from your Langflow ",(0,s.jsx)(o.code,{children:".env"})," file.\nThis approach means you only have to manage deployment variables in one file, instead of copying values across multiple files."]}),"\n",(0,s.jsxs)(o.ol,{children:["\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Update your ",(0,s.jsx)(o.code,{children:".env"})," file with values for your PostgreSQL database:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"POSTGRES_USER=langflow",props:{}}]},{tokens:[{content:"POSTGRES_PASSWORD=your_secure_password",props:{}}]},{tokens:[{content:"POSTGRES_DB=langflow",props:{}}]},{tokens:[{content:"POSTGRES_HOST=postgres",props:{}}]},{tokens:[{content:"POSTGRES_PORT=5432",props:{}}]},{tokens:[{content:"LANGFLOW_CONFIG_DIR=app/langflow",props:{}}]},{tokens:[{content:"LANGFLOW_PORT_1=7860",props:{}}]},{tokens:[{content:"LANGFLOW_PORT_2=7861",props:{}}]},{tokens:[{content:"LANGFLOW_HOST=0.0.0.0",props:{}}]}],lang:"text"},annotations:[]}]}),"\n",(0,s.jsxs)(o.p,{children:["For optional connection pooling and timeout settings, see ",(0,s.jsx)(o.a,{href:"/memory#configure-external-memory",children:"Configure external memory"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Reference these variables in your ",(0,s.jsx)(o.code,{children:"docker-compose.yml"}),".\nFor example:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"services",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" postgres",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"postgres:16",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_USER=${POSTGRES_USER}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_PASSWORD=${POSTGRES_PASSWORD}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"POSTGRES_DB=${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${POSTGRES_PORT}:5432"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-postgres:/var/lib/postgresql/data",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-1",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" pull_policy",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"always",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${LANGFLOW_PORT_1}:7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" depends_on",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"postgres",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_CONFIG_DIR=${LANGFLOW_CONFIG_DIR}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_HOST=${LANGFLOW_HOST}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"PORT=7860",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-data-1:/app/langflow",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-2",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" image",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"langflowai/langflow:latest",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" pull_policy",props:{style:{color:"#7EE787"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"always",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ports",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:'"${LANGFLOW_PORT_2}:7860"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" depends_on",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"postgres",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" environment",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_CONFIG_DIR=${LANGFLOW_CONFIG_DIR}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"LANGFLOW_HOST=${LANGFLOW_HOST}",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"PORT=7860",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" - ",props:{style:{color:"#C9D1D9"}}},{content:"langflow-data-2:/app/langflow",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"volumes",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-postgres",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-data-1",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" langflow-data-2",props:{style:{color:"#7EE787"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]}],lang:"yaml"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Deploy the file with ",(0,s.jsx)(o.code,{children:"docker-compose up"}),".\nYou can access the first Langflow instance at ",(0,s.jsx)(o.code,{children:"http://localhost:7860"}),", and the second Langflow instance at ",(0,s.jsx)(o.code,{children:"http://localhost:7861"}),"."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To confirm both instances are using the same database, run the ",(0,s.jsx)(o.code,{children:"docker exec"})," command to start ",(0,s.jsx)(o.code,{children:"psql"})," in your PostgreSQL container.\nYour container name may vary."]}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"docker ",props:{style:{color:"#FFA657"}}},{content:"exec ",props:{style:{color:"#A5D6FF"}}},{content:"-it ",props:{style:{color:"#79C0FF"}}},{content:"docker-test-postgres-1 psql ",props:{style:{color:"#A5D6FF"}}},{content:"-U ",props:{style:{color:"#79C0FF"}}},{content:"langflow ",props:{style:{color:"#A5D6FF"}}},{content:"-d ",props:{style:{color:"#79C0FF"}}},{content:"langflow",props:{style:{color:"#A5D6FF"}}}]}],lang:"bash"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsx)(o.p,{children:"Query the database for active connections:"}),"\n",(0,s.jsx)(p.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"langflow",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"# ",props:{style:{color:"#C9D1D9"}}},{content:"SELECT * FROM",props:{style:{color:"#FF7B72"}}},{content:" pg_stat_activity ",props:{style:{color:"#C9D1D9"}}},{content:"WHERE",props:{style:{color:"#FF7B72"}}},{content:" datname ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"'langflow'",props:{style:{color:"#A5D6FF"}}},{content:";",props:{style:{color:"#C9D1D9"}}}]}],lang:"sql"},annotations:[]}]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["Examine the query results for multiple connections with different ",(0,s.jsx)(o.code,{children:"client_addr"})," values, for example ",(0,s.jsx)(o.code,{children:"172.21.0.3"})," and ",(0,s.jsx)(o.code,{children:"172.21.0.4"}),".\nSince each Langflow instance runs in its own container on the Docker network, using different incoming IP addresses confirms that both instances are actively connected to the PostgreSQL database."]}),"\n"]}),"\n",(0,s.jsxs)(o.li,{children:["\n",(0,s.jsxs)(o.p,{children:["To quit ",(0,s.jsx)(o.code,{children:"psql"}),", type ",(0,s.jsx)(o.code,{children:"quit"}),"."]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(o.h2,{id:"see-also",children:"See also"}),"\n",(0,s.jsxs)(o.ul,{children:["\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/enterprise-database-guide",children:"Langflow database guide for enterprise DBAs"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/memory",children:"Memory management options"})}),"\n",(0,s.jsx)(o.li,{children:(0,s.jsx)(o.a,{href:"/logging",children:"Logs"})}),"\n"]})]})}function u(e={}){const{wrapper:o}={...(0,r.R)(),...e.components};return o?(0,s.jsx)(o,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}function f(e,o){throw new Error("Expected "+(o?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]); \ No newline at end of file diff --git a/assets/js/e1a0f423.976a77d3.js b/assets/js/e1a0f423.976a77d3.js deleted file mode 100644 index 0b2e9eb73a..0000000000 --- a/assets/js/e1a0f423.976a77d3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(globalThis.webpackChunklangflow_docs=globalThis.webpackChunklangflow_docs||[]).push([[4341],{11470:(e,n,o)=>{o.d(n,{A:()=>k});var t=o(96540),s=o(18215),r=o(17559),i=o(23104),l=o(56347),a=o(205),c=o(57485),d=o(31682),u=o(70679);function h(e){return t.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Badwebrtcvad package",id:"installation-failure-from-webrtcvad-package",level:3},{value:"Protocol buffers (protoc) required for Intel-based Macs",id:"protocol-buffers-protoc-required-for-intel-based-macs",level:3},{value:"C++ build tools required for Langflow Desktop on Windows",id:"c-build-tools-required-for-langflow-desktop-on-windows",level:3},{value:"Langflow startup issues",id:"langflow-startup-issues",level:2},{value:"No langflow.__main__ module",id:"no-langflow__main__-module",level:3},{value:"Langflow runTraceback",id:"langflow-runtraceback",level:3},{value:"Environment variables not available from terminal",id:"environment-variables-not-available-from-terminal",level:3},{value:"Access Langflow Desktop startup logs",id:"access-langflow-desktop-startup-logs",level:3},{value:"User not found or inactive when running multiple flows",id:"user-not-found-or-inactive-when-running-multiple-flows",level:3},{value:"Package is not installed",id:"package-is-not-installed",level:3},{value:"An API key must be passed as query or header",id:"an-api-key-must-be-passed-as-query-or-header",level:3},{value:"Langflow upgrade issues",id:"langflow-upgrade-issues",level:2},{value:"Something went wrong running migrations",id:"something-went-wrong-running-migrations",level:3},{value:"Langflow Desktop says it is running the latest version, but it is actually behind",id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",level:3},{value:"422 error when freezing components after upgrading Pydantic/FastAPI dependencies",id:"422-error-when-freezing-components-after-upgrading-pydanticfastapi-dependencies",level:3},{value:"Langflow uninstall issues",id:"langflow-uninstall-issues",level:2},{value:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS",id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",level:3},{value:"Langflow MCP issues",id:"mcp",level:2},{value:"Claude for Desktop doesn't use MCP server tools correctly",id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",level:3},{value:"MCP browser-based flows don't open a browser on Windows",id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",level:3},{value:""No tools or prompts connected" on MCP servers in mixed Windows/WSL environments",id:"no-tools-or-prompts-connected-on-mcp-servers-in-mixed-windowswsl-environments",level:3},{value:"Token length limit errors in Embedding Model components",id:"token-length-limit-errors-in-embedding-model-components",level:2},{value:"Document processing errors in Docker containers",id:"document-processing-errors-in-docker-containers",level:2},{value:"Custom components and integrations issues",id:"custom-components-and-integrations-issues",level:2},{value:"Custom components not appearing in the visual editor",id:"custom-components-not-appearing-in-the-visual-editor",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||y("CH",!1),p.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow."}),"\n",(0,s.jsx)(n.h2,{id:"missing-components",children:"Missing components"}),"\n",(0,s.jsx)(n.p,{children:"As Langflow development continues, components are often recategorized or deprecated for better alignment or to prepare for new components."}),"\n",(0,s.jsxs)(n.p,{children:["If a component appears to be missing from the ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," and menus, try the following:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(c.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for the component."]}),"\n",(0,s.jsxs)(n.li,{children:["Check other component categories and ",(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Check ",(0,s.jsx)(n.a,{href:"/concepts-components#legacy-components",children:"legacy components"}),", which are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:["Check the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"})," for component changes in recent releases."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the component isn't already present in your flow if it is a single-use component."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you still cannot locate the component, see ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"no-input-in-the-playground",children:"No input in the Playground"}),"\n",(0,s.jsxs)(n.p,{children:["If there is no message input field in the ",(0,s.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,s.jsxs)(n.a,{href:"/chat-input-and-output",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," component"]})," that is connected, directly or indirectly, to the ",(0,s.jsx)(n.strong,{children:"Input"})," port of a ",(0,s.jsx)(n.strong,{children:"Language Model"})," or ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["Because the ",(0,s.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,s.jsx)(n.strong,{children:"Chat Input"}),", ",(0,s.jsx)(n.strong,{children:"Language Model"}),"/",(0,s.jsx)(n.strong,{children:"Agent"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,s.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"missing-key-no-key-found-or-invalid-api-key",children:"Missing key, no key found, or invalid API key"}),"\n",(0,s.jsx)(n.p,{children:"If you get an API key error when running a flow, try the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For all components that require credentials, make sure those components have a valid credential in the component's settings, such as the ",(0,s.jsx)(n.strong,{children:"API Key"})," field."]}),"\n",(0,s.jsxs)(n.li,{children:["If you store your credentials in ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),", make sure you selected the correct global variable and that the variable contains a valid credential."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the provided credentials are active, have the required permissions, and, if applicable, have sufficient funds in the account to execute the required action. For example, model providers require credits to use their LLMs."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-installation-issues",children:"Langflow installation issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when installing Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"langflow-installation-freezes-at-pip-dependency-resolution",children:"Langflow installation freezes at pip dependency resolution"}),"\n",(0,s.jsxs)(n.p,{children:["Installing Langflow OSS with ",(0,s.jsx)(n.code,{children:"pip install langflow"})," slowly fails with this error message:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"pip is looking at multiple versions of <webrtcvad package",id:"installation-failure-from-webrtcvad-package",level:3},{value:"Protocol buffers (protoc) required for Intel-based Macs",id:"protocol-buffers-protoc-required-for-intel-based-macs",level:3},{value:"C++ build tools required for Langflow Desktop on Windows",id:"c-build-tools-required-for-langflow-desktop-on-windows",level:3},{value:"Langflow startup issues",id:"langflow-startup-issues",level:2},{value:"No langflow.__main__ module",id:"no-langflow__main__-module",level:3},{value:"Langflow runTraceback",id:"langflow-runtraceback",level:3},{value:"Environment variables not available from terminal",id:"environment-variables-not-available-from-terminal",level:3},{value:"Access Langflow Desktop startup logs",id:"access-langflow-desktop-startup-logs",level:3},{value:"User not found or inactive when running multiple flows",id:"user-not-found-or-inactive-when-running-multiple-flows",level:3},{value:"Package is not installed",id:"package-is-not-installed",level:3},{value:"PostgreSQL asyncpg driver compatibility issue",id:"postgresql-asyncpg-driver-compatibility-issue",level:3},{value:"An API key must be passed as query or header",id:"an-api-key-must-be-passed-as-query-or-header",level:3},{value:"Langflow upgrade issues",id:"langflow-upgrade-issues",level:2},{value:"Something went wrong running migrations",id:"something-went-wrong-running-migrations",level:3},{value:"Langflow Desktop says it is running the latest version, but it is actually behind",id:"langflow-desktop-says-it-is-running-the-latest-version-but-it-is-actually-behind",level:3},{value:"422 error when freezing components after upgrading Pydantic/FastAPI dependencies",id:"422-error-when-freezing-components-after-upgrading-pydanticfastapi-dependencies",level:3},{value:"Langflow uninstall issues",id:"langflow-uninstall-issues",level:2},{value:"Dot directory isn't deleted when uninstalling Langflow Desktop on macOS",id:"dot-directory-isnt-deleted-when-uninstalling-langflow-desktop-on-macos",level:3},{value:"Langflow MCP issues",id:"mcp",level:2},{value:"Claude for Desktop doesn't use MCP server tools correctly",id:"claude-for-desktop-doesnt-use-mcp-server-tools-correctly",level:3},{value:"MCP browser-based flows don't open a browser on Windows",id:"mcp-browser-based-flows-dont-open-a-browser-on-windows",level:3},{value:""No tools or prompts connected" on MCP servers in mixed Windows/WSL environments",id:"no-tools-or-prompts-connected-on-mcp-servers-in-mixed-windowswsl-environments",level:3},{value:"Token length limit errors in Embedding Model components",id:"token-length-limit-errors-in-embedding-model-components",level:2},{value:"Document processing errors in Docker containers",id:"document-processing-errors-in-docker-containers",level:2},{value:"Custom components and integrations issues",id:"custom-components-and-integrations-issues",level:2},{value:"Custom components not appearing in the visual editor",id:"custom-components-not-appearing-in-the-visual-editor",level:3},{value:"See also",id:"see-also",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return p||y("CH",!1),p.Code||y("CH.Code",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n","\n",(0,s.jsx)(n.p,{children:"This page provides troubleshooting advice for issues you might encounter when using Langflow or contributing to Langflow."}),"\n",(0,s.jsx)(n.h2,{id:"missing-components",children:"Missing components"}),"\n",(0,s.jsx)(n.p,{children:"As Langflow development continues, components are often recategorized or deprecated for better alignment or to prepare for new components."}),"\n",(0,s.jsxs)(n.p,{children:["If a component appears to be missing from the ",(0,s.jsx)(c.A,{name:"Component","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Core components"})," and menus, try the following:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(c.A,{name:"Search","aria-hidden":"true"})," ",(0,s.jsx)(n.strong,{children:"Search"})," for the component."]}),"\n",(0,s.jsxs)(n.li,{children:["Check other component categories and ",(0,s.jsx)(c.A,{name:"Blocks","aria-hidden":"true"})," ",(0,s.jsx)(n.a,{href:"/components-bundle-components",children:(0,s.jsx)(n.strong,{children:"Bundles"})}),"."]}),"\n",(0,s.jsxs)(n.li,{children:["Check ",(0,s.jsx)(n.a,{href:"/concepts-components#legacy-components",children:"legacy components"}),", which are hidden by default."]}),"\n",(0,s.jsxs)(n.li,{children:["Check the ",(0,s.jsx)(n.a,{href:"https://github.com/langflow-ai/langflow/releases/latest",children:"Changelog"})," for component changes in recent releases."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the component isn't already present in your flow if it is a single-use component."}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["If you still cannot locate the component, see ",(0,s.jsx)(n.a,{href:"/contributing-github-issues",children:"Langflow GitHub Issues and Discussions"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"no-input-in-the-playground",children:"No input in the Playground"}),"\n",(0,s.jsxs)(n.p,{children:["If there is no message input field in the ",(0,s.jsx)(n.strong,{children:"Playground"}),", make sure your flow has a ",(0,s.jsxs)(n.a,{href:"/chat-input-and-output",children:[(0,s.jsx)(n.strong,{children:"Chat Input"})," component"]})," that is connected, directly or indirectly, to the ",(0,s.jsx)(n.strong,{children:"Input"})," port of a ",(0,s.jsx)(n.strong,{children:"Language Model"})," or ",(0,s.jsx)(n.strong,{children:"Agent"})," component."]}),"\n",(0,s.jsxs)(n.p,{children:["Because the ",(0,s.jsx)(n.strong,{children:"Playground"})," is designed for flows that use an LLM in a query-and-response format, such as chatbots and agents, a flow must have ",(0,s.jsx)(n.strong,{children:"Chat Input"}),", ",(0,s.jsx)(n.strong,{children:"Language Model"}),"/",(0,s.jsx)(n.strong,{children:"Agent"}),", and ",(0,s.jsx)(n.strong,{children:"Chat Output"})," components to be fully supported by the ",(0,s.jsx)(n.strong,{children:"Playground"})," chat interface."]}),"\n",(0,s.jsxs)(n.p,{children:["For more information, see ",(0,s.jsx)(n.a,{href:"/concepts-playground",children:"Test flows in the Playground"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"missing-key-no-key-found-or-invalid-api-key",children:"Missing key, no key found, or invalid API key"}),"\n",(0,s.jsx)(n.p,{children:"If you get an API key error when running a flow, try the following:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["For all components that require credentials, make sure those components have a valid credential in the component's settings, such as the ",(0,s.jsx)(n.strong,{children:"API Key"})," field."]}),"\n",(0,s.jsxs)(n.li,{children:["If you store your credentials in ",(0,s.jsx)(n.a,{href:"/configuration-global-variables",children:"Langflow global variables"}),", make sure you selected the correct global variable and that the variable contains a valid credential."]}),"\n",(0,s.jsx)(n.li,{children:"Make sure the provided credentials are active, have the required permissions, and, if applicable, have sufficient funds in the account to execute the required action. For example, model providers require credits to use their LLMs."}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"langflow-installation-issues",children:"Langflow installation issues"}),"\n",(0,s.jsx)(n.p,{children:"The following issues can occur when installing Langflow."}),"\n",(0,s.jsx)(n.h3,{id:"langflow-installation-freezes-at-pip-dependency-resolution",children:"Langflow installation freezes at pip dependency resolution"}),"\n",(0,s.jsxs)(n.p,{children:["Installing Langflow OSS with ",(0,s.jsx)(n.code,{children:"pip install langflow"})," slowly fails with this error message:"]}),"\n",(0,s.jsx)(p.Code,{codeConfig:g,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"pip is looking at multiple versions of <In your .env file, set LANGFLOW_DATABASE_URL to your PostgreSQL connection string:
_10LANGFLOW_DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
Langflow uses SQLAlchemy with the psycopg driver to pass SSL parameters directly to the PostgreSQL connection. The following SSL modes are supported:
+Langflow uses SQLAlchemy with the psycopg driver to pass SSL parameters directly to the PostgreSQL connection.
+Langflow requires psycopg2-binary or psycopg[binary] as the PostgreSQL driver. The asyncpg driver is not compatible with Langflow's current database schema due to stricter timezone handling requirements.
The following SSL modes are supported:
sslmode=require: Requires SSL connection but doesn't verify server certificate. This option is the least secure, but acceptable for most use cases.
In Langflow OSS, you can follow the error message's instructions to install the missing dependency.
To manage dependencies in Langflow Desktop, see Install custom dependencies in Langflow Desktop.
+The following error can occur when initializing Langflow with a PostgreSQL database:
+
_10sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.DataError'>: invalid input for query argument $7: datetime.datetime(2025, 10, 31, 14, 8, 5... (can't subtract offset-naive and offset-aware datetimes)
This error occurs because asyncpg has stricter timezone handling than psycopg2, and is not fully compatible with Langflow's current database schema.
To resolve this issue, remove asyncpg from your installation and use psycopg2 instead.
The following error can occur when attempting to sign up on the Langflow sign in page: An API key must be passed as query or header.
This means that Ensure your components follow the required directory structure. Verify each category directory includes an LANGFLOW_AUTO_LOGIN is set to false, and only superusers can create and activate non-superuser accounts.
@@ -210,7 +215,7 @@ For more information, see Tokenization
__init__.py file.
@@ -227,7 +232,7 @@ If you're using the LANGFLOW_COMPONENTS_PATH environment varia