@voyantjs/workflow-runs 0.24.3 → 0.25.0
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.
- package/README.md +21 -8
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -16,23 +16,36 @@ The package is published with the same release-train version as the other instal
|
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import { mountWorkflowRunsAdminRoutes, WorkflowRunnerRegistry } from "@voyantjs/workflow-runs"
|
|
19
|
+
import { createNodeSelfHostWorkflowClient } from "@voyantjs/workflows-orchestrator-node"
|
|
19
20
|
|
|
20
21
|
const workflowRunnerRegistry = new WorkflowRunnerRegistry()
|
|
22
|
+
const workflowServer = createNodeSelfHostWorkflowClient({
|
|
23
|
+
baseUrl: process.env.WORKFLOW_SERVER_URL!,
|
|
24
|
+
})
|
|
21
25
|
|
|
22
26
|
workflowRunnerRegistry.register({
|
|
23
27
|
name: "checkout-finalize",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
idempotency: "unsafe",
|
|
29
|
+
description:
|
|
30
|
+
"Confirms the booking and issues the final invoice. Use Resume to retry from a failed step.",
|
|
31
|
+
rerun: async (input, ctx) => {
|
|
32
|
+
const saved = await workflowServer.trigger({
|
|
33
|
+
workflowId: "checkout-finalize",
|
|
27
34
|
input,
|
|
35
|
+
tags: [...ctx.tags, "rerun:true"],
|
|
28
36
|
})
|
|
37
|
+
return { runId: saved.id }
|
|
29
38
|
},
|
|
30
|
-
resume: async (
|
|
31
|
-
await workflowServer.
|
|
32
|
-
|
|
33
|
-
originalRunId: run.id,
|
|
39
|
+
resume: async (input, ctx) => {
|
|
40
|
+
const { saved } = await workflowServer.resume(ctx.parentRunId, {
|
|
41
|
+
workflowId: "checkout-finalize",
|
|
34
42
|
input,
|
|
43
|
+
resumeFromStep: ctx.resumeFromStep,
|
|
44
|
+
seedResults: ctx.seedResults,
|
|
45
|
+
tags: [...ctx.tags, "resume:true"],
|
|
46
|
+
triggeredByUserId: ctx.triggeredByUserId,
|
|
35
47
|
})
|
|
48
|
+
return { runId: saved.id }
|
|
36
49
|
},
|
|
37
50
|
})
|
|
38
51
|
|
|
@@ -41,4 +54,4 @@ mountWorkflowRunsAdminRoutes(hono, {
|
|
|
41
54
|
})
|
|
42
55
|
```
|
|
43
56
|
|
|
44
|
-
For self-hosted workflow services, keep runner registration close to the code that mounts the workflow service. The registry should dispatch to your external workflow server instead of importing worker-only runtime code into the admin API process.
|
|
57
|
+
For self-hosted workflow services, keep runner registration close to the code that mounts the workflow service. The registry should dispatch to your external workflow server instead of importing worker-only runtime code into the admin API process. The resume path sends `ctx.resumeFromStep` plus `ctx.seedResults`; the self-host server starts a new run, pre-populates the journal with the seeded step outputs, and executes from the failed step onward.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/workflow-runs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Workflow run recording, admin routes, and rerun/resume dispatch primitives for Voyant operator apps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"drizzle-orm": "^0.45.2",
|
|
36
36
|
"hono": "^4.12.10",
|
|
37
37
|
"zod": "^4.3.6",
|
|
38
|
-
"@voyantjs/core": "0.
|
|
39
|
-
"@voyantjs/db": "0.
|
|
40
|
-
"@voyantjs/hono": "0.
|
|
38
|
+
"@voyantjs/core": "0.25.0",
|
|
39
|
+
"@voyantjs/db": "0.25.0",
|
|
40
|
+
"@voyantjs/hono": "0.25.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"typescript": "^6.0.2",
|