Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Updates the documentation to reflect the current OpenWorkflow API, replacing the incorrect .run() usage on workflows returned by defineWorkflow with ow.runWorkflow(workflow.spec, ...) (and clarifying when .run() is available).
Changes:
- Replace
workflow.run(...)examples withow.runWorkflow(workflow.spec, ...)across multiple docs pages. - Update related explanatory text (e.g., input parameter description, quickstart/overview lifecycle wording).
- Add a note explaining that
ow.defineWorkflow(...)returns a runnable workflow that supports.run(...).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/docs/docs/workflows.mdx | Updates “Running a Workflow” to use ow.runWorkflow(...spec...) and adjusts related wording. |
| packages/docs/docs/type-safety.mdx | Fixes type-safety example to run via ow.runWorkflow(processOrder.spec, ...). |
| packages/docs/docs/standard-schema.mdx | Updates schema-validation wording and example to use ow.runWorkflow(...spec...). |
| packages/docs/docs/quickstart.mdx | Adjusts quickstart narrative to describe ow.runWorkflow(helloWorld.spec, {}). |
| packages/docs/docs/overview.mdx | Updates lifecycle step to reference enqueuing via ow.runWorkflow(workflow.spec, input). |
| packages/docs/docs/canceling.mdx | Updates canceling examples to start runs via ow.runWorkflow(workflow.spec). |
| packages/docs/docs/advanced-patterns.mdx | Replaces .run(...) examples with ow.runWorkflow(myWorkflow.spec, ...). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Start a workflow by calling `ow.runWorkflow()` with the workflow's `spec`: | ||
|
|
||
| ```ts | ||
| import { ow } from "./openworkflow/client"; |
There was a problem hiding this comment.
The examples import ow from ./openworkflow/client without a file extension, but the CLI init templates and repo examples use ./openworkflow/client.js (ESM-safe when compiling TS to JS). Consider updating these docs to use the .js extension (or add a short note explaining when extensionless imports work, e.g. with tsx).
| import { ow } from "./openworkflow/client"; | |
| import { ow } from "./openworkflow/client.js"; |
| ```ts | ||
| const run = await myWorkflow.run({ data: "..." }); | ||
| const run = await ow.runWorkflow(myWorkflow.spec, { data: "..." }); | ||
|
|
||
| // Wait for the workflow to finish (polls the database) |
There was a problem hiding this comment.
This page now uses ow.runWorkflow(...) in code blocks, but ow is not defined or imported anywhere in the document. Add a brief setup snippet (e.g., importing/constructing ow) or clarify that ow refers to your OpenWorkflow client instance before these examples.
| Use the `cancel()` method on a workflow run handle: | ||
|
|
||
| ```ts | ||
| import { ow } from "./openworkflow/client"; |
There was a problem hiding this comment.
The new example imports ow from ./openworkflow/client without an extension. For Node ESM / compiled JS setups, ./openworkflow/client.js is typically required (and matches the CLI init template). Consider updating the import to avoid copy/paste runtime errors.
| import { ow } from "./openworkflow/client"; | |
| import { ow } from "./openworkflow/client.js"; |
| import { ow } from "./openworkflow/client"; | ||
| import { sendEmail } from "./workflows/send-email"; |
There was a problem hiding this comment.
The new snippet imports ow from ./openworkflow/client without an extension. The CLI init template uses ./openworkflow/client.js, which is important for Node ESM after TS->JS compilation. Consider updating this import (or noting the expected tooling like tsx) to prevent copy/paste issues.
| import { ow } from "./openworkflow/client"; | |
| import { sendEmail } from "./workflows/send-email"; | |
| import { ow } from "./openworkflow/client.js"; | |
| import { sendEmail } from "./workflows/send-email.js"; |
Closes #285
context for this PR in #285