| [ Web Proxy ] |
| Viewing: https://render.com/docs/workflows-tutorial | [Back] [Original] |
Welcome to Render Workflows! Follow these steps to register your first task and trigger its first run.
You'll use the Render CLI to create a starter project with our Hello World template.
Use any of the following methods to install the Render CLI or upgrade to the latest version:
Run the following commands:
Run the following command:
If you use an architecture besides those provided, you can build from source instead.
We recommend building from source only if no other installation method works for your system.
Install the Go programming language if you haven't already.
Clone and build the CLI project with the following commands:
After installation completes, open a new terminal tab and run render with no arguments to confirm.
From your machine's development directory, run render workflows init to generate a starter project with your first task definition:
Command not found? Make sure you've upgraded to the latest version of the Render CLI.
The init command prompts you for the following, in order:
| Prompt | Description |
|---|---|
|
Language |
Choose whichever supported language you prefer (currently TypeScript or Python). |
|
Template |
Choose Hello World for this tutorial. |
|
Output directory |
The CLI creates a new directory for your project at the specified path (default |
|
Install dependencies? |
Choose Yes. |
|
Initialize a Git repository? |
Choose Yes. |
Running in non-interactive mode?
To skip prompts in scripts and agents, you can pass all options directly, like so:
For details, run render help workflows init.
Commit all of the files in your new project directory to Git:
The following excerpts from workflows init starter projects illustrate the bare minimum syntax for defining a workflow:
task and the TaskContext type from the Render SDK for TypeScript, which is the template's only dependency aside from TypeScript itself.task(...) once for each, providing options and a function definition.
TaskContext object as its first argument. Render provides this object to each task run automatically.Workflows app, then applying the @app.task decorator to any function.
TaskContext object as its first argument. Render provides this object to each task run automatically.app.start() on startup to initiate both task registration and run execution on Render.Workflows class and TaskContext type are imported from the Render SDK for Python, which is the template's only dependency.Render will deploy your project by pulling its source from a linked repo on GitHub, GitLab, or Bitbucket.
Create a new repository for your project with any of these providers and push your local repo to it.
In the Render Dashboard, click New > Workflow:
The workflow creation form appears.
Link the GitHub/GitLab/Bitbucket repo with your workflow's task definitions.
Complete the remainder of the creation form. See guidance for important fields:
| Field | Description |
|---|---|
|
Language |
|
|
Region |
All of your workflow's task runs will execute in the specified region. This determines which of your other Render services they can reach over your private network. |
|
Build Command |
If you're using the Hello World template from Otherwise, provide the command that Render should use to install dependencies and build your code. You don't provide a build command if you're using Docker. |
|
Start Command |
If you're using the Hello World template from Otherwise, provide the command that Render should use to start your workflow. |
Click Deploy Workflow. Render kicks off your workflow's first build, which includes registering your tasks.
That's it! After the build completes, your tasks are officially registered. You can view them from your workflow's Tasks page in the Render Dashboard:
Now that we've registered a task, let's run it! The quickest way to trigger our first run is in the Render Dashboard:
From your workflow's Tasks page, click a task to open its Runs page.
Click Start Task in the top-right corner of the page:
A dialog appears for providing the task's input arguments:
[Providing input arguments for a task run in the Render Dashboard]
Provide the task's input arguments as a JSON array (e.g., [5] for a task that takes a single integer argument, or [] for a task that takes zero arguments).
Click Start task.
Your new task run appears at the top of the Runs table.
Congratulations! You've registered your first workflow task and triggered its first run. Now it's time to start designing your own tasks and triggering runs from application code:
You can optionally build your workflow service from a Dockerfile. As with other Render service types, this is useful if you need to install libraries or perform build-time operations that aren't supported by Render's native language runtimes.
During 4. Create a workflow service, note the following changes:
npm start or python main.py).
CMD/ENTRYPOINT default.We'll address these limitations in future releases:
$ brew update$ brew install render
$ curl -fsSL https://raw.githubusercontent.com/render-oss/cli/refs/heads/main/bin/install.sh | sh
$ git clone git@github.com:render-oss/cli.git$ cd cli$ go build -o render
$ render workflows init
$ render workflows init --confirm --language py --template hello-world --dir my-workflow --install-deps --git
$ cd workflows-demo$ git add .$ git commit -m "Initial commit"
import { task, type TaskContext } from '@renderinc/sdk/workflows'// Minimal task definitionconst calculateSquare = task({ name: 'calculateSquare' },function calculateSquare(ctx: TaskContext, a: number): number {return a * a})
from render import TaskContext, Workflowsapp = Workflows()# Minimal task definition@app.taskdef calculate_square(ctx: TaskContext, a: int) -> int:return a * aif __name__ == "__main__":app.start() # Workflow entry point
npm install
pip install -r requirements.txt
npm start
python main.py
| Web Proxy Viewer | New URL | Original Page |