docs/versioned_docs/version-1.8.0/Contributing/contributing-how-to-contribute.mdx
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
This guide is intended to help you start contributing to Langflow. As an open-source codebase in a rapidly developing field, Langflow welcomes contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
To contribute code or documentation to Langflow, follow the pull request guide.
This overview will help you understand how to set up your development environment.
Langflow consists of two main services:
During development, the frontend and backend services run separately on different ports:
http://localhost:3000 (with hot reload).http://localhost:7860.When you install Langflow as an end user, the backend serves the frontend internally, making both services available on a single port (7860 by default).
Install Langflow from source by forking the repository and setting up your development environment.
Fork the Langflow GitHub repository.
Add the new remote to your local repository on your local machine:
git remote add FORK_NAME https://github.com/GIT_USERNAME/langflow.git
Replace the following:
FORK_NAME: A name for your fork of the repositoryGIT_USERNAME: Your Git usernameYou can run Langflow from source after cloning the repository, even if you aren't contributing to the codebase.
This builds the frontend and serves it through the backend on port 7860.
The instructions below are for running Langflow from source. For development with hot reload, see Set up development environment.
<details> <summary>Run from source on macOS/Linux</summary>In your terminal, navigate to the root of the Langflow directory, and then run make run_cli.
This command does the following:
The Langflow frontend is served at http://localhost:7860.
To run Langflow from source on Windows, you can use the Langflow repository's included scripts, or run the commands in the terminal.
Do one of the following:
To install and run Langflow with the included Windows Batch file, navigate to the scripts/windows directory, and then run the build_and_run.bat file.
To run Langflow from the Windows Command Line:
Build the frontend static files:
cd src/frontend
npm install
npm run build
Copy the contents of the built src/frontend/build directory to src/backend/base/langflow/frontend.
Start Langflow:
uv run langflow run
The Langflow frontend is served at http://localhost:7860.
To run Langflow from source on Windows, you can use the Langflow repository's included scripts, or run the commands in the terminal.
Do one of the following:
To install and run Langflow with the included scripts, navigate to the scripts/windows directory, and then run the build_and_run.ps1 file.
To run Langflow from a PowerShell terminal:
Build the frontend static files:
cd src/frontend
npm install
npm run build
Copy the contents of the built src/frontend/build directory to src/backend/base/langflow/frontend.
Start Langflow:
uv run langflow run
The Langflow frontend is served at http://localhost:7860.
:::tip
Run make help to display all available make commands.
:::
This section is for contributors who want to develop and test code changes with hot reload enabled.
If you just want to run Langflow locally without making code changes, see Run Langflow from source.
<Tabs> <TabItem value="linux-macos" label="Linux or macOS" default>Set up the Langflow development environment:
make init
This command sets up the development environment by doing the following:
Run the backend and frontend in separate terminals for development:
# Run backend in development mode (includes hot reload)
make backend
# In another terminal, run frontend in development mode (includes hot reload)
make frontend
The make backend and make frontend commands automatically install dependencies, so you don't need to run install commands separately.
The frontend is served at http://localhost:3000 and the backend at http://localhost:7860.
Optional: Install pre-commit hooks to help keep your changes clean and well-formatted.
With pre-commit hooks installed, you must use uv run git commit instead of git commit directly.
make init installs pre-commit hooks automatically, or you can run the following command to install them manually:
uv sync
uv run pre-commit install
To test your changes before pushing commits, run make lint, make format, and make unit_tests.
To run all tests, including coverage, unit, and integration, tests, run make tests.
Since Windows doesn't include make, building and running Langflow from source uses npm and uv.
To set up the Langflow development environment, run the frontend and backend in separate terminals:
To run the frontend development server with hot reload, run the following commands:
cd src/frontend
npm install
npm run start
In a separate terminal, run the following command to run the backend:
uv run langflow run --backend-only
The frontend is served at http://localhost:3000 and the backend at http://localhost:7860. This setup preserves hot reload for frontend development, with no need to copy build files after every edit.
If you encounter frontend build problems or are upgrading from an older version of Langflow, run make run_clic once.
make run_clic
This command cleans the build cache and rebuilds everything from scratch, which resolves most frontend-related issues when switching between versions.
The repo includes a .vscode/launch.json file for debugging the backend in VSCode, which is faster than debugging with Docker Compose.
For more information, see the VSCode documentation.
The documentation is built using Docusaurus and written in Markdown. For style guidance, see the Google Developer Documentation Style Guide.
Install Node.js.
Fork the Langflow GitHub repository.
Add the new remote to your local repository on your local machine:
git remote add FORK_NAME https://github.com/GIT_USERNAME/langflow.git
Replace the following:
FORK_NAME: A name for your fork of the repositoryGIT_USERNAME: Your Git usernameFrom the root of your local Langflow fork, change to the /docs directory:
cd docs
If you're using a dev container, run the documentation build from outside the container on your host terminal, not from within the dev container workspace. The documentation build may not work properly when run inside the dev container.
Install dependencies and start a local Docusaurus static site with hot reload:
npm install
npm run start
The documentation is served at http://localhost:3000.
To edit and create content, work with the .mdx files in the langflow/docs/docs directory.
Create new files in .mdx format.
Navigation is defined in langflow/docs/sidebars.js.
Most pages use a slug for shorthand cross-referencing, rather than supplying the full or relative directory path.
For example, if a page has a slug of /cool-page, you can link to it with [Cool page](/cool-page) from any other /docs page.
Recommended: After making some changes, run npm run build to build the site locally with more robust logging.
This can help you find broken links before creating a PR.
To submit a pull request, do the following:
main branch.feat: add new feature and fixes are fix: correct issue with X.Some additional guidance on pull request titles:
Fixes #1234.For more information, see the Python Developer's Guide.