Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/content/docs/api-reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,33 @@ All the functions and primitives that come with Workflow SDK by package.
<Card title="workflow/api" href="/docs/api-reference/workflow-api">
API reference for runtime functions from the `workflow/api` package.
</Card>
<Card title="workflow/runtime" href="/docs/api-reference/workflow-runtime">
Runtime functions for resolving the World instance and the low-level World SDK.
</Card>
<Card title="workflow/observability" href="/docs/api-reference/workflow-observability">
Utilities to hydrate step I/O, parse display names, and decrypt workflow data.
</Card>
<Card title="workflow/next" href="/docs/api-reference/workflow-next">
Next.js integration for Workflow SDK that automatically configures bundling and runtime support.
</Card>
<Card title="workflow/nitro" href="/docs/api-reference/workflow-nitro">
Nitro module for workflow bundling and runtime support.
</Card>
<Card title="workflow/nuxt" href="/docs/api-reference/workflow-nuxt">
Nuxt module for workflow bundling and runtime support.
</Card>
<Card title="workflow/sveltekit" href="/docs/api-reference/workflow-sveltekit">
SvelteKit Vite plugin for workflow bundling and runtime support.
</Card>
<Card title="workflow/astro" href="/docs/api-reference/workflow-astro">
Astro integration for workflow bundling and runtime support.
</Card>
<Card title="workflow/vite" href="/docs/api-reference/workflow-vite">
Standalone Vite plugin for workflow bundling and runtime support.
</Card>
<Card title="workflow/nest" href="/docs/api-reference/workflow-nest">
NestJS module for workflow bundling and runtime support.
</Card>
<Card title="workflow/errors" href="/docs/api-reference/workflow-errors">
Semantic error types for handling workflow storage backend failures.
</Card>
Expand Down
8 changes: 8 additions & 0 deletions docs/content/docs/api-reference/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"workflow-globals",
"workflow",
"workflow-api",
"workflow-runtime",
"workflow-observability",
"workflow-next",
"workflow-nitro",
"workflow-nuxt",
"workflow-sveltekit",
"workflow-astro",
"workflow-vite",
"workflow-nest",
"workflow-errors",
"workflow-serde",
"workflow-ai",
Expand Down
6 changes: 0 additions & 6 deletions docs/content/docs/api-reference/vitest/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The `@workflow/vitest` package provides a Vitest plugin and test helpers for run

Returns a Vite plugin array that handles SWC transforms, bundle building, and in-process handler registration automatically.

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { defineConfig } from "vitest/config";
Expand All @@ -24,7 +23,6 @@ export default defineConfig({

Pass a [`WorkflowTestOptions`](#workflowtestoptions) object when your project uses a non-standard layout — for example, a monorepo where `workflows/` does not live at the Vitest config's directory, or when the default `.workflow-data` / `.workflow-vitest` output locations need to move. The plugin forwards these paths to `buildWorkflowTests()` and `setupWorkflowTests()` through Vitest's per-project provided context, so each Vitest workspace project stays isolated.

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { defineConfig } from "vitest/config";
Expand Down Expand Up @@ -54,7 +52,6 @@ export default defineConfig({

Builds workflow and step bundles to disk. Called automatically by the `workflow()` plugin in `globalSetup`. Use directly only for [manual setup](/docs/testing#manual-setup).

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { buildWorkflowTests } from "@workflow/vitest";
Expand All @@ -76,7 +73,6 @@ Sets up an in-process workflow runtime in each test worker. Imports pre-built bu

Called automatically by the `workflow()` plugin in `setupFiles`. Use directly only for [manual setup](/docs/testing#manual-setup).

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { beforeAll, afterAll } from "vitest";
Expand Down Expand Up @@ -118,7 +114,6 @@ Tears down the workflow test world. Clears the global world and closes the Local

Polls the event log until the workflow has a pending `sleep()` call — one with a `wait_created` event but no corresponding `wait_completed` event. Returns the correlation ID of the pending sleep, which can be passed to [`wakeUp()`](/docs/api-reference/workflow-api/get-run) to target a specific sleep.

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { waitForSleep } from "@workflow/vitest"; // [!code highlight]
Expand Down Expand Up @@ -147,7 +142,6 @@ await getRun(run.runId).wakeUp({ correlationIds: [sleepId] }); // [!code highlig

Polls the hook list and event log until a hook matching the optional `token` filter exists that hasn't been received yet. Returns the matching hook object.

{/* @skip-typecheck - @workflow/vitest not available in docs-typecheck */}

```typescript
import { waitForHook } from "@workflow/vitest"; // [!code highlight]
Expand Down
14 changes: 6 additions & 8 deletions docs/content/docs/api-reference/workflow-api/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "workflow/api"
description: Runtime functions to inspect runs, start workflows, and access world data.
description: Runtime functions to inspect runs, start workflows, and manage hooks.
type: overview
summary: Explore runtime functions for starting workflows, inspecting runs, and managing hooks.
---
Expand All @@ -9,7 +9,7 @@ API reference for runtime functions from the `workflow/api` package.

## Functions

The API package is for access and introspection of workflow data to inspect runs, start new runs, or access anything else directly accessible by the world.
The API package is for access and introspection of workflow data to inspect runs, start new runs, and manage hooks.

<Cards>
<Card href="/docs/api-reference/workflow-api/start" title="start()">
Expand All @@ -27,10 +27,8 @@ The API package is for access and introspection of workflow data to inspect runs
<Card href="/docs/api-reference/workflow-api/get-run" title="getRun()">
Get workflow run status and metadata without waiting for completion.
</Card>
<Card href="/docs/api-reference/workflow-api/get-world" title="getWorld()">
Get direct access to workflow storage, queuing, and streaming backends.
</Card>
<Card href="/docs/api-reference/workflow-api/world" title="World SDK">
Low-level API for inspecting runs, steps, events, hooks, streams, and queues.
</Card>
</Cards>

<Callout type="info">
Looking for `getWorld()` and the World SDK? They are exported from `workflow/runtime` — see the [`workflow/runtime` reference](/docs/api-reference/workflow-runtime).
</Callout>

This file was deleted.

164 changes: 0 additions & 164 deletions docs/content/docs/api-reference/workflow-api/world/observability.mdx

This file was deleted.

5 changes: 5 additions & 0 deletions docs/content/docs/api-reference/workflow-errors/meta.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"title": "workflow/errors",
"pages": [
"workflow-error",
"hook-not-found-error",
"hook-conflict-error",
"step-not-registered-error",
"workflow-not-registered-error",
"workflow-run-not-found-error",
"workflow-run-failed-error",
"workflow-run-cancelled-error",
"workflow-run-not-completed-error",
"workflow-runtime-error",
"workflow-world-error",
"throttle-error",
"entity-conflict-error",
"run-expired-error",
"run-not-supported-error",
"too-early-error"
]
}
1 change: 0 additions & 1 deletion docs/content/docs/api-reference/workflow-serde/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ The `@workflow/serde` package provides two symbols that allow you to define cust

## Quick Example

{/* @expect-error:2351 */}

```typescript lineNumbers
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from "@workflow/serde";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ A symbol used to define custom deserialization for user-defined class instances.

## Usage

{/* @expect-error:2351 */}

```typescript lineNumbers
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from "@workflow/serde";
Expand All @@ -26,7 +25,7 @@ class Point {

## API Signature

{/* @skip-typecheck */}
{/* @skip-typecheck: type-only signature snippet, not compilable code */}

```typescript
static [WORKFLOW_DESERIALIZE](data: SerializableData): T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ A symbol used to define custom serialization for user-defined class instances. T

## Usage

{/* @expect-error:2351 */}

```typescript lineNumbers
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from "@workflow/serde";
Expand All @@ -26,7 +25,7 @@ class Point {

## API Signature

{/* @skip-typecheck */}
{/* @skip-typecheck: type-only signature snippet, not compilable code */}

```typescript
static [WORKFLOW_SERIALIZE](instance: T): SerializableData
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/foundations/streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ Stream errors don't trigger automatic retries for the producer step. Design your
- [`sleep()` API Reference](/docs/api-reference/workflow/sleep) - Pause workflow execution for a duration
- [`start()` API Reference](/docs/api-reference/workflow-api/start) - Start workflows and access the `Run` object
- [`getRun()` API Reference](/docs/api-reference/workflow-api/get-run) - Retrieve runs and their streams later
- [world.streams](/docs/api-reference/workflow-api/world/streams) - Low-level stream read/write/close via World SDK
- [world.streams](/docs/api-reference/workflow-runtime/world/streams) - Low-level stream read/write/close via World SDK
- [DurableAgent](/docs/api-reference/workflow-ai/durable-agent) - AI agents with built-in streaming support
- [Errors and Retries](/docs/foundations/errors-and-retries) - Understanding error handling and retry behavior
- [Serialization](/docs/foundations/serialization) - Understanding what data types can be passed in workflows
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/foundations/versioning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ npx workflow cancel \
--backend vercel
```

The `--workflowName` filter expects the generated workflow ID, not only the exported function's short name. Use the `workflowName` value from `workflow inspect runs`, and use [`parseWorkflowName()`](/docs/api-reference/workflow-api/world/observability) when you need display-friendly names.
The `--workflowName` filter expects the generated workflow ID, not only the exported function's short name. Use the `workflowName` value from `workflow inspect runs`, and use [`parseWorkflowName()`](/docs/api-reference/workflow-observability/parse-workflow-name) when you need display-friendly names.

In the [observability UI](/docs/observability), use **Rerun on latest** to enqueue the workflow again with the same inputs against the latest deployment.

Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/how-it-works/encryption.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ To add encryption support to a custom `World`:
import type { WorkflowRun, World } from "@workflow/world";

export const getEncryptionKeyForRun: World["getEncryptionKeyForRun"] = async (
run,
context
run: WorkflowRun | string,
context?: Record<string, unknown>
) => {
const runId = typeof run === "string" ? run : run.runId;
const deploymentId =
Expand Down
Loading