@voyantjs/workflows-orchestrator-node 0.34.0 → 0.35.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 +78 -0
- package/dist/dashboard-server.d.ts +10 -1
- package/dist/dashboard-server.d.ts.map +1 -1
- package/dist/dashboard-server.js +1 -1
- package/package.json +3 -3
- package/src/dashboard-server.ts +11 -1
package/README.md
CHANGED
|
@@ -57,6 +57,84 @@ When the parent id comes from an external admin recorder such as
|
|
|
57
57
|
`seedResults` from that recorder's `WorkflowResumeContext`. Seeded steps are
|
|
58
58
|
replayed from the journal, so their side effects do not run again.
|
|
59
59
|
|
|
60
|
+
## Service-backed package workflows
|
|
61
|
+
|
|
62
|
+
Package workflows can resolve host-provided services through
|
|
63
|
+
`ctx.services.resolve(...)`. For example, `@voyantjs/promotions` exports the
|
|
64
|
+
`promotions.reindex-all-products` workflow, which resolves the bulk reindex
|
|
65
|
+
service registered under `BULK_REINDEX_SERVICE_KEY`.
|
|
66
|
+
|
|
67
|
+
For app-integrated Node runtimes, prefer the `createApp()` workflow runtime.
|
|
68
|
+
`createApp()` builds the module container, passes a read-only service resolver
|
|
69
|
+
to the driver factory, and the Node standalone driver forwards that resolver
|
|
70
|
+
into every workflow step:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { createApp } from "@voyantjs/hono"
|
|
74
|
+
import type { HonoModule } from "@voyantjs/hono/module"
|
|
75
|
+
import { createNodeStandaloneDriver } from "@voyantjs/workflows-orchestrator-node"
|
|
76
|
+
import {
|
|
77
|
+
BULK_REINDEX_SERVICE_KEY,
|
|
78
|
+
promotionsHonoModule,
|
|
79
|
+
} from "@voyantjs/promotions"
|
|
80
|
+
|
|
81
|
+
const promotionsWorkflowServices: HonoModule = {
|
|
82
|
+
module: {
|
|
83
|
+
name: BULK_REINDEX_SERVICE_KEY,
|
|
84
|
+
service: bulkReindexProductsService,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const app = createApp({
|
|
89
|
+
db: () => db,
|
|
90
|
+
modules: [promotionsHonoModule, promotionsWorkflowServices],
|
|
91
|
+
workflows: {
|
|
92
|
+
driver: () => createNodeStandaloneDriver({ db }),
|
|
93
|
+
environment: "production",
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
await app.ready()
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The key point is that service registration happens in the host app and the
|
|
101
|
+
driver receives the framework's service resolver from `createApp()`; workflow
|
|
102
|
+
code stays package-owned and deployment-agnostic.
|
|
103
|
+
|
|
104
|
+
If you are still using the standalone self-host HTTP helper directly with an
|
|
105
|
+
entry file, pass the same read-only resolver to `startNodeSelfHostServer()` or
|
|
106
|
+
`createNodeSelfHostDeps()`:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { BULK_REINDEX_SERVICE_KEY } from "@voyantjs/promotions"
|
|
110
|
+
import type { ServiceResolver } from "@voyantjs/workflows/driver"
|
|
111
|
+
import { startNodeSelfHostServer } from "@voyantjs/workflows-orchestrator-node"
|
|
112
|
+
|
|
113
|
+
const services: ServiceResolver = {
|
|
114
|
+
resolve<T>(name: string): T {
|
|
115
|
+
if (name === BULK_REINDEX_SERVICE_KEY) {
|
|
116
|
+
return bulkReindexProductsService as T
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`Service "${name}" is not registered`)
|
|
119
|
+
},
|
|
120
|
+
has(name: string): boolean {
|
|
121
|
+
return name === BULK_REINDEX_SERVICE_KEY
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
await startNodeSelfHostServer({
|
|
126
|
+
entryFile: "./dist/workflows.mjs",
|
|
127
|
+
databaseUrl: process.env.DATABASE_URL,
|
|
128
|
+
services,
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
That direct helper is useful for existing entry-file deployments. New
|
|
133
|
+
service-backed package workflow integrations should usually migrate to
|
|
134
|
+
`createApp({ workflows: { driver: () => createNodeStandaloneDriver({ db }) } })`
|
|
135
|
+
so module services, event filters, manifest registration, and `ctx.services`
|
|
136
|
+
all come from one app composition path.
|
|
137
|
+
|
|
60
138
|
## Postgres migrations
|
|
61
139
|
|
|
62
140
|
The PostgreSQL schema for the Node self-host target lives in
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createServer, type ServerResponse } from "node:http";
|
|
2
|
+
import type { ServiceResolver } from "@voyantjs/workflows/driver";
|
|
2
3
|
import { type WaitpointInjection } from "@voyantjs/workflows-orchestrator";
|
|
3
4
|
import { type SchedulerHandle } from "./scheduler.js";
|
|
4
5
|
import { type SnapshotRunStore, type StoredRun } from "./snapshot-run-store.js";
|
|
@@ -151,6 +152,14 @@ export interface NodeSelfHostServerOptions {
|
|
|
151
152
|
host?: string;
|
|
152
153
|
staticDir?: string;
|
|
153
154
|
cacheBustEntry?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Read-only service resolver surfaced to workflow bodies as `ctx.services`.
|
|
157
|
+
*
|
|
158
|
+
* Use this when the loaded entry file registers package workflows that
|
|
159
|
+
* resolve host-provided services, for example
|
|
160
|
+
* `ctx.services.resolve("promotions:bulk-reindex-products")`.
|
|
161
|
+
*/
|
|
162
|
+
services?: ServiceResolver;
|
|
154
163
|
store?: SnapshotRunStore;
|
|
155
164
|
databaseUrl?: string;
|
|
156
165
|
wakeupPollIntervalMs?: number;
|
|
@@ -158,6 +167,6 @@ export interface NodeSelfHostServerOptions {
|
|
|
158
167
|
wakeupLeaseOwner?: string;
|
|
159
168
|
}
|
|
160
169
|
export declare function startNodeSelfHostServer(opts: NodeSelfHostServerOptions): Promise<ServeHandle>;
|
|
161
|
-
export declare function createNodeSelfHostDeps(opts: Pick<NodeSelfHostServerOptions, "entryFile" | "staticDir" | "cacheBustEntry" | "store" | "databaseUrl" | "wakeupPollIntervalMs" | "wakeupLeaseMs" | "wakeupLeaseOwner">): Promise<ServeDeps>;
|
|
170
|
+
export declare function createNodeSelfHostDeps(opts: Pick<NodeSelfHostServerOptions, "entryFile" | "staticDir" | "cacheBustEntry" | "services" | "store" | "databaseUrl" | "wakeupPollIntervalMs" | "wakeupLeaseMs" | "wakeupLeaseOwner">): Promise<ServeDeps>;
|
|
162
171
|
export declare function renderMetrics(snapshot: MetricsSnapshot): string;
|
|
163
172
|
//# sourceMappingURL=dashboard-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-server.d.ts","sourceRoot":"","sources":["../src/dashboard-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"dashboard-server.d.ts","sourceRoot":"","sources":["../src/dashboard-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AAGhG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAA;AASzC,OAAO,EAAmB,KAAK,eAAe,EAAuB,MAAM,gBAAgB,CAAA;AAC3F,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAGxF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,gBAAgB,CAAA;IACvB,YAAY,EAAE,OAAO,YAAY,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAA;IACxD,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAAA;IAC3D,cAAc,CAAC,EAAE,MAA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EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,KAAK,EAAE,gBAAgB,GACtB,IAAI,CAwEN;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,WAAW,CAAC,CAStB;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,CACR,yBAAyB,EACvB,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,OAAO,GACP,aAAa,GACb,sBAAsB,GACtB,eAAe,GACf,kBAAkB,CACrB,GACA,OAAO,CAAC,SAAS,CAAC,CA6cpB;AA2HD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAgC/D"}
|
package/dist/dashboard-server.js
CHANGED
|
@@ -689,7 +689,7 @@ export async function createNodeSelfHostDeps(opts) {
|
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
691
|
};
|
|
692
|
-
const stepHandler = async (req, stepOpts) => handleStepRequest(req, { rateLimiter, nodeStepRunner }, stepOpts);
|
|
692
|
+
const stepHandler = async (req, stepOpts) => handleStepRequest(req, { rateLimiter, nodeStepRunner, services: opts.services }, stepOpts);
|
|
693
693
|
const tenantMeta = {
|
|
694
694
|
tenantId: "tnt_local",
|
|
695
695
|
projectId: "prj_local",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/workflows-orchestrator-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Node/Docker runtime primitives for @voyantjs/workflows-orchestrator, including a file-backed run store and local scheduler.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"drizzle-orm": "^0.45.2",
|
|
31
31
|
"pg": "^8.20.0",
|
|
32
|
-
"@voyantjs/workflows-orchestrator": "0.
|
|
33
|
-
"@voyantjs/workflows": "0.
|
|
32
|
+
"@voyantjs/workflows-orchestrator": "0.35.0",
|
|
33
|
+
"@voyantjs/workflows": "0.35.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.12.0",
|
package/src/dashboard-server.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { readFile, stat } from "node:fs/promises"
|
|
|
2
2
|
import { createServer, type IncomingMessage, type Server, type ServerResponse } from "node:http"
|
|
3
3
|
import { extname, join, resolve as resolvePath } from "node:path"
|
|
4
4
|
import { URL } from "node:url"
|
|
5
|
+
import type { ServiceResolver } from "@voyantjs/workflows/driver"
|
|
5
6
|
import { handleStepRequest, type StepRunner } from "@voyantjs/workflows/handler"
|
|
6
7
|
import { createInMemoryRateLimiter } from "@voyantjs/workflows/rate-limit"
|
|
7
8
|
import {
|
|
@@ -818,6 +819,14 @@ export interface NodeSelfHostServerOptions {
|
|
|
818
819
|
host?: string
|
|
819
820
|
staticDir?: string
|
|
820
821
|
cacheBustEntry?: boolean
|
|
822
|
+
/**
|
|
823
|
+
* Read-only service resolver surfaced to workflow bodies as `ctx.services`.
|
|
824
|
+
*
|
|
825
|
+
* Use this when the loaded entry file registers package workflows that
|
|
826
|
+
* resolve host-provided services, for example
|
|
827
|
+
* `ctx.services.resolve("promotions:bulk-reindex-products")`.
|
|
828
|
+
*/
|
|
829
|
+
services?: ServiceResolver
|
|
821
830
|
store?: SnapshotRunStore
|
|
822
831
|
databaseUrl?: string
|
|
823
832
|
wakeupPollIntervalMs?: number
|
|
@@ -844,6 +853,7 @@ export async function createNodeSelfHostDeps(
|
|
|
844
853
|
| "entryFile"
|
|
845
854
|
| "staticDir"
|
|
846
855
|
| "cacheBustEntry"
|
|
856
|
+
| "services"
|
|
847
857
|
| "store"
|
|
848
858
|
| "databaseUrl"
|
|
849
859
|
| "wakeupPollIntervalMs"
|
|
@@ -914,7 +924,7 @@ export async function createNodeSelfHostDeps(
|
|
|
914
924
|
}
|
|
915
925
|
|
|
916
926
|
const stepHandler: StepHandler = async (req, stepOpts) =>
|
|
917
|
-
handleStepRequest(req, { rateLimiter, nodeStepRunner }, stepOpts)
|
|
927
|
+
handleStepRequest(req, { rateLimiter, nodeStepRunner, services: opts.services }, stepOpts)
|
|
918
928
|
const tenantMeta = {
|
|
919
929
|
tenantId: "tnt_local",
|
|
920
930
|
projectId: "prj_local",
|