Skip to content
Cloudflare Docs

Python Workflows SDK

Workflow entrypoints can be declared using Python. To achieve this, you can export a WorkflowEntrypoint that runs on the Cloudflare Workers platform. Refer to Python Workers for more information about Python on the Workers runtime.

Get Started

The main entrypoint for a Python workflow is the WorkflowEntrypoint class. Your workflow logic should exist inside the run handler.

from workers import WorkflowEntrypoint
class MyWorkflow(WorkflowEntrypoint):
async def run(self, event, step):
# steps here

To run a Python Workflow locally, you use Wrangler, the CLI for Cloudflare Workers:

Terminal window
npx wrangler@latest dev

To deploy a Python Workflow to Cloudflare, run wrangler deploy:

Terminal window
npx wrangler@latest deploy