Skip to content

Flow DevOps Toolkit

docs.langflow.org • November 30, 2026

Instead of manually exporting, sharing, and importing flow JSON files from the Langflow UI, the Flow DevOps toolkit offers terminal-based workflows for versioning, environment variables, testing, and deployment.

Install and start Langflow

Install and start Langflow

Create a Langflow API key

Create a Langflow API key

Install the Langflow lfx package To install the lfx package from PyPI, do the following: Create a virtual environment: uv venv VENV_NAME Activate the virtual environment. source VENV_NAME/bin/activate Install the Langflow LFX package in the virtual environment: uv pip install lfx Run Flow DevOps Toolkit commands in the virtual environment that has LFX installed. Alternatively, you can run uvx lfx commands, or run LFX from the src/lfx directory in a cloned Langflow repo. For more information, see the Langflow LFX README . tip uv pip install lfx installs the core LFX executor but does not include components that ship as separate bundle packages. If your flows use those components, install the required bundles in the same virtual environment. For more information, see bundles .

Install the Langflow lfx package

To install the lfx package from PyPI, do the following:

Create a virtual environment: uv venv VENV_NAME

Create a virtual environment:

Activate the virtual environment. source VENV_NAME/bin/activate

Activate the virtual environment.

Install the Langflow LFX package in the virtual environment: uv pip install lfx

Install the Langflow LFX package in the virtual environment:

Run Flow DevOps Toolkit commands in the virtual environment that has LFX installed. Alternatively, you can run uvx lfx commands, or run LFX from the src/lfx directory in a cloned Langflow repo. For more information, see the Langflow LFX README .

Run Flow DevOps Toolkit commands in the virtual environment that has LFX installed.

Alternatively, you can run uvx lfx commands, or run LFX from the src/lfx directory in a cloned Langflow repo. For more information, see the Langflow LFX README .

uv pip install lfx installs the core LFX executor but does not include components that ship as separate bundle packages. If your flows use those components, install the required bundles in the same virtual environment. For more information, see bundles .

Create a project and version a flow ​

Create a flow in the Langflow UI, such as the Simple Agent starter flow in the Quickstart .

Create a flow in the Langflow UI, such as the Simple Agent starter flow in the Quickstart .

Open a terminal session within the virtual environment that has lfx installed.

Open a terminal session within the virtual environment that has lfx installed.

To initialize a project, run: lfx init PROJECT_NAME Replace PROJECT_NAME with a name for your project folder. lfx init creates a scaffold for your project. The output is similar to the following: demo-project/ ├── .github/ │ └── workflows/ │ ├── langflow-push.yml # CI workflow │ ├── langflow-test.yml # CI workflow │ └── langflow-validate.yml # CI workflow ├── .gitignore # ignores legacy credentials file ├── .lfx/ │ └── environments.yaml # edit with your instance URLs + API key env var names (safe to commit) ├── ci/ │ ├── ci-push.sh # generic CI script │ ├── ci-test.sh # generic CI script │ └── ci-validate.sh # generic CI script ├── flows/ │ └── .gitkeep # versioned empty directory └── tests/ ├── __init__.py └── test_flows.py # flow_runner example tests ✔ Project scaffolded. steps: 1. Edit `.lfx/environments.yaml` with your instance URL 2. export LANGFLOW_LOCAL_API_KEY= (Settings -> API Keys) 3. lfx pull --env local --output-dir flows/ The project scaffold includes the following tools for building flows: .github/workflows : GitHub CI tooling. .lfx/environments.yaml : Control your project's URL and API keys as environment variables for local, staging, and production environments. ci/ Shell scripts for pushing, testing, and validating flows. flows/ : An empty directory to store flows that includes a .gitkeep file for flow versioning. tests/test_flows.py : Example tests that you can modify to test flows.

To initialize a project, run:

Replace PROJECT_NAME with a name for your project folder. lfx init creates a scaffold for your project. The output is similar to the following:

The project scaffold includes the following tools for building flows:

.github/workflows : GitHub CI tooling.

.lfx/environments.yaml : Control your project's URL and API keys as environment variables for local, staging, and production environments.

ci/ Shell scripts for pushing, testing, and validating flows.

flows/ : An empty directory to store flows that includes a .gitkeep file for flow versioning.

tests/test_flows.py : Example tests that you can modify to test flows.

Add your Langflow API key to your .env file, or export it within the terminal session. The Flow DevOps SDK includes url and api_key_env environment variables for local , staging , and production environments. The variable name for the API key differs between environments, so ensure you're adding the correct variable. For example, to add a Langflow API key to a local Langflow server, set: export LANGFLOW_LOCAL_API_KEY=LANGFLOW_API_KEY

Add your Langflow API key to your .env file, or export it within the terminal session. The Flow DevOps SDK includes url and api_key_env environment variables for local , staging , and production environments. The variable name for the API key differs between environments, so ensure you're adding the correct variable. For example, to add a Langflow API key to a local Langflow server, set:

To test server authentication with your API key, run: lfx login The Flow DevOps SDK tests your key against the URL and confirms the connection is working. If the test reports Authentication failed , create and export a new key and try again.

To test server authentication with your API key, run:

The Flow DevOps SDK tests your key against the URL and confirms the connection is working. If the test reports Authentication failed , create and export a new key and try again.

To check the connected server for existing flows, run: lfx pull The Flow DevOps SDK lists your server's flows. Output is similar to the following (from a project directory such as demo-project/ ): Pulling all flows from Pulled 'Simple Agent' -> flows/Simple_Agent.json ┌────────────────┬──────────────────────────────────────┬───────────────────────────┬──────────┐ │ Name │ ID │ File │ Status │ ├────────────────┼──────────────────────────────────────┼───────────────────────────┼──────────┤ │ Simple Agent │ c2f91b01-9a73-4c62-b7f0-e15bc3bd6802 │ flows/Simple_Agent.json │ CREATED │ └────────────────┴──────────────────────────────────────┴───────────────────────────┴──────────┘ 1 updated. lfx pull pulls flow changes on the server to JSON files under flows/ in your project (for example demo-project/flows ). If you run lfx pull again, the Flow DevOps SDK reports a Status of Unchanged . You will pull changes in the steps.

To check the connected server for existing flows, run:

The Flow DevOps SDK lists your server's flows. Output is similar to the following (from a project directory such as demo-project/ ):

lfx pull pulls flow changes on the server to JSON files under flows/ in your project (for example demo-project/flows ). If you run lfx pull again, the Flow DevOps SDK reports a Status of Unchanged . You will pull changes in the steps.

In the Langflow UI, open the Simple Agent flow and change the flow. For example, change the Chat Input to a different input string. Save the flow.

In the Langflow UI, open the Simple Agent flow and change the flow. For example, change the Chat Input to a different input string. Save the flow.

Return to your terminal, and run lfx status . The Flow DevOps SDK reports the flow's Status as UPDATED , because the hash of the flow JSON has changed with your update.

Return to your terminal, and run lfx status . The Flow DevOps SDK reports the flow's Status as UPDATED , because the hash of the flow JSON has changed with your update.

To pull the reported changes from the Langflow server to your local project folder, run lfx pull .

To pull the reported changes from the Langflow server to your local project folder, run lfx pull .

To push flow changes from flows stored locally in demo-project/flows to the Langflow server, run lfx push .

To push flow changes from flows stored locally in demo-project/flows to the Langflow server, run lfx push .

The Flow DevOps SDK can validate that local flows are correctly formed before pushing to the Langflow with lfx validate .

To test the Simple Agent starter flow, pass the flow JSON path to the lfx validate command: lfx validate flows/Simple_Agent.json

Once validated, push flow changes to the server with lfx push .

Generate requirements.txt for flows ​

The Flow DevOps SDK can generate a requirements.txt file for a flow.

A flow JSON describes nodes and wiring, and does not list the PyPI packages components import at runtime. Generate a requirements.txt file to capture the minimal Python dependencies, so you can install a matching environment for the flow.

From your project directory, point lfx requirements at a flow JSON file. To print the requirements to the terminal: lfx requirements flows/Simple_Agent.json To write a requirements.txt file instead of printing, use -o or --output : lfx requirements flows/Simple_Agent.json -o requirements.txt

From your project directory, point lfx requirements at a flow JSON file. To print the requirements to the terminal:

To write a requirements.txt file instead of printing, use -o or --output :

Optionally, you can now and serve the flow by keeping the flow JSON and requirements.txt in the same environment. To serve the flow without the Langflow UI, do the following: Create a virtual environment: uv venv VENV_NAME Activate the virtual environment. source VENV_NAME/bin/activate Install the dependencies from requirements.txt in the virtual environment: uv pip install -r requirements.txt To set a Langflow API key, run: export LANGFLOW_API_KEY=LANGFLOW_API_KEY To serve the flow without the Langflow UI, pass the flow JSON path to the lfx serve command: lfx serve flows/Simple_Agent.json lfx serve starts a FastAPI app that exposes your flow as an HTTP API endpoint. For more information, see the Langflow LFX README .

Optionally, you can now and serve the flow by keeping the flow JSON and requirements.txt in the same environment. To serve the flow without the Langflow UI, do the following:

Create a virtual environment:

Activate the virtual environment.

Install the dependencies from requirements.txt in the virtual environment:

To set a Langflow API key, run:

To serve the flow without the Langflow UI, pass the flow JSON path to the lfx serve command:

lfx serve starts a FastAPI app that exposes your flow as an HTTP API endpoint. For more information, see the Langflow LFX README .

Manage multiple environments with environments.yaml ​

The environments.yaml file created at initialization contains three example entries for deployment environments:

Each entry contains a url for the Langflow base URL, and an api_key_env field. The api_key_env field names an environment variable that you either export or store in a .env file, and does not store the secret string itself, which makes environments.yaml safe to commit to version control.

The names local , staging , and production in environments.yaml are conventions, and can be named whatever your project requires. You can add more than three entries.

environments.yaml is distinct from the Langflow or LFX .env file. environments.yaml controls which remote Langflow instance you're deploying flows to, flow versioning, and environment variable names for API keys. The .env contains runtime values for the Langflow server, and might also contain actual secret values , so the .env should not be committed to version control.

Commands that call a Langflow server over HTTP, such as lfx pull or lfx push , use --env ENVIRONMENT_NAME to determine which Langflow instance to send the request to.

For example, to send a push request to a server named local in environments.yaml , run:

This command will send the request to the Langflow base URL at using a Langflow API key named LANGFLOW_LOCAL_API_KEY .

Resolve connections in headless LFX , including the required_variables and required_connections a project deployment artifact declares

Was this page helpful?

Extracted Entities

Companies (1)

Platforms (1)

Tools (1)