Render Workflow tasks do not expose HTTP ports. In a user-facing application, a Render Web Service receives the request and triggers the workflow. This guide starts with the workflow itself so you can deploy and verify the model pipeline first.
Prerequisites
You will need:- An OpenRouter API key
- A Render account
- The Render CLI installed and authenticated
- A GitHub, GitLab, or Bitbucket repository you can push to
1. Create a workflow project
Userender workflows init to scaffold Render’s Hello World starter, then add the official OpenRouter Client SDK.
@openrouter/sdk is ESM-only. Use "type": "module" in package.json (or another ESM-compatible setup). CommonJS require() is not supported..env.example file and Git repository, and prints commands for local development and deployment.
2. Add your OpenRouter key
Copy the scaffolded environment file:.env from Git. Do not commit API keys. The Render CLI loads .env automatically during local Workflow development.
If a public application will trigger this workflow, also set APP_URL to that application’s URL. OpenRouter uses APP_URL and OPENROUTER_APP_TITLE for app attribution.
Use
openrouter/auto for OpenRouter’s Auto Router. The openrouter/auto-beta slug is the early-access track where new routing behavior lands first; see Auto Router.3. Define the workflow
Replace the generated task file with the following code. The inner task makes one OpenRouter request and retries failures. The outer task fans out across every prompt. Render runs each chained task separately, so a slow or retried model call does not prevent the other calls from running.completion.model in every result makes that routing decision visible.
4. Test the workflow locally
Start Render’s local Workflow server:prompts argument.
The command returns a task-run ID. Inspect the completed run with:
5. Deploy the workflow to Render
Commit the project and push it to GitHub, GitLab, or Bitbucket. From the project directory, create the Workflow service with the Render CLI.--repo . reads the remote URL from the Git repository. --env-file .env adds the OpenRouter configuration to the Render service without committing the file.
6. Run the deployed workflow
Start the deployed batch with its full task slug:Run
render workflows tasks list and select the workflow, or copy the full task slug from the task page in the Render Dashboard.7. Trigger the workflow from an application
The CLI is the quickest way to verify the deployment. A web service can start the same task through the Render SDK. SetRENDER_API_KEY in the web service or application environment, not in the Workflow service unless the Workflow itself needs to call the Render API.