+
+# 📝 Conteúdo
+
+- [📝 Conteúdo](#-conteúdo)
+- [📦 Introdução](#-introdução)
+- [🎨 Criar Fluxos](#-criar-fluxos)
+- [Deploy](#deploy)
+ - [Deploy usando Google Cloud Platform](#deploy-usando-google-cloud-platform)
+ - [Deploy on Railway](#deploy-on-railway)
+ - [Deploy on Render](#deploy-on-render)
+- [🖥️ Interface de Linha de Comando (CLI)](#️-interface-de-linha-de-comando-cli)
+ - [Uso](#uso)
+ - [Variáveis de Ambiente](#variáveis-de-ambiente)
+- [👋 Contribuir](#-contribuir)
+- [🌟 Contribuidores](#-contribuidores)
+- [📄 Licença](#-licença)
+
+# 📦 Introdução
+
+Você pode instalar o Langflow com pip:
+
+```shell
+# Certifique-se de ter >=Python 3.10 instalado no seu sistema.
+# Instale a versão pré-lançamento (recomendada para as atualizações mais recentes)
+python -m pip install langflow --pre --force-reinstall
+
+# ou versão estável
+python -m pip install langflow -U
+```
+
+Então, execute o Langflow com:
+
+```shell
+python -m langflow run
+```
+
+Você também pode visualizar o Langflow no [HuggingFace Spaces](https://huggingface.co/spaces/Langflow/Langflow-Preview). [Clone o Space usando este link](https://huggingface.co/spaces/Langflow/Langflow-Preview?duplicate=true) para criar seu próprio workspace do Langflow em minutos.
+
+# 🎨 Criar Fluxos
+
+Criar fluxos com Langflow é fácil. Basta arrastar componentes da barra lateral para o canvas e conectá-los para começar a construir sua aplicação.
+
+Explore editando os parâmetros do prompt, agrupando componentes e construindo seus próprios componentes personalizados (Custom Components).
+
+Quando terminar, você pode exportar seu fluxo como um arquivo JSON.
+
+Carregue o fluxo com:
+
+```python
+from langflow.load import run_flow_from_json
+
+results = run_flow_from_json("path/to/flow.json", input_value="Hello, World!")
+```
+
+# Deploy
+
+## Deploy usando Google Cloud Platform
+
+Siga nosso passo a passo para fazer deploy do Langflow no Google Cloud Platform (GCP) usando o Google Cloud Shell. O guia está disponível no documento [**Langflow on Google Cloud Platform**](https://github.com/langflow-ai/langflow/blob/dev/docs/docs/deployment/gcp-deployment.md).
+
+Alternativamente, clique no botão **"Open in Cloud Shell"** abaixo para iniciar o Google Cloud Shell, clonar o repositório do Langflow e começar um **tutorial interativo** que o guiará pelo processo de configuração dos recursos necessários e deploy do Langflow no seu projeto GCP.
+
+[](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/langflow-ai/langflow&working_dir=scripts/gcp&shellonly=true&tutorial=walkthroughtutorial_spot.md)
+
+## Deploy on Railway
+
+Use este template para implantar o Langflow 1.0 Preview no Railway:
+
+[](https://railway.app/template/UsJ1uB?referralCode=MnPSdg)
+
+Ou este para implantar o Langflow 0.6.x:
+
+[](https://railway.app/template/JMXEWp?referralCode=MnPSdg)
+
+## Deploy on Render
+
+
+
+
+
+# 🖥️ Interface de Linha de Comando (CLI)
+
+O Langflow fornece uma interface de linha de comando (CLI) para fácil gerenciamento e configuração.
+
+## Uso
+
+Você pode executar o Langflow usando o seguinte comando:
+
+```shell
+langflow run [OPTIONS]
+```
+
+Cada opção é detalhada abaixo:
+
+- `--help`: Exibe todas as opções disponíveis.
+- `--host`: Define o host para vincular o servidor. Pode ser configurado usando a variável de ambiente `LANGFLOW_HOST`. O padrão é `127.0.0.1`.
+- `--workers`: Define o número de processos. Pode ser configurado usando a variável de ambiente `LANGFLOW_WORKERS`. O padrão é `1`.
+- `--timeout`: Define o tempo limite do worker em segundos. O padrão é `60`.
+- `--port`: Define a porta para escutar. Pode ser configurado usando a variável de ambiente `LANGFLOW_PORT`. O padrão é `7860`.
+- `--env-file`: Especifica o caminho para o arquivo .env contendo variáveis de ambiente. O padrão é `.env`.
+- `--log-level`: Define o nível de log. Pode ser configurado usando a variável de ambiente `LANGFLOW_LOG_LEVEL`. O padrão é `critical`.
+- `--components-path`: Especifica o caminho para o diretório contendo componentes personalizados. Pode ser configurado usando a variável de ambiente `LANGFLOW_COMPONENTS_PATH`. O padrão é `langflow/components`.
+- `--log-file`: Especifica o caminho para o arquivo de log. Pode ser configurado usando a variável de ambiente `LANGFLOW_LOG_FILE`. O padrão é `logs/langflow.log`.
+- `--cache`: Seleciona o tipo de cache a ser usado. As opções são `InMemoryCache` e `SQLiteCache`. Pode ser configurado usando a variável de ambiente `LANGFLOW_LANGCHAIN_CACHE`. O padrão é `SQLiteCache`.
+- `--dev/--no-dev`: Alterna o modo de desenvolvimento. O padrão é `no-dev`.
+- `--path`: Especifica o caminho para o diretório frontend contendo os arquivos de build. Esta opção é apenas para fins de desenvolvimento. Pode ser configurado usando a variável de ambiente `LANGFLOW_FRONTEND_PATH`.
+- `--open-browser/--no-open-browser`: Alterna a opção de abrir o navegador após iniciar o servidor. Pode ser configurado usando a variável de ambiente `LANGFLOW_OPEN_BROWSER`. O padrão é `open-browser`.
+- `--remove-api-keys/--no-remove-api-keys`: Alterna a opção de remover as chaves de API dos projetos salvos no banco de dados. Pode ser configurado usando a variável de ambiente `LANGFLOW_REMOVE_API_KEYS`. O padrão é `no-remove-api-keys`.
+- `--install-completion [bash|zsh|fish|powershell|pwsh]`: Instala a conclusão para o shell especificado.
+- `--show-completion [bash|zsh|fish|powershell|pwsh]`: Exibe a conclusão para o shell especificado, permitindo que você copie ou personalize a instalação.
+- `--backend-only`: Este parâmetro, com valor padrão `False`, permite executar apenas o servidor backend sem o frontend. Também pode ser configurado usando a variável de ambiente `LANGFLOW_BACKEND_ONLY`.
+- `--store`: Este parâmetro, com valor padrão `True`, ativa os recursos da loja, use `--no-store` para desativá-los. Pode ser configurado usando a variável de ambiente `LANGFLOW_STORE`.
+
+Esses parâmetros são importantes para usuários que precisam personalizar o comportamento do Langflow, especialmente em cenários de desenvolvimento ou deploy especializado.
+
+### Variáveis de Ambiente
+
+Você pode configurar muitas das opções de CLI usando variáveis de ambiente. Estas podem ser exportadas no seu sistema operacional ou adicionadas a um arquivo `.env` e carregadas usando a opção `--env-file`.
+
+Um arquivo de exemplo `.env` chamado `.env.example` está incluído no projeto. Copie este arquivo para um novo arquivo chamado `.env` e substitua os valores de exemplo pelas suas configurações reais. Se você estiver definindo valores tanto no seu sistema operacional quanto no arquivo `.env`, as configurações do `.env` terão precedência.
+
+# 👋 Contribuir
+
+Aceitamos contribuições de desenvolvedores de todos os níveis para nosso projeto open-source no GitHub. Se você deseja contribuir, por favor, confira nossas [diretrizes de contribuição](./CONTRIBUTING.md) e ajude a tornar o Langflow mais acessível.
+
+---
+
+[](https://star-history.com/#langflow-ai/langflow&Date)
+
+# 🌟 Contribuidores
+
+[](https://github.com/langflow-ai/langflow/graphs/contributors)
+
+# 📄 Licença
+
+O Langflow é lançado sob a licença MIT. Veja o arquivo [LICENSE](LICENSE) para detalhes.
diff --git a/README.md b/README.md
index 649186a00..68c8fde29 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,7 @@
+
@@ -36,7 +37,6 @@
# 📝 Content
-- [](#)
- [📝 Content](#-content)
- [📦 Get Started](#-get-started)
- [🎨 Create Flows](#-create-flows)
diff --git a/docker/build_and_push.Dockerfile b/docker/build_and_push.Dockerfile
index cabc1a753..29f9294a6 100644
--- a/docker/build_and_push.Dockerfile
+++ b/docker/build_and_push.Dockerfile
@@ -1,6 +1,14 @@
# syntax=docker/dockerfile:1
# Keep this syntax directive! It's used to enable Docker BuildKit
+FROM node:20-bookworm-slim as builder-node
+WORKDIR /app
+COPY src/frontend/package.json src/frontend/package-lock.json ./
+RUN npm install
+COPY src/frontend/ ./
+RUN npm run build
+
+
################################
# BUILDER-BASE
# Used to build deps + create our virtual environment
@@ -47,12 +55,11 @@ WORKDIR /app
COPY pyproject.toml poetry.lock README.md ./
COPY src/ ./src
COPY scripts/ ./scripts
-
RUN python -m pip install requests --user && cd ./scripts && python update_dependencies.py
+COPY --from=builder-node /app/build ./src/backend/base/langflow/frontend
RUN $POETRY_HOME/bin/poetry lock --no-update \
- && $POETRY_HOME/bin/poetry install --no-interaction --no-ansi -E deploy \
&& $POETRY_HOME/bin/poetry build -f wheel \
- && $POETRY_HOME/bin/poetry run pip install dist/*.whl
+ && $POETRY_HOME/bin/poetry run pip install dist/*.whl --force-reinstall
################################
# RUNTIME
diff --git a/docs/docs/administration/api.mdx b/docs/docs/administration/api.mdx
index 103c43f81..115cdc666 100644
--- a/docs/docs/administration/api.mdx
+++ b/docs/docs/administration/api.mdx
@@ -10,8 +10,7 @@ Langflow provides an API key functionality that allows users to access their ind
The default user and password are set using the LANGFLOW_SUPERUSER and
LANGFLOW_SUPERUSER_PASSWORD environment variables.
-The default values are
-langflow and langflow, respectively.
+The default values are `langflow` and `langflow`, respectively.
diff --git a/docs/docs/administration/cli.mdx b/docs/docs/administration/cli.mdx
index a2a41adcd..41bc76de3 100644
--- a/docs/docs/administration/cli.mdx
+++ b/docs/docs/administration/cli.mdx
@@ -1,62 +1,51 @@
# Command Line Interface (CLI)
-## Overview
-
Langflow's Command Line Interface (CLI) is a powerful tool that allows you to interact with the Langflow server from the command line. The CLI provides a wide range of commands to help you shape Langflow to your needs.
-Running the CLI without any arguments will display a list of available commands and options.
+The available commands are below. Navigate to their individual sections of this page to see the parameters.
+
+- [langflow](#overview)
+- [langflow api-key](#langflow-api-key)
+- [langflow copy-db](#langflow-copy-db)
+- [langflow migration](#langflow-migration)
+- [langflow run](#langflow-run)
+- [langflow superuser](#langflow-superuser)
+
+## Overview
+
+Running the CLI without any arguments displays a list of available options and commands.
```bash
-python -m langflow run --help
+langflow
# or
-python -m langflow run
+langflow --help
+# or
+python -m langflow
```
-Each option for `run` command are detailed below:
+| Command | Description |
+| ----------- | ---------------------------------------------------------------------- |
+| `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. |
+| `copy-db` | Copy the database files to the current directory (`which langflow`). |
+| `migration` | Run or test migrations. |
+| `run` | Run the Langflow. |
+| `superuser` | Create a superuser. |
-- `--help`: Displays all available options.
-- `--host`: Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`.
-- `--workers`: Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`.
-- `--timeout`: Sets the worker timeout in seconds. The default is `60`.
-- `--port`: Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`.
-- `--env-file`: Specifies the path to the .env file containing environment variables. The default is `.env`.
-- `--log-level`: Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`.
-- `--components-path`: Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`.
-- `--log-file`: Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`.
-- `--cache`: Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`.
-- `--dev/--no-dev`: Toggles the development mode. The default is `no-dev`.
-- `--path`: Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable.
-- `--open-browser/--no-open-browser`: Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`.
-- `--remove-api-keys/--no-remove-api-keys`: Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`.
-- `--install-completion [bash|zsh|fish|powershell|pwsh]`: Installs completion for the specified shell.
-- `--show-completion [bash|zsh|fish|powershell|pwsh]`: Shows completion for the specified shell, allowing you to copy it or customize the installation.
-- `--backend-only`: This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable.
-- `--store`: This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable.
+### Options
-These parameters are important for users who need to customize the behavior of Langflow, especially in development or specialized deployment scenarios.
+| Option | Description |
+| ---------------------- | -------------------------------------------------------------------------------- |
+| `--install-completion` | Install completion for the current shell. |
+| `--show-completion` | Show completion for the current shell, to copy it or customize the installation. |
+| `--help` | Show this message and exit. |
-### API Key Command
+## langflow api-key
-The `api-key` command allows you to create an API key for accessing Langflow's API when `LANGFLOW_AUTO_LOGIN` is set to `True`.
-
-```bash
-python -m langflow api-key --help
-
- Usage: langflow api-key [OPTIONS]
-
- Creates an API key for the default superuser if AUTO_LOGIN is enabled.
- Args: log_level (str, optional): Logging level. Defaults to "error".
- Returns: None
-
-╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
-│ --log-level TEXT Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] │
-│ --help Show this message and exit. │
-╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
-```
-
-Once you run the `api-key` command, it will create an API key for the default superuser if `LANGFLOW_AUTO_LOGIN` is set to `True`.
+Run the `api-key` command to create an API key for the default superuser if `LANGFLOW_AUTO_LOGIN` is set to `True`.
```bash
+langflow api-key
+# or
python -m langflow api-key
╭─────────────────────────────────────────────────────────────────────╮
│ API Key Created Successfully: │
@@ -67,11 +56,98 @@ python -m langflow api-key
│ Make sure to store it in a secure location. │
│ │
│ The API key has been copied to your clipboard. Cmd + V to paste it. │
-╰─────────────────────────────────────────────────────────────────────╯
+╰──────────────────────────────
```
-### Environment Variables
+### Options
+
+| Option | Type | Description |
+| ----------- | ---- | ------------------------------------------------------------- |
+| --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
+| --help | | Show this message and exit. |
+
+## langflow copy-db
+
+Run the `copy-db` command to copy the cached `langflow.db` and `langflow-pre.db` database files to the current directory.
+
+If the files exist in the cache directory, they will be copied to the same directory as `__main__.py`, which can be found with `which langflow`.
+
+### Options
+
+None.
+
+## langflow migration
+
+Run or test migrations with the [Alembic](https://pypi.org/project/alembic/) database tool.
+
+```bash
+langflow migration
+# or
+python -m langflow migration
+```
+
+### Options
+
+| Option | Description |
+| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
+| `--test, --no-test` | Run migrations in test mode. [default: test] |
+| `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] |
+| `--help` | Show this message and exit. |
+
+## langflow run
+
+Run Langflow.
+
+```bash
+langflow run
+# or
+python -m langflow run
+```
+
+### Options
+
+| Option | Description |
+| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `--help` | Displays all available options. |
+| `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. |
+| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. |
+| `--timeout` | Sets the worker timeout in seconds. The default is `60`. |
+| `--port` | Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`. |
+| `--env-file` | Specifies the path to the .env file containing environment variables. The default is `.env`. |
+| `--log-level` | Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`. |
+| `--components-path` | Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. |
+| `--log-file` | Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. |
+| `--cache` | Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. |
+| `--dev`/`--no-dev` | Toggles the development mode. The default is `no-dev`. |
+| `--path` | Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. |
+| `--open-browser`/`--no-open-browser` | Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. |
+| `--remove-api-keys`/`--no-remove-api-keys` | Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`. |
+| `--install-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Installs completion for the specified shell. |
+| `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. |
+| `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. For more, see [Backend-only](../deployment/backend-only.md). |
+| `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. |
+
+#### Environment Variables
You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a `.env` file and loaded using the `--env-file` option.
A sample `.env` file named `.env.example` is included with the project. Copy this file to a new file named `.env` and replace the example values with your actual settings. If you're setting values in both your OS and the `.env` file, the `.env` settings will take precedence.
+
+## langflow superuser
+
+Create a superuser for Langflow.
+
+```bash
+langflow superuser
+# or
+python -m langflow superuser
+```
+
+### Options
+
+| Option | Type | Description |
+| ------------- | ---- | ------------------------------------------------------------- |
+| `--username` | TEXT | Username for the superuser. [default: None] [required] |
+| `--password` | TEXT | Password for the superuser. [default: None] [required] |
+| `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
+| `--help` | | Show this message and exit. |
diff --git a/docs/docs/contributing/community.md b/docs/docs/contributing/community.md
index 604487133..5c95718ec 100644
--- a/docs/docs/contributing/community.md
+++ b/docs/docs/contributing/community.md
@@ -10,7 +10,7 @@ Langflow [Discord](https://discord.gg/EqksyE2EX9) server.
---
-## 🐦 Stay tunned for **Langflow** on Twitter
+## 🐦 Stay tuned for **Langflow** on Twitter
Follow [@langflow_ai](https://twitter.com/langflow_ai) on **Twitter** to get the latest news about **Langflow**.
diff --git a/docs/docs/deployment/backend-only.md b/docs/docs/deployment/backend-only.md
new file mode 100644
index 000000000..fb5efdfdb
--- /dev/null
+++ b/docs/docs/deployment/backend-only.md
@@ -0,0 +1,123 @@
+# Backend-only
+
+You can run Langflow in `--backend-only` mode to expose your Langflow app as an API, without running the frontend UI.
+
+Start langflow in backend-only mode with `python3 -m langflow run --backend-only`.
+
+The terminal prints `Welcome to ⛓ Langflow`, and a blank window opens at `http://127.0.0.1:7864/all`.
+Langflow will now serve requests to its API without the frontend running.
+
+## Prerequisites
+
+- [Langflow installed](../getting-started/install-langflow.mdx)
+
+- [OpenAI API key](https://platform.openai.com)
+
+- [A Langflow flow created](../starter-projects/basic-prompting.mdx)
+
+## Download your flow's curl call
+
+1. Click API.
+2. Click **curl** > **Copy code** and save the code to your local machine.
+ It will look something like this:
+
+```curl
+curl -X POST \
+ "http://127.0.0.1:7864/api/v1/run/ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef?stream=false" \
+ -H 'Content-Type: application/json'\
+ -d '{"input_value": "message",
+ "output_type": "chat",
+ "input_type": "chat",
+ "tweaks": {
+ "Prompt-kvo86": {},
+ "OpenAIModel-MilkD": {},
+ "ChatOutput-ktwdw": {},
+ "ChatInput-xXC4F": {}
+}}'
+```
+
+Note the flow ID of `ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef`. You can find this ID in the UI as well to ensure you're querying the right flow.
+
+## Start Langflow in backend-only mode
+
+1. Stop Langflow with Ctrl+C.
+2. Start langflow in backend-only mode with `python3 -m langflow run --backend-only`.
+ The terminal prints `Welcome to ⛓ Langflow`, and a blank window opens at `http://127.0.0.1:7864/all`.
+ Langflow will now serve requests to its API.
+3. Run the curl code you copied from the UI.
+ You should get a result like this:
+
+```bash
+{"session_id":"ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880","outputs":[{"inputs":{"input_value":"hi, are you there?"},"outputs":[{"results":{"result":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?"},"artifacts":{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI"},"messages":[{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI","component_id":"ChatOutput-ktwdw"}],"component_display_name":"Chat Output","component_id":"ChatOutput-ktwdw","used_frozen_result":false}]}]}%
+```
+
+Again, note that the flow ID matches.
+Langflow is receiving your POST request, running the flow, and returning the result, all without running the frontend. Cool!
+
+## Download your flow's Python API call
+
+Instead of using curl, you can download your flow as a Python API call instead.
+
+1. Click API.
+2. Click **Python API** > **Copy code** and save the code to your local machine.
+ The code will look something like this:
+
+```python
+import requests
+from typing import Optional
+
+BASE_API_URL = "http://127.0.0.1:7864/api/v1/run"
+FLOW_ID = "ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef"
+# You can tweak the flow by adding a tweaks dictionary
+# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
+
+def run_flow(message: str,
+ flow_id: str,
+ output_type: str = "chat",
+ input_type: str = "chat",
+ tweaks: Optional[dict] = None,
+ api_key: Optional[str] = None) -> dict:
+ """
+ Run a flow with a given message and optional tweaks.
+
+ :param message: The message to send to the flow
+ :param flow_id: The ID of the flow to run
+ :param tweaks: Optional tweaks to customize the flow
+ :return: The JSON response from the flow
+ """
+ api_url = f"{BASE_API_URL}/{flow_id}"
+
+ payload = {
+ "input_value": message,
+ "output_type": output_type,
+ "input_type": input_type,
+ }
+ headers = None
+ if tweaks:
+ payload["tweaks"] = tweaks
+ if api_key:
+ headers = {"x-api-key": api_key}
+ response = requests.post(api_url, json=payload, headers=headers)
+ return response.json()
+
+# Setup any tweaks you want to apply to the flow
+message = "message"
+
+print(run_flow(message=message, flow_id=FLOW_ID))
+```
+
+3. Run your Python app:
+
+```python
+python3 app.py
+```
+
+The result is similar to the curl call:
+
+```bash
+{'session_id': 'ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880', 'outputs': [{'inputs': {'input_value': 'message'}, 'outputs': [{'results': {'result': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!"}, 'artifacts': {'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI'}, 'messages': [{'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI', 'component_id': 'ChatOutput-ktwdw'}], 'component_display_name': 'Chat Output', 'component_id': 'ChatOutput-ktwdw', 'used_frozen_result': False}]}]}
+```
+
+Your Python app POSTs to your Langflow server, and the server runs the flow and returns the result.
+
+See [API](../administration/api.mdx) for more ways to interact with your headless Langflow server.
diff --git a/docs/docs/deployment/docker.md b/docs/docs/deployment/docker.md
new file mode 100644
index 000000000..1ebb5746e
--- /dev/null
+++ b/docs/docs/deployment/docker.md
@@ -0,0 +1,65 @@
+# Docker
+
+This guide will help you get LangFlow up and running using Docker and Docker Compose.
+
+## Prerequisites
+
+- Docker
+- Docker Compose
+
+## Steps
+
+1. Clone the LangFlow repository:
+
+ ```sh
+ git clone https://github.com/langflow-ai/langflow.git
+ ```
+
+2. Navigate to the `docker_example` directory:
+
+ ```sh
+ cd langflow/docker_example
+ ```
+
+3. Run the Docker Compose file:
+
+ ```sh
+ docker compose up
+ ```
+
+LangFlow will now be accessible at [http://localhost:7860/](http://localhost:7860/).
+
+## Docker Compose Configuration
+
+The Docker Compose configuration spins up two services: `langflow` and `postgres`.
+
+### LangFlow Service
+
+The `langflow` service uses the `langflowai/langflow:latest` Docker image and exposes port 7860. It depends on the `postgres` service.
+
+Environment variables:
+
+- `LANGFLOW_DATABASE_URL`: The connection string for the PostgreSQL database.
+- `LANGFLOW_CONFIG_DIR`: The directory where LangFlow stores logs, file storage, monitor data, and secret keys.
+
+Volumes:
+
+- `langflow-data`: This volume is mapped to `/var/lib/langflow` in the container.
+
+### PostgreSQL Service
+
+The `postgres` service uses the `postgres:16` Docker image and exposes port 5432.
+
+Environment variables:
+
+- `POSTGRES_USER`: The username for the PostgreSQL database.
+- `POSTGRES_PASSWORD`: The password for the PostgreSQL database.
+- `POSTGRES_DB`: The name of the PostgreSQL database.
+
+Volumes:
+
+- `langflow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
+
+## Switching to a Specific LangFlow Version
+
+If you want to use a specific version of LangFlow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.
diff --git a/docs/docs/deployment/jina-deployment.md b/docs/docs/deployment/jina-deployment.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/docs/docs/integrations/notion/add-content-to-page.md b/docs/docs/integrations/notion/add-content-to-page.md
index 243c09d81..ace43e103 100644
--- a/docs/docs/integrations/notion/add-content-to-page.md
+++ b/docs/docs/integrations/notion/add-content-to-page.md
@@ -9,14 +9,11 @@ The `AddContentToPage` component converts markdown text to Notion blocks and app
[Notion Reference](https://developers.notion.com/reference/patch-block-children)
-
-
The `AddContentToPage` component enables you to:
- Convert markdown text to Notion blocks.
- Append the converted blocks to a specified Notion page.
- Seamlessly integrate Notion content creation into Langflow workflows.
-
## Component Usage
@@ -100,8 +97,6 @@ class NotionPageCreator(CustomComponent):
## Example Usage
-
-
Example of using the `AddContentToPage` component in a Langflow flow using Markdown as input:
-
## Best Practices
When using the `AddContentToPage` component:
diff --git a/docs/docs/integrations/notion/list-users.md b/docs/docs/integrations/notion/list-users.md
index c22c20ca8..0eb8236f5 100644
--- a/docs/docs/integrations/notion/list-users.md
+++ b/docs/docs/integrations/notion/list-users.md
@@ -9,13 +9,11 @@ The `NotionUserList` component retrieves users from Notion. It provides a conven
[Notion Reference](https://developers.notion.com/reference/get-users)
-
- The `NotionUserList` component enables you to:
+The `NotionUserList` component enables you to:
- Retrieve user data from Notion
- Access user information such as ID, type, name, and avatar URL
- Integrate Notion user data seamlessly into your Langflow workflows
-
## Component Usage
@@ -95,7 +93,6 @@ class NotionUserList(CustomComponent):
## Example Usage
-
Here's an example of how you can use the `NotionUserList` component in a Langflow flow and passing the outputs to the Prompt component:
-
-
## Best Practices
When using the `NotionUserList` component, consider the following best practices:
diff --git a/docs/sidebars.js b/docs/sidebars.js
index b12111797..04d81d475 100644
--- a/docs/sidebars.js
+++ b/docs/sidebars.js
@@ -113,7 +113,11 @@ module.exports = {
type: "category",
label: "Deployment",
collapsed: true,
- items: ["deployment/gcp-deployment"],
+ items: [
+ "deployment/docker",
+ "deployment/backend-only",
+ "deployment/gcp-deployment",
+ ],
},
{
type: "category",
diff --git a/docs/static/logos/twitter.svg b/docs/static/logos/twitter.svg
index 027488d3c..437e2bfdd 100644
--- a/docs/static/logos/twitter.svg
+++ b/docs/static/logos/twitter.svg
@@ -1,3 +1,3 @@
-