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/v4/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/v4/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/v4/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/v4/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()">
Async: resolve the World instance for 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.

This file was deleted.

18 changes: 18 additions & 0 deletions docs/content/docs/v4/api-reference/workflow-astro/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "workflow/astro"
description: Astro integration for automatic workflow bundling and route registration.
type: overview
summary: Explore the Astro integration for automatic workflow bundling and runtime support.
related:
- /docs/getting-started/astro
---

Astro integration for Workflow SDK that transforms workflow code and builds the workflow bundles.

## Functions

<Cards>
<Card title="workflow()" href="/docs/api-reference/workflow-astro/workflow">
Astro integration that transforms workflow code (`"use step"`/`"use workflow"` directives)
</Card>
</Cards>
4 changes: 4 additions & 0 deletions docs/content/docs/v4/api-reference/workflow-astro/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "workflow/astro",
"pages": ["workflow"]
}
37 changes: 37 additions & 0 deletions docs/content/docs/v4/api-reference/workflow-astro/workflow.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: workflow
description: Configure Astro to transform workflow directives.
type: reference
summary: Add the workflow integration to your Astro config to enable workflow directive transformation.
prerequisites:
- /docs/getting-started/astro
---

Returns an Astro integration that transforms workflow code (`"use step"`/`"use workflow"` directives) and builds the workflow bundles.

## Usage

To enable `"use step"` and `"use workflow"` directives while developing locally or deploying to production, add `workflow()` to the `integrations` array of your Astro config.

```typescript title="astro.config.mjs" lineNumbers
// @ts-check
import { defineConfig } from "astro/config";
import { workflow } from "workflow/astro"; // [!code highlight]

// https://astro.build/config
export default defineConfig({
integrations: [workflow()], // [!code highlight]
});
```

The integration registers the workflow Vite transform plugins during `astro:config:setup` and builds the workflow bundles — locally during config setup, or via the Vercel builder after `astro:build:done` when deploying to Vercel.

## API Signature

### Parameters

This function does not accept any parameters in workflow 4.x. (5.x adds an options object with a `sourcemap` setting.)

### Returns

Returns an `AstroIntegration` object to include in the `integrations` array of your Astro config.
Loading
Loading