Guides

How to Use Python in Retool: Apps, Workflows & On-Prem

OTC Team··4 min read

If you're a Python developer working in Retool, you've probably hit the wall: Retool apps run on JavaScript, and there's no native Python scripting inside the drag-and-drop builder. But that doesn't mean you're stuck. Depending on whether you're on Retool Cloud or on-prem, and whether you're building an app or an automation, there are real, working options for how to use Python in Retool right now.

Why Retool Doesn't Support Python in Apps (Yet)

Retool's core product — the app builder — executes JavaScript natively in the browser and on its runtime. Python requires a server-side execution environment, which is fundamentally different from how Retool queries and transformers work today. That's why even power users find themselves hitting this limitation when trying to write Python logic directly inside a Retool app. The good news is that the Retool team is aware of the demand, and there are already two solid workarounds available.

Option 1: Run Python Scripts in Retool Workflows (Cloud)

If you're on Retool Cloud, the cleanest path to running Python is through Retool Workflows. Workflows is a separate Retool product designed for building automation logic — think of it as a visual pipeline that can be triggered by a webhook or a cron schedule.

Here's how to get Python running in a Retool Workflow:

  • Navigate to the Workflows section in your Retool dashboard (it's separate from Apps).
  • Create a new Workflow and add a Run Script block.
  • Select Python as the language for that block — this option is available on Cloud today.
  • Write your Python logic directly in the block. You can access outputs from previous blocks as variables.
  • Connect your Workflow to a webhook trigger or a cron schedule to fire it automatically.
  • Call the Workflow from a Retool app using a Trigger Workflow query to bridge the gap between your app UI and your Python logic.

This is the most seamless option if you're on Cloud. It's especially useful for things like data processing pipelines, calling Python-based APIs, or running ML inference that you'd otherwise need a separate service for.

Option 2: Trigger Python Scripts via Docker (Any Environment)

If you want to run Python from a Retool app directly — or you need something that works outside of Workflows — you can use a Docker-based approach to execute scripts in any language, including Python.

The pattern works like this:

  • Package your Python script in a Docker container that exposes an HTTP endpoint (e.g., using FastAPI or Flask).
  • Host the container somewhere Retool can reach it — locally, on your own infrastructure, or in a cloud provider.
  • Add a REST API resource in Retool pointing to your container's endpoint.
  • Call it from a Retool query in your app, passing any inputs as query parameters or a JSON body.
  • Use the response data in your app's components like any other query result.

This approach works on both Cloud and on-prem installations and gives you full control over the Python environment, dependencies, and execution. It's more setup work upfront, but it's the most flexible solution if you need heavy Python libraries like pandas, numpy, or scikit-learn.

What About Python in Retool On-Prem?

This is the most common frustration right now. If you're running Retool on-prem, Python support in Workflows is not yet available — it's a Cloud-only feature at the time of writing. Retool has indicated that on-prem support for Python in Workflows is on the roadmap, but no firm release date has been confirmed.

In the meantime, on-prem users have two practical paths:

  • Use the Docker approach described above to self-host Python script endpoints that Retool can call via REST.
  • Monitor the Retool changelog and community forums for announcements about on-prem Workflow Python support.

Retool App vs. Retool Workflow — What's the Difference?

If you're new to Retool, this distinction matters a lot when thinking about Python support. A Retool app is the main product: you drag and drop UI components, connect data sources, and write JavaScript queries to power the interface. A Retool Workflow is a separate automation product where you build logic pipelines triggered by webhooks or schedules — and this is where Python scripting lives today.

Think of apps as your internal tool's front end, and Workflows as the back-end automation layer. You can use them together: an app button can trigger a Workflow, the Workflow runs Python, and the result comes back to the app.

The Bottom Line for Python Developers

Full Python support inside Retool apps isn't here yet, but you're not blocked. If you're on Cloud, use Retool Workflows with a Python script block — it's the fastest path. If you're on-prem or need Python inside an app UI, wrap your scripts in a lightweight HTTP server via Docker and call them as a REST resource. It's a bit more infrastructure, but it works today and gives you access to the full Python ecosystem without waiting on a product roadmap.

Ready to build?

We scope, design, and ship your Retool app — fast.

Ready to ship your first tool?