workflow 4.1.0-beta.52 → 4.1.0-beta.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,42 +49,4 @@ export default async function config(
|
|
|
49
49
|
}
|
|
50
50
|
return nextConfig;
|
|
51
51
|
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Configuration
|
|
55
|
-
|
|
56
|
-
The second argument to `withWorkflow` accepts the following options:
|
|
57
|
-
|
|
58
|
-
### `workflows.dirs`
|
|
59
|
-
|
|
60
|
-
Directories to scan for workflows and steps. If provided, this completely overrides the defaults.
|
|
61
|
-
|
|
62
|
-
- **Type:** `string[]`
|
|
63
|
-
- **Default:** `['pages', 'app', 'src/pages', 'src/app']`
|
|
64
|
-
|
|
65
|
-
```typescript title="next.config.ts" lineNumbers
|
|
66
|
-
import { withWorkflow } from "workflow/next";
|
|
67
|
-
import type { NextConfig } from "next";
|
|
68
|
-
|
|
69
|
-
const nextConfig: NextConfig = {};
|
|
70
|
-
|
|
71
|
-
export default withWorkflow(nextConfig, {
|
|
72
|
-
workflows: {
|
|
73
|
-
dirs: ['workflows', 'src/workflows'], // [!code highlight]
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### `workflows.local.port`
|
|
79
|
-
|
|
80
|
-
Port for the local workflow server during development.
|
|
81
|
-
|
|
82
|
-
- **Type:** `number`
|
|
83
|
-
- **Default:** Uses the `PORT` environment variable
|
|
84
|
-
|
|
85
|
-
### `workflows.local.dataDir`
|
|
86
|
-
|
|
87
|
-
Directory for storing local workflow data during development.
|
|
88
|
-
|
|
89
|
-
- **Type:** `string`
|
|
90
|
-
- **Default:** `'.next/workflow-data'`
|
|
52
|
+
```
|
|
@@ -127,3 +127,7 @@ For more details, see the [Vercel Workflow documentation](https://vercel.com/doc
|
|
|
127
127
|
See the [Vercel Workflow documentation](https://vercel.com/docs/workflow) for current pricing and to learn more.
|
|
128
128
|
|
|
129
129
|
For self-hosted deployments, use the [Postgres World](/worlds/postgres). For local development, use the [Local World](/worlds/local).
|
|
130
|
+
|
|
131
|
+
## Limitations
|
|
132
|
+
|
|
133
|
+
- **Single-region deployment** - The backend infrastructure is currently deployed only in `iad1`. Applications in other regions will route workflow requests to `iad1`, which may result in higher latency. For best performance, deploy your Vercel apps using Workflow to `iad1`. Global deployment is planned to colocate the backend closer to your applications.
|
|
@@ -62,6 +62,7 @@ import { Next, Nitro, SvelteKit, Nuxt, Hono, Bun, AstroDark, AstroLight, TanStac
|
|
|
62
62
|
<div className="flex flex-col items-center justify-center gap-2">
|
|
63
63
|
<Nest className="size-16" />
|
|
64
64
|
<span className="font-medium">NestJS</span>
|
|
65
|
+
<Badge variant="secondary">Experimental</Badge>
|
|
65
66
|
</div>
|
|
66
67
|
</Card>
|
|
67
68
|
<Card className="opacity-50">
|
|
@@ -242,7 +242,8 @@ Taking a look at this code:
|
|
|
242
242
|
|
|
243
243
|
To invoke your new workflow, update your controller with a new endpoint:
|
|
244
244
|
|
|
245
|
-
{
|
|
245
|
+
{/*@skip-typecheck - NestJS decorators require special TypeScript config*/}
|
|
246
|
+
|
|
246
247
|
```typescript title="src/app.controller.ts" lineNumbers
|
|
247
248
|
import { Body, Controller, Post } from '@nestjs/common';
|
|
248
249
|
import { start } from 'workflow/api';
|
|
@@ -289,7 +290,7 @@ npx workflow web
|
|
|
289
290
|
npx workflow inspect runs
|
|
290
291
|
```
|
|
291
292
|
|
|
292
|
-
|
|
293
|
+

|
|
293
294
|
|
|
294
295
|
</Step>
|
|
295
296
|
|
|
@@ -301,7 +302,8 @@ npx workflow inspect runs
|
|
|
301
302
|
|
|
302
303
|
The `WorkflowModule.forRoot()` method accepts optional configuration:
|
|
303
304
|
|
|
304
|
-
{
|
|
305
|
+
{/*@skip-typecheck - Configuration snippet, WorkflowModule not imported*/}
|
|
306
|
+
|
|
305
307
|
```typescript
|
|
306
308
|
WorkflowModule.forRoot({
|
|
307
309
|
// Directory to scan for workflow files (default: ['src'])
|
|
@@ -257,45 +257,6 @@ Check the [Deploying](/docs/deploying) section to learn how your workflows can b
|
|
|
257
257
|
|
|
258
258
|
## Troubleshooting
|
|
259
259
|
|
|
260
|
-
### Out of Memory (OOM) during build
|
|
261
|
-
|
|
262
|
-
When using `withWorkflow()` in a large Next.js application, the "Discovering workflow directives" phase may consume excessive memory, causing builds to fail with OOM errors on standard build machines (e.g., 16 GB RAM).
|
|
263
|
-
|
|
264
|
-
**Solution:** Use the `workflows.dirs` option to limit the directories scanned for workflow directives. By default, `withWorkflow` scans `['pages', 'app', 'src/pages', 'src/app']`, which in large applications can include thousands of files.
|
|
265
|
-
|
|
266
|
-
If your workflows are located in a specific directory, configure `dirs` to only scan that directory:
|
|
267
|
-
|
|
268
|
-
```typescript title="next.config.ts" lineNumbers
|
|
269
|
-
import { withWorkflow } from "workflow/next";
|
|
270
|
-
import type { NextConfig } from "next";
|
|
271
|
-
|
|
272
|
-
const nextConfig: NextConfig = {};
|
|
273
|
-
|
|
274
|
-
export default withWorkflow(nextConfig, {
|
|
275
|
-
workflows: {
|
|
276
|
-
// Only scan the workflows directory instead of the entire app
|
|
277
|
-
dirs: ['workflows'], // [!code highlight]
|
|
278
|
-
},
|
|
279
|
-
});
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
If you need workflows in both app routes and a dedicated directory:
|
|
283
|
-
|
|
284
|
-
```typescript title="next.config.ts" lineNumbers
|
|
285
|
-
import { withWorkflow } from "workflow/next";
|
|
286
|
-
import type { NextConfig } from "next";
|
|
287
|
-
|
|
288
|
-
const nextConfig: NextConfig = {};
|
|
289
|
-
|
|
290
|
-
export default withWorkflow(nextConfig, {
|
|
291
|
-
workflows: {
|
|
292
|
-
dirs: ['app/api', 'workflows'], // [!code highlight]
|
|
293
|
-
},
|
|
294
|
-
});
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
This significantly reduces memory usage and build times by avoiding scanning unrelated application code.
|
|
298
|
-
|
|
299
260
|
### Next.js 16.1+ compatibility
|
|
300
261
|
|
|
301
262
|
If you see this error when upgrading to Next.js 16.1 or later:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "4.1.0-beta.
|
|
3
|
+
"version": "4.1.0-beta.54",
|
|
4
4
|
"description": "Workflow DevKit - Build durable, resilient, and observable workflows",
|
|
5
5
|
"main": "dist/typescript-plugin.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"ms": "2.1.3",
|
|
56
|
-
"@workflow/astro": "4.0.0-beta.
|
|
56
|
+
"@workflow/astro": "4.0.0-beta.28",
|
|
57
|
+
"@workflow/cli": "4.1.0-beta.54",
|
|
58
|
+
"@workflow/core": "4.1.0-beta.54",
|
|
57
59
|
"@workflow/errors": "4.1.0-beta.14",
|
|
58
|
-
"@workflow/cli": "4.1.0-beta.52",
|
|
59
60
|
"@workflow/typescript-plugin": "4.0.1-beta.4",
|
|
60
|
-
"@workflow/
|
|
61
|
-
"@workflow/
|
|
62
|
-
"@workflow/
|
|
63
|
-
"@workflow/
|
|
64
|
-
"@workflow/
|
|
65
|
-
"@workflow/
|
|
66
|
-
"@workflow/rollup": "4.0.0-beta.9"
|
|
61
|
+
"@workflow/next": "4.0.1-beta.50",
|
|
62
|
+
"@workflow/nest": "0.0.0-beta.3",
|
|
63
|
+
"@workflow/nitro": "4.0.1-beta.49",
|
|
64
|
+
"@workflow/nuxt": "4.0.1-beta.38",
|
|
65
|
+
"@workflow/sveltekit": "4.0.0-beta.43",
|
|
66
|
+
"@workflow/rollup": "4.0.0-beta.11"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/ms": "2.1.0",
|