Render Tutorials
Render Workflows quickstart

Scaffold your workflow service

⏱ 8 min

The Render CLI ships an init command that drops a working Workflow project on your disk in a single step. You’ll use it, then poke at what it generated.

1. Install the Render CLI

You need version 2.11.0 or newer for the workflow commands. Check first:

Terminal
$render --version
render version 2.11.0 (or newer)

If the command isn’t found or the version is too old, install or upgrade:

Terminal
brew install render
# or upgrade an existing install
brew upgrade render
Terminal
curl -fsSL https://raw.githubusercontent.com/render-oss/cli/main/bin/install.sh | sh

Download the executable from the CLI releases page and put it on your PATH.

2. Scaffold the project

Run init from the directory where you want a new workflows/ folder:

Terminal
$render workflows init
? Choose a language: (Use arrow keys)
> Python
TypeScript

Pick your language, accept the defaults, and the CLI will:

  1. Create a workflows/ directory A self-contained folder with its own dependency file - separate from anything you already have at the project root.
  2. Drop in a starter task A calculateSquare task plus a couple of more advanced examples (fan-out, retries) so you have something to copy from.
  3. Print next steps Including the local-dev command for the language you picked.

3. What it generated

workflows/main.py
from render_sdk import Workflows, Retry
import asyncio
import random
app = Workflows()
@app.task
def calculate_square(a: int) -> int:
return a * a
@app.task
async def sum_squares(a: int, b: int) -> int:
result1, result2 = await asyncio.gather(
calculate_square(a),
calculate_square(b),
)
return result1 + result2
@app.task(
retry=Retry(max_retries=3, wait_duration_ms=1000, backoff_scaling=1.5)
)
def flip_coin() -> str:
if random.random() < 0.5:
raise Exception("Flipped tails! Retrying.")
return "Flipped heads!"
if __name__ == "__main__":
app.start()
workflows/requirements.txt
render_sdk

Install the SDK into a venv so the editor and the dev server can find it:

Terminal
cd workflows
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cd ..
workflows/index.ts
import { task } from "@renderinc/sdk/workflows";
const calculateSquare = task(
{ name: "calculateSquare" },
function calculateSquare(a: number): number {
return a * a;
},
);
const sumSquares = task(
{ name: "sumSquares" },
async function sumSquares(a: number, b: number): Promise<number> {
const [result1, result2] = await Promise.all([
calculateSquare(a),
calculateSquare(b),
]);
return result1 + result2;
},
);
const flipCoin = task(
{
name: "flipCoin",
retry: { maxRetries: 3, waitDurationMs: 1000, backoffScaling: 1.5 },
},
function flipCoin(): string {
if (Math.random() < 0.5) {
throw new Error("Flipped tails! Retrying.");
}
return "Flipped heads!";
},
);
workflows/package.json
{
"scripts": {
"start": "tsx index.ts"
},
"dependencies": {
"@renderinc/sdk": "^0.4.1"
},
"devDependencies": {
"tsx": "^4.20.2"
}
}

Install dependencies:

Terminal
npm install --prefix workflows

4. Sanity-check what registered

The CLI ships a local task server. Start it in one terminal and list tasks in another.

Terminal 1 - task server
render workflows dev -- python workflows/main.py
Terminal 1 - task server
render workflows dev -- npx tsx workflows/index.ts
Terminal 2 - list registered tasks
render workflows tasks list --local

You should see three tasks: calculateSquare (or calculate_square), sumSquares (or sum_squares), and flipCoin (or flip_coin). If you don’t, the most common cause is the dev server not being started yet or the --local flag being missing.

What does `render workflows tasks list --local` do?

What you learned

  • Installed/verified the Render CLI 2.11.0+
  • Generated a workflows/ directory with `render workflows init`
  • Started a local task server and confirmed three tasks registered