Files
langflow/deployment-multi-worker.html
2026-06-25 13:37:38 +00:00

169 lines
75 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-1.10.0 docs-doc-page docs-doc-id-Deployment/deployment-multi-worker" data-has-hydrated="false">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v3.9.2">
<title data-rh="true">Deploy Langflow with multiple workers | Langflow Documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.langflow.org/deployment-multi-worker"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="1.10.0"><meta data-rh="true" name="docusaurus_tag" content="docs-default-1.10.0"><meta data-rh="true" name="docsearch:version" content="1.10.0"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-1.10.0"><meta data-rh="true" property="og:title" content="Deploy Langflow with multiple workers | Langflow Documentation"><meta data-rh="true" name="description" content="By default, Langflow runs with a single worker process and stores build job state in memory."><meta data-rh="true" property="og:description" content="By default, Langflow runs with a single worker process and stores build job state in memory."><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://docs.langflow.org/deployment-multi-worker"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/deployment-multi-worker" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.langflow.org/deployment-multi-worker" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://UZK6BDPCVY-dsn.algolia.net" crossorigin="anonymous"><script data-rh="true" type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Deploy Langflow with multiple workers","item":"https://docs.langflow.org/deployment-multi-worker"}]}</script><link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SLQFLQ3KPT"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-SLQFLQ3KPT",{})</script>
<link rel="search" type="application/opensearchdescription+xml" title="Langflow Documentation" href="/opensearch.xml">
<script>window._ibmAnalytics={settings:{name:"DataStax",tealiumProfileName:"ibm-subsidiary"},trustarc:{privacyPolicyLink:"https://ibm.com/privacy"},"digitalData.page.services.google.enabled":!0},window.digitalData={page:{pageInfo:{ibm:{siteId:"IBM_"+_ibmAnalytics.settings.name},segment:{enabled:!0,env:"prod",key:"B04fNhD06DqDPuaRfQl5lZ2iQICdxxuh",coremetrics:!1,carbonComponentEvents:!1}},category:{primaryCategory:"PC230"}},commonProperties:{productTitle:"IBM Elite Support for Langflow",productCode:"5900BUB",productCodeType:"WWPC",UT30:"30AS5",instanceId:"docs-site",subscriptionId:"public-access",productPlanName:"Public",productPlanType:"freemium",userId:"IBMid-ANONYMOUS"}}</script>
<script src="//1.www.s81c.com/common/stats/ibm-common.js" async="true"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&amp;family=Geist+Mono:wght@400;500&amp;family=Sora:wght@550;600&amp;display=swap">
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied"})</script>
<script>!function(){function e(){if(void 0!==window.truste&&window.truste.cma){var e=window.truste.cma.callApi("getConsent",window.location.href)||{},n=1===e[2],t=1===e[3];gtag("consent","update",{ad_storage:n?"granted":"denied",ad_user_data:n?"granted":"denied",ad_personalization:n?"granted":"denied",analytics_storage:t?"granted":"denied"})}}window.addEventListener&&(window.addEventListener("cm_data_subject_consent_changed",e),window.addEventListener("cm_consent_preferences_set",e)),"complete"===document.readyState?e():window.addEventListener("load",e)}()</script><link rel="stylesheet" href="/assets/css/styles.0d9d771d.css">
<script src="/assets/js/runtime~main.c313665b.js" defer="defer"></script>
<script src="/assets/js/main.12b252df.js" defer="defer"></script>
</head>
<body class="navigation-with-keyboard">
<svg style="display: none;"><defs>
<symbol id="theme-svg-external-link" viewBox="0 0 24 24"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol>
</defs></svg>
<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="theme-layout-navbar navbar navbar--fixed-top"><div class="navbar__inner"><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/lf-docs-light.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/lf-docs-dark.svg" alt="Langflow" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a><div class="navbar__item dropdown dropdown--hoverable"><a aria-current="page" class="navbar__link active" aria-haspopup="true" aria-expanded="false" role="button" href="/deployment-multi-worker">1.10.x</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/next/deployment-multi-worker">1.11.x (Next)</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/deployment-multi-worker">1.10.x</a></li><li><a class="dropdown__link" href="/1.9.0">1.9.x</a></li><li><a class="dropdown__link" href="/1.8.0">1.8.x</a></li></ul></div></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><a href="https://github.com/langflow-ai/langflow" target="_blank" class="navbar__item navbar__link header-github-link" aria-label="GitHub" data-event="UI Interaction" data-action="clicked" data-channel="docs" data-element-id="social-github" data-namespace="header" data-platform-title="Langflow"></a><a href="https://twitter.com/langflow_ai" target="_blank" class="navbar__item navbar__link header-twitter-link" aria-label="Twitter" data-event="UI Interaction" data-action="clicked" data-channel="docs" data-element-id="social-twitter" data-namespace="header" data-platform-title="Langflow"></a><a href="https://discord.gg/EqksyE2EX9" target="_blank" class="navbar__item navbar__link header-discord-link" aria-label="Discord" data-event="UI Interaction" data-action="clicked" data-channel="docs" data-element-id="social-discord" data-namespace="header" data-platform-title="Langflow"></a><div class="toggle_MW0i colorModeToggle_DEke"><button class="clean-btn toggleButton_yw5v toggleButtonDisabled_BJd7" type="button" disabled="" title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false" role="presentation" class="toggleIcon_oIOL lightToggleIcon_SFTY"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false" role="presentation" class="toggleIcon_oIOL darkToggleIcon_ekgs"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false" role="presentation" class="toggleIcon_oIOL systemToggleIcon_yi_a"><path fill="currentColor" d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search (Meta+k)" aria-keyshortcuts="Meta+k"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="8" stroke="currentColor" fill="none" stroke-width="1.4"></circle><path d="m21 21-4.3-4.3" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside aria-label="Documentation sidebar" class="theme-doc-sidebar-container docSidebarContainer_RSuS"><div class="sidebarViewport_pYEE"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-group-divider"><div class="sidebar-group-label">Build</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-rocket"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/"><span title="Get started" class="categoryLinkLabel_W154">Get started</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-workflow"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/concepts-overview"><span title="Flows" class="categoryLinkLabel_W154">Flows</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-bot"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/agents"><span title="Agents" class="categoryLinkLabel_W154">Agents</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-plug"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/mcp-client"><span title="Model Context Protocol (MCP)" class="categoryLinkLabel_W154">Model Context Protocol (MCP)</span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-group-divider"><div class="sidebar-group-label">Develop & Deploy</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-code"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/api-keys-and-authentication"><span title="Develop" class="categoryLinkLabel_W154">Develop</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item sidebar-category-with-icon sidebar-icon-cloud"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" href="/deployment-overview"><span title="Deploy" class="categoryLinkLabel_W154">Deploy</span></a></div><ul class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/deployment-overview"><span title="Langflow deployment overview" class="linkLabel_WmDU">Langflow deployment overview</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/deployment-public-server"><span title="Deploy a public Langflow server" class="linkLabel_WmDU">Deploy a public Langflow server</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/deployment-nginx-ssl"><span title="Deploy Langflow with Nginx and SSL" class="linkLabel_WmDU">Deploy Langflow with Nginx and SSL</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/deployment-wxo"><span title="Deploy flows on watsonx Orchestrate" class="linkLabel_WmDU">Deploy flows on watsonx Orchestrate</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/develop-application"><span title="Containerized deployments" class="categoryLinkLabel_W154">Containerized deployments</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/deployment-gcp"><span title="Cloud platforms" class="categoryLinkLabel_W154">Cloud platforms</span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/deployment-multi-worker"><span title="Deploy Langflow with multiple workers" class="linkLabel_WmDU">Deploy Langflow with multiple workers</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/lfx-compatibility"><span title="LFX and Langflow version compatibility" class="linkLabel_WmDU">LFX and Langflow version compatibility</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/deployment-block-custom-components"><span title="Block custom components" class="linkLabel_WmDU">Block custom components</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/security"><span title="Security" class="linkLabel_WmDU">Security</span></a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-group-divider"><div class="sidebar-group-label">Reference</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-blocks"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/concepts-components"><span title="Components reference" class="categoryLinkLabel_W154">Components reference</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-fileCode"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/api-reference-api-examples"><span title="API reference" class="categoryLinkLabel_W154">API reference</span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-group-divider"><div class="sidebar-group-label">Community</div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-gitPR"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/contributing-community"><span title="Contribute" class="categoryLinkLabel_W154">Contribute</span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed sidebar-category-with-icon sidebar-icon-helpCircle"><div class="menu__list-item-collapsible"><a class="categoryLink_byQd menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/troubleshoot"><span title="Support" class="categoryLinkLabel_W154">Support</span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 sidebar-ad">
<a href="https://www.langflow.org/desktop" target="_blank" rel="noopener noreferrer" class="menu__link">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<g clip-path="url(#clip0_1645_37)">
<path d="M12 17H20C21.1046 17 22 16.1046 22 15V13M12 17H4C2.89543 17 2 16.1046 2 15V5C2 3.89543 2.89543 3 4 3H10M12 17V21M8 21H12M12 21H16M11.75 10.2917H13.2083L16.125 7.375H17.5833L20.5 4.45833H21.9583M16.125 11.75H17.5833L20.5 8.83333H21.9583M11.75 5.91667H13.2083L16.125 3H17.5833" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_1645_37">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
<div class="sidebar-ad-text-container">
<span class="sidebar-ad-text">Get started in minutes</span>
<span class="sidebar-ad-text sidebar-ad-text-gradient">Download Langflow Desktop</span>
</div>
</a>
</li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_z5aJ"><div class="docItemContainer_c0TR"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" role="presentation" class="breadcrumbHomeIcon_xK9p"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Deploy</span></li><li class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link">Deploy Langflow with multiple workers</span></li></ul></nav><div class="docMetaRow_c2hx"><div class="root_Eutc"><button type="button" class="button_gpNY"><span aria-hidden="true" class="icon_Bm9L"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></span><span class="label_LzDG">Copy page</span></button></div><span class="theme-doc-version-badge badge badge--secondary">Version: 1.10.x</span></div><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Deploy Langflow with multiple workers</h1></header><style>[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; }</style>
<!-- -->
<p>By default, Langflow runs with a single worker process and stores build job state in memory.</p>
<p>A single-worker process is fine for development, but it doesn&#x27;t scale when you run more than one worker.
A flow build started on worker <strong>A</strong> cannot be polled or streamed from worker <strong>B</strong> because the in-memory job queue is <em>per-process</em>.</p>
<p>A multi-worker deployment runs more than one worker process on the same host. Concurrency can be increased by increasing the number of <code>LANGFLOW_WORKERS</code>, but each process keeps its own in-memory build queue unless you add a shared store.</p>
<p>A Redis-backed job queue stores build events in <a href="https://redis.io/docs/latest/develop/data-types/streams/" target="_blank" rel="noopener noreferrer" class="">Redis Streams</a>, so any worker can pick up and serve any job&#x27;s events.
To configure a multi-worker Langflow process, follow the steps to enable the Redis job queue.</p>
<p>After the Redis job queue is configured, you can optionally follow <a href="#recommended-gunicorn-settings" class="">recommended Gunicorn settings</a> to reduce memory use and keep workers healthy. This tuning applies to Linux production hosts only. On Windows and macOS, <code>langflow run</code> uses a single Uvicorn process.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prerequisites">Prerequisites<a href="#prerequisites" class="hash-link" aria-label="Direct link to Prerequisites" title="Direct link to Prerequisites" translate="no"></a></h2>
<ul>
<li class=""><strong>Redis 6 or later</strong>, reachable from all Langflow worker processes.</li>
<li class="">All workers configured with the same <code>LANGFLOW_JOB_QUEUE_TYPE</code>. Mixed-mode deployments (some workers using <code>asyncio</code>, others using <code>redis</code>) are not supported.</li>
<li class="">A dedicated Redis database index for the job queue. The cache uses DB <code>0</code> by default; the job queue defaults to DB <code>1</code>. Using the same index for both will cause key collisions.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="enable-the-redis-job-queue">Enable the Redis job queue<a href="#enable-the-redis-job-queue" class="hash-link" aria-label="Direct link to Enable the Redis job queue" title="Direct link to Enable the Redis job queue" translate="no"></a></h2>
<p>To enable the Redis job queue, set the following environment variables on all workers:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKERS=3 # any value &gt; 1</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_JOB_QUEUE_TYPE=redis</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_REDIS_QUEUE_URL=redis://your-redis-host:6379/1</span></div></div><br></code></div></div>
<p>Redis authentication and TLS are only supported through <code>LANGFLOW_REDIS_QUEUE_URL</code>.
The individual host/port settings <code>LANGFLOW_REDIS_QUEUE_HOST</code> and <code>LANGFLOW_REDIS_QUEUE_PORT</code> create a plain, unauthenticated connection.
If you use a managed Redis service with auth or TLS, you must use <code>LANGFLOW_REDIS_QUEUE_URL</code>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="example-multi-worker-docker-compose">Example: multi-worker Docker Compose<a href="#example-multi-worker-docker-compose" class="hash-link" aria-label="Direct link to Example: multi-worker Docker Compose" title="Direct link to Example: multi-worker Docker Compose" translate="no"></a></h2>
<p>This example runs three Langflow workers sharing a Redis job queue and a PostgreSQL database.</p>
<p>To run this example you need:</p>
<ul>
<li class=""><a href="https://docs.docker.com/get-started/get-docker/" target="_blank" rel="noopener noreferrer" class="">Docker</a> and <a href="https://docs.docker.com/compose/install/" target="_blank" rel="noopener noreferrer" class="">Docker Compose</a> (or <a href="https://podman-desktop.io/" target="_blank" rel="noopener noreferrer" class="">Podman Desktop</a>)</li>
<li class="">At least 4 GB of memory and 2 CPUs available to the container runtime</li>
</ul>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16" role="img" aria-label="Tip icon" focusable="false"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>If you are using Podman Desktop, the default machine might not have enough resources to run this stack. Before starting, increase the machine&#x27;s CPU and memory allocation:</p><div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>podman machine stop</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>podman machine set --cpus 4 --memory 4096</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>podman machine start</span></div></div><br></code></div></div></div></div>
<ol>
<li class="">
<p>Paste the following example into a Docker Compose file named <code>docker-compose.yml</code>:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span>services:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> langflow:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> image: langflowai/langflow:1.10.0</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> pull_policy: always</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> ports:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - &quot;7860:7860&quot;</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> depends_on:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> redis:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> condition: service_healthy</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> postgres:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> condition: service_started</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> environment:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_CONFIG_DIR=/app/langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_WORKERS=3 # any value &gt; 1</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_GUNICORN_PRELOAD=true</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_JOB_QUEUE_TYPE=redis</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_REDIS_QUEUE_URL=redis://redis:6379/1</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_SUPERUSER=admin</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_SUPERUSER_PASSWORD=changeme</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - LANGFLOW_AUTO_LOGIN=False</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> volumes:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - langflow-data:/app/langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span></span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> redis:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> image: redis:7-alpine</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> healthcheck:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> test: [&quot;CMD&quot;, &quot;redis-cli&quot;, &quot;ping&quot;]</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> interval: 5s</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> timeout: 3s</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> retries: 5</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span></span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> postgres:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> image: postgres:16-trixie</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> environment:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> POSTGRES_USER: langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> POSTGRES_PASSWORD: langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> POSTGRES_DB: langflow</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> volumes:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> - langflow-postgres:/var/lib/postgresql/data</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span></span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span>volumes:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> langflow-postgres:</span></div></div><div><span class="ch-code-line-number">_<!-- -->44</span><div style="display:inline-block;margin-left:16px"><span> langflow-data:</span></div></div><br></code></div></div>
</li>
<li class="">
<p>Start the services:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>docker compose up -d</span></div></div><br></code></div></div>
</li>
<li class="">
<p>Watch the logs until Langflow is ready:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>docker compose logs -f langflow</span></div></div><br></code></div></div>
<p>These lines confirm a successful multi-worker boot:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>[preload] initializing services in master</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>[preload] master preload complete; workers will inherit shared state via COW</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>✓ Launching Langflow...</span></div></div><br></code></div></div>
</li>
<li class="">
<p>Create a superuser token using the <code>username</code> and <code>password</code> set in the Docker Compose file:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>TOKEN=$(curl -s -X POST http://localhost:7860/api/v1/login \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -H &quot;Content-Type: application/x-www-form-urlencoded&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -d &quot;username=admin&amp;password=changeme&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> | python3 -c &quot;import sys,json; print(json.load(sys.stdin)[&#x27;access_token&#x27;])&quot;)</span></div></div><br></code></div></div>
</li>
<li class="">
<p>In the same terminal session, verify the Redis queue is active:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>curl -s -H &quot;Authorization: Bearer $TOKEN&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> http://localhost:7860/api/v1/monitor/job_queue | python3 -m json.tool</span></div></div><br></code></div></div>
<p>A response looks like the following:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>{</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;backend&quot;: &quot;redis&quot;,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;active_jobs&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;bridge_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;consumer_wrapper_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;background_task_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_dispatcher_running&quot;: true,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_stats&quot;: {</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;published&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;marker_hit&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_owned&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_foreign&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;publish_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_reconnects&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_internal_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;polling_watchdog_kills&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_touch_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_get_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_parse_errors&quot;: 0</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> }</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>}</span></div></div><br></code></div></div>
<p><code>backend: redis</code> confirms the queue is using Redis, and <code>cancel_dispatcher_running: true</code> confirms the cross-worker cancel channel is active.</p>
</li>
<li class="">
<p>In the same terminal session, poll the <code>monitor/job_queue</code> endpoint:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>while true; do</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> clear</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> curl -s -H &quot;Authorization: Bearer $TOKEN&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> http://localhost:7860/api/v1/monitor/job_queue | python3 -m json.tool</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> sleep 1</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>done</span></div></div><br></code></div></div>
</li>
<li class="">
<p>Open the Langflow UI and build a flow by sending a message to the flow in the <strong>Playground</strong>.
The number of <code>active_jobs</code> reported by the <code>monitor/job_queue</code> endpoint increases, confirming your Redis queue is working.</p>
</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="verify-cross-worker-cancellation">Verify cross-worker cancellation<a href="#verify-cross-worker-cancellation" class="hash-link" aria-label="Direct link to Verify cross-worker cancellation" title="Direct link to Verify cross-worker cancellation" translate="no"></a></h3>
<p>To verify that cancellation works across workers, trigger a build with the API to capture the <code>job_id</code> and then cancel it.</p>
<ol>
<li class="">
<p>Use the API to build a flow by its <code>flow_id</code>:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>curl -s -X POST &quot;http://localhost:7860/api/v1/build/af7dc029-279e-4742-8419-1ac23898afdd/flow&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -H &quot;Authorization: Bearer $TOKEN&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -H &quot;Content-Type: application/json&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -d &#x27;{&quot;inputs&quot;: {&quot;input_value&quot;: &quot;hello&quot;}, &quot;stream&quot;: false}&#x27; | python3 -m json.tool</span></div></div><br></code></div></div>
<p>Response:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>{</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> &quot;job_id&quot;: &quot;1af960e9-12d5-48ec-9860-8a90a16f0b55&quot;</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>}</span></div></div><br></code></div></div>
<p>The returned <code>job_id</code> can be used to cancel build jobs in the queue.</p>
</li>
<li class="">
<p>To cancel a build job, send a request with the <code>job_id</code>:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>curl -s -X POST http://localhost:7860/api/v1/build/1af960e9-12d5-48ec-9860-8a90a16f0b55/cancel \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> -H &quot;Authorization: Bearer $TOKEN&quot; | python3 -m json.tool</span></div></div><br></code></div></div>
<p>Response:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>{</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> &quot;success&quot;: true,</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> &quot;message&quot;: &quot;Flow build cancelled successfully&quot;</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>}</span></div></div><br></code></div></div>
</li>
<li class="">
<p>Confirm the <code>monitor/job_queue</code> endpoint reports the cancellation:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>{</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;backend&quot;: &quot;redis&quot;,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;active_jobs&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;bridge_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;consumer_wrapper_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;background_task_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_dispatcher_running&quot;: true,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_stats&quot;: {</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;published&quot;: 1,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;marker_hit&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_owned&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_foreign&quot;: 2,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;publish_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_reconnects&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_internal_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;polling_watchdog_kills&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_touch_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_get_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_parse_errors&quot;: 0</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> }</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>}</span></div></div><br></code></div></div>
<p><code>dispatched_foreign</code> increments when the signal is dispatched to a job owned by a different worker, which confirms the cross-worker cancel path is working.</p>
<p>For more information, see <a href="#monitor-the-job-queue" class="">Monitor the job queue</a>.</p>
</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="troubleshoot">Troubleshoot<a href="#troubleshoot" class="hash-link" aria-label="Direct link to Troubleshoot" title="Direct link to Troubleshoot" translate="no"></a></h2>
<p>See <a class="" href="/troubleshoot#multi-worker-deployments">Troubleshoot multi-worker deployments</a>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="configuration-reference">Configuration reference<a href="#configuration-reference" class="hash-link" aria-label="Direct link to Configuration reference" title="Direct link to Configuration reference" translate="no"></a></h2>
<table><thead><tr><th>Variable</th><th class="col-center">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>LANGFLOW_JOB_QUEUE_TYPE</code></td><td class="col-center"><code>asyncio</code></td><td>Job queue backend. Set to <code>redis</code> to enable the cross-worker queue.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_URL</code></td><td class="col-center">Not set</td><td>Full Redis connection URL. Takes priority over <code>HOST</code>/<code>PORT</code>/<code>DB</code> when set. Use this for any Redis instance that requires authentication or TLS.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_HOST</code></td><td class="col-center"><code>LANGFLOW_REDIS_HOST</code></td><td>Redis host for the job queue. Falls back to the general Redis host setting. Does not support auth or TLS (use <code>LANGFLOW_REDIS_QUEUE_URL</code> instead for secured instances).</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_PORT</code></td><td class="col-center"><code>LANGFLOW_REDIS_PORT</code></td><td>Redis port for the job queue. Falls back to the general Redis port setting.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_DB</code></td><td class="col-center"><code>1</code></td><td>Redis database index for the job queue. Must differ from the cache database index (default <code>0</code>) to avoid key collisions.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_TTL</code></td><td class="col-center"><code>3600</code></td><td>TTL in seconds for job stream and ownership keys in Redis.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_STARTUP_GRACE_S</code></td><td class="col-center"><code>30.0</code></td><td>Seconds a consumer waits for the producer&#x27;s first write before treating a missing stream as end-of-stream. Increase this if your workers have slow cold-starts. Setting to <code>0</code> removes the grace period so a not-yet-created stream is treated as EOF immediately.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_CANCEL_CHANNEL_ENABLED</code></td><td class="col-center"><code>True</code></td><td>When <code>true</code>, each worker runs a Redis pub/sub dispatcher so that <code>POST /build/{id}/cancel</code> cancels a build on any worker, not just the one that received the request. Closing a browser tab also signals cancel cross-worker.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_CANCEL_MARKER_TTL</code></td><td class="col-center"><code>60</code></td><td>TTL in seconds for the cancel-marker key. The marker closes a race where a cancel signal is published before the target worker&#x27;s dispatcher has subscribed. A non-positive value is rejected at startup.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_POLLING_STALE_THRESHOLD_S</code></td><td class="col-center"><code>90.0</code></td><td>Seconds without client activity before the watchdog cancels an abandoned polling build. Set to <code>0</code> to disable the watchdog entirely.</td></tr><tr><td><code>LANGFLOW_REDIS_QUEUE_POLLING_WATCHDOG_INTERVAL_S</code></td><td class="col-center"><code>15.0</code></td><td>How often in seconds the watchdog scans for stale jobs. Lower values reclaim resources faster at the cost of more Redis reads.</td></tr><tr><td><code>LANGFLOW_GUNICORN_PRELOAD</code></td><td class="col-center"><code>False</code></td><td><strong>Experimental.</strong> Loads the app in the Gunicorn master process before workers fork, reducing per-worker startup overhead. Pairs well with <code>LANGFLOW_WORKERS</code>. Non-Windows only.</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="monitor-the-job-queue">Monitor the job queue<a href="#monitor-the-job-queue" class="hash-link" aria-label="Direct link to Monitor the job queue" title="Direct link to Monitor the job queue" translate="no"></a></h2>
<p>The <code>GET /monitor/job_queue</code> endpoint returns a metrics snapshot for the running worker. It requires superuser authentication and returns HTTP 403 otherwise.</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>curl -H &quot;Authorization: Bearer $LANGFLOW_SUPERUSER_TOKEN&quot; \</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span> http://localhost:7860/api/v1/monitor/job_queue</span></div></div><br></code></div></div>
<p>Example response for the Redis backend:</p>
<div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>{</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;backend&quot;: &quot;redis&quot;,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;active_jobs&quot;: 2,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;bridge_count&quot;: 1,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;consumer_wrapper_count&quot;: 1,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;background_task_count&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_dispatcher_running&quot;: true,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;cancel_stats&quot;: {</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;published&quot;: 5,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;marker_hit&quot;: 1,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_owned&quot;: 3,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatched_foreign&quot;: 2,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;publish_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_reconnects&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;dispatcher_internal_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;polling_watchdog_kills&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_touch_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_get_errors&quot;: 0,</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> &quot;activity_parse_errors&quot;: 0</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span> }</span></div></div><div><span class="ch-code-line-number">_<!-- -->21</span><div style="display:inline-block;margin-left:16px"><span>}</span></div></div><br></code></div></div>
<p>For the in-memory (<code>asyncio</code>) backend, only <code>backend</code> and <code>active_jobs</code> are returned.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="response-body">Response body<a href="#response-body" class="hash-link" aria-label="Direct link to Response body" title="Direct link to Response body" translate="no"></a></h3>
<p>The Redis backend response includes the following fields:</p>
<table><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><code>backend</code></td><td>The active job queue backend: <code>redis</code> or <code>asyncio</code>.</td></tr><tr><td><code>active_jobs</code></td><td>Number of jobs currently owned by this worker.</td></tr><tr><td><code>bridge_count</code></td><td>Number of active Redis stream bridge tasks on this worker. A bridge reads events from the local <code>asyncio.Queue</code> and writes them to Redis Streams so any worker can consume them.</td></tr><tr><td><code>consumer_wrapper_count</code></td><td>Number of active Redis stream consumer wrappers on this worker. A consumer wrapper reads events from a Redis Stream for cross-worker polling or streaming requests.</td></tr><tr><td><code>background_task_count</code></td><td>Number of fire-and-forget background tasks currently running (cancel cleanup, marker checks).</td></tr><tr><td><code>cancel_dispatcher_running</code></td><td>Whether the per-worker Redis pub/sub dispatcher is active. If <code>false</code>, this worker cannot receive cross-worker cancel signals. The dispatcher reconnects automatically with exponential backoff (capped at 30s), so a brief <code>false</code> during a Redis restart is expected.</td></tr><tr><td><code>cancel_stats.published</code></td><td>Number of cancel signals published to the Redis pub/sub channel by this worker.</td></tr><tr><td><code>cancel_stats.marker_hit</code></td><td>Number of times a cancel marker key was found, catching cancels that raced the dispatcher.</td></tr><tr><td><code>cancel_stats.dispatched_owned</code></td><td>Number of cancel signals dispatched to jobs owned by this worker.</td></tr><tr><td><code>cancel_stats.dispatched_foreign</code></td><td>Number of cancel signals dispatched to jobs owned by a different worker. A non-zero value confirms cross-worker cancellation is working.</td></tr><tr><td><code>cancel_stats.publish_errors</code></td><td>Number of Redis errors on the cancel publish path. Persistent non-zero values indicate a Redis connectivity problem.</td></tr><tr><td><code>cancel_stats.dispatcher_reconnects</code></td><td>Number of times the cancel dispatcher has reconnected after a Redis pub/sub error.</td></tr><tr><td><code>cancel_stats.dispatcher_internal_errors</code></td><td>Number of unexpected errors inside the cancel dispatcher (not Redis disconnects). Non-zero values indicate a bug; check logs for details.</td></tr><tr><td><code>cancel_stats.polling_watchdog_kills</code></td><td>Number of abandoned polling builds reclaimed by the watchdog. Non-zero is normal under load. A very high count may indicate frequent client disconnects (consider increasing <code>LANGFLOW_REDIS_QUEUE_POLLING_STALE_THRESHOLD_S</code>).</td></tr><tr><td><code>cancel_stats.activity_touch_errors</code></td><td>Number of errors writing the client heartbeat key to Redis.</td></tr><tr><td><code>cancel_stats.activity_get_errors</code></td><td>Number of errors reading the client heartbeat key from Redis.</td></tr><tr><td><code>cancel_stats.activity_parse_errors</code></td><td>Number of malformed heartbeat values encountered by the watchdog.</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="recommended-gunicorn-settings">Recommended Gunicorn settings<a href="#recommended-gunicorn-settings" class="hash-link" aria-label="Direct link to Recommended Gunicorn settings" title="Direct link to Recommended Gunicorn settings" translate="no"></a></h2>
<div class="theme-admonition theme-admonition-tip admonition_xJq3 alert alert--success"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 12 16" role="img" aria-label="Tip icon" focusable="false"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_BuS1"><p>This tuning is optional, and it applies to Linux only. It does not replace the Redis job queue.</p><p>On Windows and macOS, <code>langflow run</code> uses one Uvicorn process, so <code>LANGFLOW_GUNICORN_PRELOAD</code> and <code>GUNICORN_CMD_ARGS</code> have no effect.</p></div></div>
<p>These recommendations are starting points from Langflow engineering benchmarks on Linux multi-worker deployments.
After you apply these values, monitor performance, and then make adjustments using <code>htop</code> or <code>btop</code> while you run flows.</p>
<p>Add the starter values to your server&#x27;s <code>.env</code> file after the <a href="#enable-the-redis-job-queue" class="">Redis job queue</a> settings, then restart Langflow. Copy the block that best matches your server:</p>
<div class="theme-tabs-container tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Small / dev (48 GB RAM)</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Standard API (12 GB RAM)</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Heavy multi-agent (24 GB+ RAM)</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Start with fewer workers so Langflow and local databases do not hit OOM.</p><div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKERS=5</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKER_TIMEOUT=120</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_GUNICORN_PRELOAD=true</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>GUNICORN_CMD_ARGS=&quot;--max-requests 100 --max-requests-jitter 20&quot;</span></div></div><br></code></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>A balanced default for a dedicated Langflow host.</p><div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKERS=15</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKER_TIMEOUT=300</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_GUNICORN_PRELOAD=true</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>GUNICORN_CMD_ARGS=&quot;--max-requests 250 --max-requests-jitter 50&quot;</span></div></div><br></code></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Agent loops use more RAM per request, so a lower <code>--max-requests</code> value restarts workers more often to keep long-term usage consistent.</p><div class="ch-codeblock not-prose" data-ch-theme="github-dark"><div class="ch-code-wrapper ch-code" data-ch-measured="false"><code class="ch-code-scroll-parent"><br><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKERS=30</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_WORKER_TIMEOUT=600</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>LANGFLOW_GUNICORN_PRELOAD=true</span></div></div><div><span class="ch-code-line-number">_<!-- -->10</span><div style="display:inline-block;margin-left:16px"><span>GUNICORN_CMD_ARGS=&quot;--max-requests 150 --max-requests-jitter 30&quot;</span></div></div><br></code></div></div></div></div></div>
<ul>
<li class=""><strong><code>LANGFLOW_WORKERS</code></strong> — How many Gunicorn worker processes run for concurrency.</li>
<li class=""><strong><code>LANGFLOW_WORKER_TIMEOUT</code></strong> — How long a worker may handle a single request before Gunicorn kills it. Raise it if you expect long agent runs.</li>
<li class=""><strong><code>LANGFLOW_GUNICORN_PRELOAD</code></strong> — Loads the app once in the Gunicorn master before workers fork so Linux can share memory across workers through Copy-on-Write. Recommended to leave enabled in multi-worker deployments for memory savings. Safe to leave off; behavior matches older releases when <code>false</code>.</li>
<li class=""><strong><code>GUNICORN_CMD_ARGS</code></strong> — Recycles workers after a set number of requests so memory usage growth does not continuously accumulate. <code>--max-requests</code> restarts a worker after it processes that many requests; <code>--max-requests-jitter</code> adds a random extra 0N requests on top of that limit for each worker. Spreading restarts over time avoids every worker reloading at once. If RAM usage increases over time, lower <code>--max-requests</code> before you lower worker count.</li>
</ul>
<p>For more information, see the <a href="https://www.langflow.org/blog/scaling-langflow" target="_blank" rel="noopener noreferrer" class="">Scaling Langflow blog post</a>.</p></div></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/deployment-render"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Render</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/lfx-compatibility"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">LFX and Langflow version compatibility</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#prerequisites" class="table-of-contents__link toc-highlight">Prerequisites</a></li><li><a href="#enable-the-redis-job-queue" class="table-of-contents__link toc-highlight">Enable the Redis job queue</a></li><li><a href="#example-multi-worker-docker-compose" class="table-of-contents__link toc-highlight">Example: multi-worker Docker Compose</a><ul><li><a href="#verify-cross-worker-cancellation" class="table-of-contents__link toc-highlight">Verify cross-worker cancellation</a></li></ul></li><li><a href="#troubleshoot" class="table-of-contents__link toc-highlight">Troubleshoot</a></li><li><a href="#configuration-reference" class="table-of-contents__link toc-highlight">Configuration reference</a></li><li><a href="#monitor-the-job-queue" class="table-of-contents__link toc-highlight">Monitor the job queue</a><ul><li><a href="#response-body" class="table-of-contents__link toc-highlight">Response body</a></li></ul></li><li><a href="#recommended-gunicorn-settings" class="table-of-contents__link toc-highlight">Recommended Gunicorn settings</a></li></ul></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer"><div class="container container-fluid"><div class="row footer__links"><div class="theme-layout-footer-column col footer__col"><div class="footer__title"></div><ul class="footer__items clean-list"><li class="footer__item"><div class="footer-links">
<span>© 2026 Langflow</span>
<span id="preferenceCenterContainer"> ·&nbsp; <a href="#" onclick='return"undefined"!=typeof window&&window.truste&&window.truste.eu&&window.truste.eu.clickListener&&window.truste.eu.clickListener(),!1' style="cursor: pointer;">Manage Privacy Choices</a></span>
</div></li></ul></div></div></div></footer><div style="position:fixed;right:21px;bottom:21px;z-index:100;display:flex;align-items:center;gap:10px;cursor:pointer"><div style="background-color:#f6f6f6;border-radius:50%;width:48px;height:48px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(0,0,0,0.1)"><img src="/img/langflow-icon-black-transparent.svg" style="width:40px" alt="Search"></div></div></div>
</body>
</html>