workflow 4.2.0-beta.68 → 4.2.0-beta.70
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.
|
@@ -65,6 +65,35 @@ export default StopSleepResult;`}
|
|
|
65
65
|
|
|
66
66
|
## Examples
|
|
67
67
|
|
|
68
|
+
### Check if a Run Exists
|
|
69
|
+
|
|
70
|
+
Use the `exists` getter to check whether a workflow run exists without throwing when the run is not found:
|
|
71
|
+
|
|
72
|
+
```typescript lineNumbers
|
|
73
|
+
import { getRun } from "workflow/api";
|
|
74
|
+
|
|
75
|
+
export async function GET(req: Request) {
|
|
76
|
+
const url = new URL(req.url);
|
|
77
|
+
const runId = url.searchParams.get("runId");
|
|
78
|
+
|
|
79
|
+
if (!runId) {
|
|
80
|
+
return Response.json({ error: "No runId provided" }, { status: 400 });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const run = getRun(runId);
|
|
84
|
+
|
|
85
|
+
if (!(await run.exists)) { // [!code highlight]
|
|
86
|
+
return Response.json(
|
|
87
|
+
{ error: "Workflow run not found" },
|
|
88
|
+
{ status: 404 }
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const status = await run.status;
|
|
93
|
+
return Response.json({ status });
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
68
97
|
### Basic Status Check
|
|
69
98
|
|
|
70
99
|
Check the current status of a workflow run:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow",
|
|
3
|
-
"version": "4.2.0-beta.
|
|
3
|
+
"version": "4.2.0-beta.70",
|
|
4
4
|
"description": "Workflow DevKit - Build durable, resilient, and observable workflows",
|
|
5
5
|
"main": "dist/typescript-plugin.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"ms": "2.1.3",
|
|
55
|
-
"@workflow/astro": "4.0.0-beta.
|
|
56
|
-
"@workflow/cli": "4.2.0-beta.
|
|
57
|
-
"@workflow/core": "4.2.0-beta.
|
|
55
|
+
"@workflow/astro": "4.0.0-beta.44",
|
|
56
|
+
"@workflow/cli": "4.2.0-beta.70",
|
|
57
|
+
"@workflow/core": "4.2.0-beta.70",
|
|
58
58
|
"@workflow/errors": "4.1.0-beta.18",
|
|
59
59
|
"@workflow/typescript-plugin": "4.0.1-beta.5",
|
|
60
|
-
"@workflow/next": "4.0.1-beta.
|
|
61
|
-
"@workflow/nest": "0.0.0-beta.
|
|
62
|
-
"@workflow/nitro": "4.0.1-beta.
|
|
63
|
-
"@workflow/nuxt": "4.0.1-beta.
|
|
64
|
-
"@workflow/sveltekit": "4.0.0-beta.
|
|
65
|
-
"@workflow/rollup": "4.0.0-beta.
|
|
60
|
+
"@workflow/next": "4.0.1-beta.66",
|
|
61
|
+
"@workflow/nest": "0.0.0-beta.19",
|
|
62
|
+
"@workflow/nitro": "4.0.1-beta.65",
|
|
63
|
+
"@workflow/nuxt": "4.0.1-beta.54",
|
|
64
|
+
"@workflow/sveltekit": "4.0.0-beta.59",
|
|
65
|
+
"@workflow/rollup": "4.0.0-beta.27"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/ms": "2.1.0",
|