Skip to content

Comments

Update docs to use ow.runWorkflow#286

Merged
jamescmartinez merged 1 commit intomainfrom
run-workflow-docs
Feb 12, 2026
Merged

Update docs to use ow.runWorkflow#286
jamescmartinez merged 1 commit intomainfrom
run-workflow-docs

Conversation

@jamescmartinez
Copy link
Contributor

Closes #285

context for this PR in #285

Copilot AI review requested due to automatic review settings February 12, 2026 17:52
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez jamescmartinez merged commit f718da1 into main Feb 12, 2026
12 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with ow.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";
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
import { ow } from "./openworkflow/client";
import { ow } from "./openworkflow/client.js";

Copilot uses AI. Check for mistakes.
Comment on lines 113 to 116
```ts
const run = await myWorkflow.run({ data: "..." });
const run = await ow.runWorkflow(myWorkflow.spec, { data: "..." });

// Wait for the workflow to finish (polls the database)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Use the `cancel()` method on a workflow run handle:

```ts
import { ow } from "./openworkflow/client";
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
import { ow } from "./openworkflow/client";
import { ow } from "./openworkflow/client.js";

Copilot uses AI. Check for mistakes.
Comment on lines +145 to 146
import { ow } from "./openworkflow/client";
import { sendEmail } from "./workflows/send-email";
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
import { ow } from "./openworkflow/client";
import { sendEmail } from "./workflows/send-email";
import { ow } from "./openworkflow/client.js";
import { sendEmail } from "./workflows/send-email.js";

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect documentation

1 participant