From f208ae3240727b34f62753edef95a536b0f57a42 Mon Sep 17 00:00:00 2001 From: Stephen Barlow Date: Mon, 30 Mar 2026 14:57:11 -0700 Subject: [PATCH] Update docstrings and openai model for ts --- README.md | 2 +- data-pipeline/package.json | 2 +- data-pipeline/template.yaml | 2 +- etl-job/package.json | 2 +- etl-job/src/main.ts | 8 ++++---- file-analyzer/api-service/package.json | 2 +- file-analyzer/workflow-service/package.json | 2 +- file-analyzer/workflow-service/src/main.ts | 8 ++++---- file-processing/package.json | 2 +- hello-world/README.md | 12 ++++++------ hello-world/package.json | 2 +- hello-world/src/main.ts | 8 ++++---- hello-world/template.yaml | 4 ++-- openai-agent/package.json | 2 +- openai-agent/src/main.ts | 2 +- openai-agent/template.yaml | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 477ddff..4da7da2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Example projects demonstrating [Render Workflows](https://render.com/docs/workfl | Example | Description | |---------|-------------| -| [hello-world](./hello-world) | Simplest workflow — learn tasks, subtasks, and orchestration | +| [hello-world](./hello-world) | Simplest workflow — learn tasks, task chaining, and orchestration | | [etl-job](./etl-job) | Extract, transform, load pipeline with retry handling | | [data-pipeline](./data-pipeline) | Multi-source data pipeline with enrichment and segmentation | | [file-processing](./file-processing) | File ingestion with validation, parsing, and transformation | diff --git a/data-pipeline/package.json b/data-pipeline/package.json index 65ca0e2..a8df7b7 100644 --- a/data-pipeline/package.json +++ b/data-pipeline/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/data-pipeline/template.yaml b/data-pipeline/template.yaml index 4b5ab6f..cda5565 100644 --- a/data-pipeline/template.yaml +++ b/data-pipeline/template.yaml @@ -13,7 +13,7 @@ renderStartCommand: node dist/main.js nextSteps: - label: Enter your project directory command: cd {{dir}} - - label: Start your local task server + - label: Start your local workflow service command: render workflows dev -- {{startCommand}} hint: This runs your workflow service locally, allowing you to view and run tasks without deploying to Render. - label: Run the pipeline locally (in another terminal) diff --git a/etl-job/package.json b/etl-job/package.json index 3589fc6..da3bf61 100644 --- a/etl-job/package.json +++ b/etl-job/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/etl-job/src/main.ts b/etl-job/src/main.ts index 29073d8..3c761b3 100644 --- a/etl-job/src/main.ts +++ b/etl-job/src/main.ts @@ -29,7 +29,7 @@ const retry = { backoffScaling: 1.5, }; -// Subtask: extract rows from a CSV file +// Chained task: extract rows from a CSV file const extractCsvData = task( { name: "extractCsvData", retry }, function extractCsvData(filePath: string): Record[] { @@ -66,7 +66,7 @@ const extractCsvData = task( }, ); -// Subtask: validate and clean a single record +// Chained task: validate and clean a single record const validateRecord = task( { name: "validateRecord", retry }, function validateRecord(record: Record): ValidatedRecord { @@ -109,7 +109,7 @@ const validateRecord = task( }, ); -// Subtask: validate a batch of records by calling validateRecord for each +// Chained task: validate a batch of records by calling validateRecord for each const transformBatch = task( { name: "transformBatch", retry }, async function transformBatch(records: Record[]) { @@ -145,7 +145,7 @@ const transformBatch = task( }, ); -// Subtask: compute statistics from validated records +// Chained task: compute statistics from validated records const computeStatistics = task( { name: "computeStatistics", retry }, function computeStatistics(validRecords: ValidatedRecord[]) { diff --git a/file-analyzer/api-service/package.json b/file-analyzer/api-service/package.json index 3b4e9e6..ad46856 100644 --- a/file-analyzer/api-service/package.json +++ b/file-analyzer/api-service/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7", "express": "^5.1.0", "multer": "^1.4.5-lts.2" diff --git a/file-analyzer/workflow-service/package.json b/file-analyzer/workflow-service/package.json index 77fd733..96e1f7c 100644 --- a/file-analyzer/workflow-service/package.json +++ b/file-analyzer/workflow-service/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/file-analyzer/workflow-service/src/main.ts b/file-analyzer/workflow-service/src/main.ts index 5bfbd64..6ca226c 100644 --- a/file-analyzer/workflow-service/src/main.ts +++ b/file-analyzer/workflow-service/src/main.ts @@ -16,7 +16,7 @@ const retry = { backoffScaling: 1.5, }; -// Subtask: parse CSV content into structured data +// Chained task: parse CSV content into structured data const parseCsvData = task( { name: "parseCsvData", retry }, function parseCsvData(fileContent: string): ParsedData { @@ -53,7 +53,7 @@ const parseCsvData = task( }, ); -// Subtask: calculate statistics from parsed data +// Chained task: calculate statistics from parsed data const calculateStatistics = task( { name: "calculateStatistics", retry }, function calculateStatistics(data: ParsedData) { @@ -108,7 +108,7 @@ const calculateStatistics = task( }, ); -// Subtask: identify trends and patterns +// Chained task: identify trends and patterns const identifyTrends = task( { name: "identifyTrends", retry }, function identifyTrends(data: ParsedData) { @@ -160,7 +160,7 @@ const identifyTrends = task( }, ); -// Subtask: generate insights report +// Chained task: generate insights report const generateInsights = task( { name: "generateInsights", retry }, async function generateInsights( diff --git a/file-processing/package.json b/file-processing/package.json index 6df4efb..76cd2d5 100644 --- a/file-processing/package.json +++ b/file-processing/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/hello-world/README.md b/hello-world/README.md index 036c26f..f148c7c 100644 --- a/hello-world/README.md +++ b/hello-world/README.md @@ -5,7 +5,7 @@ The simplest possible workflow example to help you understand the basics of Rend ## What you'll learn - **What is a task?** A function that can be executed as a workflow -- **What is a subtask?** A task called by another task using `await` +- **What is task chaining?** A task calling another task using `await` - **How to orchestrate:** Combining multiple tasks to create workflows ## Workflow structure @@ -13,12 +13,12 @@ The simplest possible workflow example to help you understand the basics of Rend ``` calculateAndProcess (multi-step orchestrator) ├── addDoubledNumbers - │ ├── double (subtask #1) - │ └── double (subtask #2) + │ ├── double (chained run #1) + │ └── double (chained run #2) └── processNumbers - ├── double (subtask for item 1) - ├── double (subtask for item 2) - └── double (subtask for item N) + ├── double (chained run for item 1) + ├── double (chained run for item 2) + └── double (chained run for item N) ``` ## Run locally diff --git a/hello-world/package.json b/hello-world/package.json index 9b3dd68..c2d526c 100644 --- a/hello-world/package.json +++ b/hello-world/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7" }, "devDependencies": { diff --git a/hello-world/src/main.ts b/hello-world/src/main.ts index 01bedee..60b15bc 100644 --- a/hello-world/src/main.ts +++ b/hello-world/src/main.ts @@ -1,7 +1,7 @@ import "dotenv/config"; import { task } from "@renderinc/sdk/workflows"; -// Subtask: doubles a number +// Task used in task chaining: doubles a number const double = task({ name: "double" }, function double(x: number): number { console.log(`[TASK] Doubling ${x}`); const result = x * 2; @@ -9,7 +9,7 @@ const double = task({ name: "double" }, function double(x: number): number { return result; }); -// Subtask (also callable as root): doubles two numbers and sums them +// Chained task (also callable as root): doubles two numbers and sums them const addDoubledNumbers = task( { name: "addDoubledNumbers" }, async function addDoubledNumbers(a: number, b: number) { @@ -31,7 +31,7 @@ const addDoubledNumbers = task( }, ); -// Subtask (also callable as root): doubles each number in a list +// Chained task (also callable as root): doubles each number in a list const processNumbers = task( { name: "processNumbers" }, async function processNumbers(...numbers: number[]) { @@ -51,7 +51,7 @@ const processNumbers = task( original_numbers: numbers, doubled_numbers: doubledResults, count: numbers.length, - explanation: `Processed ${numbers.length} numbers through the double subtask`, + explanation: `Processed ${numbers.length} numbers by chaining runs of double`, }; console.log("[WORKFLOW] Complete:", result); diff --git a/hello-world/template.yaml b/hello-world/template.yaml index 0093ad2..31a6331 100644 --- a/hello-world/template.yaml +++ b/hello-world/template.yaml @@ -3,7 +3,7 @@ # after scaffolding. You can safely ignore it when using this example directly. name: Hello World -description: Simple task and subtask basics +description: Simple task and task-chaining basics default: true workflowsRoot: . @@ -14,7 +14,7 @@ renderStartCommand: node dist/main.js nextSteps: - label: Enter your project directory command: cd {{dir}} - - label: Start your local task server + - label: Start your local workflow service command: render workflows dev -- {{startCommand}} hint: This runs your workflow service locally, allowing you to view and run tasks without deploying to Render. - label: Run a task locally (in another terminal) diff --git a/openai-agent/package.json b/openai-agent/package.json index bf16cc6..dbf88a9 100644 --- a/openai-agent/package.json +++ b/openai-agent/package.json @@ -9,7 +9,7 @@ "dev": "tsx src/main.ts" }, "dependencies": { - "@renderinc/sdk": "latest", + "@renderinc/sdk": "^0.5.0", "dotenv": "^16.4.7", "openai": "^4.77.0" }, diff --git a/openai-agent/src/main.ts b/openai-agent/src/main.ts index 2a94582..0b75943 100644 --- a/openai-agent/src/main.ts +++ b/openai-agent/src/main.ts @@ -157,7 +157,7 @@ const callLlmWithTools = task( async function callLlmWithTools( messages: ChatCompletionMessageParam[], toolDefs: ChatCompletionTool[], - model: string = "gpt-4", + model: string = "gpt-5.4", ) { console.log(`[AGENT] Calling ${model} with ${toolDefs.length} tools available`); diff --git a/openai-agent/template.yaml b/openai-agent/template.yaml index 5c6837d..3c50e01 100644 --- a/openai-agent/template.yaml +++ b/openai-agent/template.yaml @@ -13,12 +13,12 @@ renderStartCommand: node dist/main.js nextSteps: - label: Enter your project directory command: cd {{dir}} - - label: Start your local task server + - label: Start your local workflow service command: render workflows dev -- {{startCommand}} hint: This runs your workflow service locally, allowing you to view and run tasks without deploying to Render. - label: Set your OpenAI API key command: export OPENAI_API_KEY=your-key-here - hint: Required for the agent to call GPT-4. + hint: Required for the agent to call the configured OpenAI model. - label: Run a conversation locally (in another terminal) command: "render workflows tasks start multiTurnConversation --local --input='[\"What is the status of order ORD-001?\"]'" hint: The agent will use tool calling to look up the order and respond.