Skip to content

Conversation

@adriandlam
Copy link
Member

@adriandlam adriandlam commented Oct 27, 2025

docs were missing WorkflowReadableStreamOptions in start page.

also export type WorkflowReadableStreamOptions from workflow/api

@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

🦋 Changeset detected

Latest commit: d5b7d4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
workflow Patch
@workflow/ai Patch
@workflow/world-testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Oct 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Comment Oct 27, 2025 8:48pm
example-nextjs-workflow-webpack Ready Ready Preview Comment Oct 27, 2025 8:48pm
example-workflow Ready Ready Preview Comment Oct 27, 2025 8:48pm
workbench-nitro-workflow Ready Ready Preview Comment Oct 27, 2025 8:48pm
workflow-docs Ready Ready Preview Comment Oct 27, 2025 8:48pm

Comment on lines +54 to +62
#### WorkflowReadableStreamOptions

<TSDoc
definition={generateDefinition({
code: `
import type { WorkflowReadableStreamOptions } from 'workflow/api';
export default WorkflowReadableStreamOptions;`
})}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

The WorkflowReadableStreamOptions documentation section is incorrectly placed under the "Returns" section, but it's not actually a return type of start(). It's a parameter type for the Run.getReadable() method, so it should be documented elsewhere or repositioned.

View Details
📝 Patch Details
diff --git a/docs/content/docs/api-reference/workflow-api/start.mdx b/docs/content/docs/api-reference/workflow-api/start.mdx
index 62de19f..72a339d 100644
--- a/docs/content/docs/api-reference/workflow-api/start.mdx
+++ b/docs/content/docs/api-reference/workflow-api/start.mdx
@@ -51,16 +51,6 @@ export default Run;`
 showSections={['returns']}
 />
 
-#### WorkflowReadableStreamOptions
-
-<TSDoc
-definition={generateDefinition({
-  code: `
-import type { WorkflowReadableStreamOptions } from 'workflow/api';
-export default WorkflowReadableStreamOptions;`
-})}
-/>
-
 ## Good to Know
 
 * The `start()` function is used in runtime/non-workflow contexts to programmatically trigger workflow executions.
@@ -89,3 +79,17 @@ const run = await start(myWorkflow, ['arg1', 'arg2'], { // [!code highlight]
   deploymentId: 'custom-deployment-id' // [!code highlight]
 }); // [!code highlight]
 ```
+
+## Type Reference
+
+### WorkflowReadableStreamOptions
+
+Used when calling [`Run.getReadable()`](/docs/api-reference/workflow-api/start#getReadable) on the returned `Run` object to configure the readable stream:
+
+<TSDoc
+definition={generateDefinition({
+  code: `
+import type { WorkflowReadableStreamOptions } from 'workflow/api';
+export default WorkflowReadableStreamOptions;`
+})}
+/>

Analysis

Incorrectly placed WorkflowReadableStreamOptions documentation under Returns section

What fails: Documentation for WorkflowReadableStreamOptions is placed under the "Returns" section of start() function documentation, implying it's a return type of start(), when it's actually a parameter type for Run.getReadable(options: WorkflowReadableStreamOptions)

How to reproduce:

  1. Navigate to docs/content/docs/api-reference/workflow-api/start.mdx
  2. View the documentation - WorkflowReadableStreamOptions is listed under "Returns" after the Run class documentation
  3. This suggests to developers that WorkflowReadableStreamOptions is returned by start(), which is incorrect

Current behavior: start() returns a Run object. The WorkflowReadableStreamOptions type is only used as a parameter when calling the Run.getReadable() method, not as a return type.

Expected behavior: Documentation should make clear that WorkflowReadableStreamOptions is a parameter type for Run methods, not a return type of start(). Moved documentation to new "Type Reference" section after examples to clarify its relationship to the Run.getReadable() method.

Fix: Removed WorkflowReadableStreamOptions from the Returns section and added it to a new "Type Reference" section at the end of the documentation with clarification that it's used when calling Run.getReadable().

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.

2 participants