Guides
Retool Workflows Python Custom Libraries: Full Setup Guide
Retool Workflows Python custom libraries are now generally available on cloud, and they solve one of the most frustrating limits of building automation workflows in Retool: being locked to a fixed set of pre-approved packages. If you've ever hit a wall because a library like neo4j, httpx, or any niche data-processing package wasn't on the preset list, this feature removes that constraint entirely. You can now install any public PyPI library directly inside the workflow editor.
What Are Retool Workflows Python Custom Libraries?
Previously, Retool Workflows shipped with a curated set of Python libraries that users could optionally enable before deploying a workflow. It worked for common use cases, but the moment you needed something outside that list — a graph database driver, a specialized API client, a domain-specific data tool — you were stuck. The new custom libraries feature lets you search for and install any package available on PyPI, directly from within the workflow editor. It's available on Retool Cloud (GA as of March 2024) and on self-hosted (on-prem) instances running version 3.20 or later.
How to Add a Python Library to a Retool Workflow
Adding a custom library takes about 30 seconds once you know where to look. Here's the step-by-step process:
- Open the workflow you want to modify in the Retool Workflow Editor.
- Click on the Custom Libraries modal — typically accessible from the workflow settings or toolbar.
- In the "Add Python library" search field, type the name of the PyPI package you need (e.g.,
neo4j,pandas,httpx). - Retool will surface matching library names along with their latest available versions.
- Click the library to add it at the latest version, or select "Modify requirements.txt" to pin a specific version manually.
- Save the workflow — the libraries will be bundled into your deployment automatically.
How to Pin a Specific Library Version
If you need a specific version of a package — because of a breaking change in a newer release or a compatibility requirement — use the "Modify requirements.txt" option inside the custom libraries modal. This gives you a raw requirements.txt editor where you can specify versions exactly as you would in any Python project:
pandas==1.5.3httpx==0.24.1neo4j==5.8.0
This is the same format used by pip, so if you're already maintaining a requirements.txt for a project, you can paste it directly.
Migrating a One-Off Python Script Into a Retool Scheduled Workflow
One of the most practical use cases for this feature is turning an existing Python script into a scheduled Retool workflow. If your script already has a virtual environment, you can export its dependencies with:
- Run
pip freezein your local environment to get a full list of installed packages and their pinned versions. - Copy the entire output.
- Open the Custom Libraries modal in Retool Workflows.
- Select "Modify requirements.txt" and paste the
pip freezeoutput directly. - Retool will resolve and install all listed packages when the workflow runs.
This makes it significantly faster to port scripts that were previously running on a cron job, a Lambda function, or a local machine into a managed, observable Retool workflow — without manually hunting down every dependency.
Current Limitations to Know Before You Ship
The feature is powerful, but there are a few constraints worth knowing before you build something that depends on it:
- Size limit: The total set of custom libraries for a workflow has a 500 MB size cap. Large ML libraries like
torchortensorflowwill likely hit this ceiling. - No browser automation support: Packages that rely on headless browsers (e.g.,
playwright,selenium) are not supported in the workflows runtime. - Autocomplete may lag: The Retool editor's autocomplete may not fully recognize custom-installed libraries and could surface a false error for an imported package. The code will still run correctly — it's a display issue, not a runtime one.
- On-prem requires manual enablement: If you're on a self-hosted Retool instance at version 3.20+, the feature isn't automatically enabled. You'll need to reach out to Retool directly to have it turned on for your organization.
Who Should Use This Feature
If you're building internal tools that involve any of the following, Retool Workflows Python custom libraries are worth enabling immediately:
- Connecting to databases with no native Retool resource support (e.g.,
neo4j,influxdb-client) - Running data transformation pipelines that rely on
pandas,polars, ornumpy - Calling third-party APIs using typed clients instead of raw HTTP requests
- Migrating scheduled Python scripts from Lambda, cron, or Airflow into Retool's workflow scheduler
The ability to paste a pip freeze output directly into the workflow editor is a small touch that will save hours for anyone who's ever tried to recreate a working Python environment from scratch inside a new platform. This is one of those quality-of-life upgrades that quietly makes Retool a much more serious option for teams running complex backend automation.
Ready to build?
We scope, design, and ship your Retool app — fast.