@multiplier-labs/stepflow 0.3.1 → 0.3.3
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/.codekin/reports/comments/2026-04-04_comment-assessment.md +179 -0
- package/.codekin/reports/complexity/2026-04-03_complexity-report.md +152 -0
- package/.codekin/reports/dependencies/2026-04-04_dependency-health.md +94 -0
- package/.codekin/reports/docs-audit/2026-04-04_docs-audit.md +10 -0
- package/.codekin/reports/security/2026-04-03_security-audit.md +208 -0
- package/.github/CODEOWNERS +15 -0
- package/.github/dependabot.yml +23 -0
- package/.github/workflows/ci.yml +38 -0
- package/.github/workflows/publish.yml +11 -5
- package/.github/workflows/security.yml +29 -0
- package/CHANGELOG.md +34 -0
- package/README.md +24 -0
- package/SECURITY.md +40 -0
- package/dist/{chunk-FQCT3I2A.js → chunk-4VOKMGP6.js} +23 -42
- package/dist/chunk-4VOKMGP6.js.map +1 -0
- package/dist/{chunk-XCF4PLN7.js → chunk-GYPNJBDP.js} +12 -16
- package/dist/chunk-GYPNJBDP.js.map +1 -0
- package/dist/{chunk-U5QGN3RT.js → chunk-KHTUWLVZ.js} +14 -47
- package/dist/chunk-KHTUWLVZ.js.map +1 -0
- package/dist/{chunk-GXY66V7Q.js → chunk-ML35PIHX.js} +1 -1
- package/dist/chunk-ML35PIHX.js.map +1 -0
- package/dist/events/index.d.ts +4 -4
- package/dist/events/index.js +1 -1
- package/dist/{index-CPfGsmrp.d.ts → index-Dzr437iW.d.ts} +6 -6
- package/dist/index.d.ts +14 -12
- package/dist/index.js +40 -82
- package/dist/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.js +2 -2
- package/dist/storage/index.d.ts +13 -13
- package/dist/storage/index.js +2 -2
- package/dist/{types-BlwFEGzj.d.ts → types-DSEjiLMj.d.ts} +16 -15
- package/dist/{types-DzkEqnQJ.d.ts → types-DZUdWmCc.d.ts} +2 -2
- package/dist/{types-BVShq7zT.d.ts → types-K5Gjk3H_.d.ts} +4 -4
- package/docs/stepflow-api-reference.md +2 -3
- package/package.json +7 -6
- package/src/core/engine.test.ts +466 -522
- package/src/core/engine.ts +42 -67
- package/src/core/index.ts +3 -3
- package/src/core/orchestrator.ts +64 -83
- package/src/core/types.ts +7 -29
- package/src/events/index.ts +4 -4
- package/src/events/memory.test.ts +39 -41
- package/src/events/memory.ts +7 -10
- package/src/events/socketio.test.ts +112 -162
- package/src/events/socketio.ts +20 -27
- package/src/events/types.ts +16 -19
- package/src/events/webhook.test.ts +197 -235
- package/src/events/webhook.ts +44 -71
- package/src/index.ts +19 -19
- package/src/planning/index.ts +6 -3
- package/src/planning/planner.ts +66 -91
- package/src/planning/planning.test.ts +303 -366
- package/src/planning/registry.test.ts +204 -251
- package/src/planning/registry.ts +39 -43
- package/src/planning/types.ts +23 -27
- package/src/scheduler/cron.test.ts +141 -150
- package/src/scheduler/cron.ts +32 -67
- package/src/scheduler/index.ts +4 -14
- package/src/scheduler/postgres-persistence.ts +71 -99
- package/src/scheduler/sqlite-persistence.test.ts +96 -96
- package/src/scheduler/sqlite-persistence.ts +12 -19
- package/src/scheduler/types.ts +4 -9
- package/src/storage/index.ts +5 -5
- package/src/storage/memory.test.ts +133 -183
- package/src/storage/memory.ts +21 -42
- package/src/storage/postgres.ts +197 -393
- package/src/storage/sqlite.test.ts +154 -281
- package/src/storage/sqlite.ts +50 -85
- package/src/storage/types.ts +33 -58
- package/src/utils/errors.test.ts +78 -80
- package/src/utils/errors.ts +27 -57
- package/src/utils/id.ts +3 -3
- package/src/utils/index.ts +4 -4
- package/src/utils/logger.test.ts +52 -58
- package/src/utils/logger.ts +4 -4
- package/src/utils/postgres-deps.ts +4 -4
- package/src/utils/retry.test.ts +47 -67
- package/src/utils/retry.ts +9 -9
- package/dist/chunk-FQCT3I2A.js.map +0 -1
- package/dist/chunk-GXY66V7Q.js.map +0 -1
- package/dist/chunk-U5QGN3RT.js.map +0 -1
- package/dist/chunk-XCF4PLN7.js.map +0 -1
- package/src/scheduler/postgres-persistence.test.ts +0 -906
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as StorageAdapter, j as WorkflowRunRecord, d as ListRunsOptions, P as PaginatedResult, k as WorkflowRunStepRecord, W as WorkflowEventRecord, L as ListEventsOptions, C as CreateRunInput, U as UpdateRunInput, e as StepResult } from '../types-
|
|
2
|
-
export { E as ExtendedListRunsOptions, a as ExtendedRunStatus, b as ExtendedStepStatus, c as ExtendedWorkflowRunRecord, S as StepRecord, f as StepflowDatabase, g as StepflowRunsTable, h as StepflowStepResultsTable, l as WorkflowStorage } from '../types-
|
|
1
|
+
import { i as StorageAdapter, j as WorkflowRunRecord, d as ListRunsOptions, P as PaginatedResult, k as WorkflowRunStepRecord, W as WorkflowEventRecord, L as ListEventsOptions, C as CreateRunInput, U as UpdateRunInput, e as StepResult } from '../types-DSEjiLMj.js';
|
|
2
|
+
export { E as ExtendedListRunsOptions, a as ExtendedRunStatus, b as ExtendedStepStatus, c as ExtendedWorkflowRunRecord, S as StepRecord, f as StepflowDatabase, g as StepflowRunsTable, h as StepflowStepResultsTable, l as WorkflowStorage } from '../types-DSEjiLMj.js';
|
|
3
3
|
import Database from 'better-sqlite3';
|
|
4
4
|
import { Pool, PoolConfig } from 'pg';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-K5Gjk3H_.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In-memory storage adapter for development and testing.
|
|
@@ -30,7 +30,7 @@ declare class MemoryStorageAdapter implements StorageAdapter {
|
|
|
30
30
|
private steps;
|
|
31
31
|
private events;
|
|
32
32
|
/** Create and persist a new workflow run record. */
|
|
33
|
-
createRun(run: Omit<WorkflowRunRecord,
|
|
33
|
+
createRun(run: Omit<WorkflowRunRecord, 'id' | 'createdAt'>): Promise<WorkflowRunRecord>;
|
|
34
34
|
/** Retrieve a workflow run by ID, or null if not found. */
|
|
35
35
|
getRun(runId: string): Promise<WorkflowRunRecord | null>;
|
|
36
36
|
/** Apply partial updates to an existing workflow run. No-op if the run does not exist. */
|
|
@@ -38,7 +38,7 @@ declare class MemoryStorageAdapter implements StorageAdapter {
|
|
|
38
38
|
/** List workflow runs with optional filtering, sorting, and pagination. */
|
|
39
39
|
listRuns(options?: ListRunsOptions): Promise<PaginatedResult<WorkflowRunRecord>>;
|
|
40
40
|
/** Create and persist a new step execution record. */
|
|
41
|
-
createStep(step: Omit<WorkflowRunStepRecord,
|
|
41
|
+
createStep(step: Omit<WorkflowRunStepRecord, 'id'>): Promise<WorkflowRunStepRecord>;
|
|
42
42
|
/** Retrieve a step record by ID, or null if not found. */
|
|
43
43
|
getStep(stepId: string): Promise<WorkflowRunStepRecord | null>;
|
|
44
44
|
/** Apply partial updates to an existing step record. No-op if the step does not exist. */
|
|
@@ -46,7 +46,7 @@ declare class MemoryStorageAdapter implements StorageAdapter {
|
|
|
46
46
|
/** Retrieve all step records for a workflow run, ordered by start time ascending. */
|
|
47
47
|
getStepsForRun(runId: string): Promise<WorkflowRunStepRecord[]>;
|
|
48
48
|
/** Persist a workflow event record. */
|
|
49
|
-
saveEvent(event: Omit<WorkflowEventRecord,
|
|
49
|
+
saveEvent(event: Omit<WorkflowEventRecord, 'id'>): Promise<void>;
|
|
50
50
|
/** Retrieve events for a workflow run with optional filtering and pagination. */
|
|
51
51
|
getEventsForRun(runId: string, options?: ListEventsOptions): Promise<WorkflowEventRecord[]>;
|
|
52
52
|
/** Delete runs (and their associated steps and events) created before the given date. Returns the number of deleted runs. */
|
|
@@ -124,15 +124,15 @@ declare class SQLiteStorageAdapter implements StorageAdapter {
|
|
|
124
124
|
* Prepare all SQL statements for better performance.
|
|
125
125
|
*/
|
|
126
126
|
private prepareStatements;
|
|
127
|
-
createRun(run: Omit<WorkflowRunRecord,
|
|
127
|
+
createRun(run: Omit<WorkflowRunRecord, 'id' | 'createdAt'>): Promise<WorkflowRunRecord>;
|
|
128
128
|
getRun(runId: string): Promise<WorkflowRunRecord | null>;
|
|
129
129
|
updateRun(runId: string, updates: Partial<WorkflowRunRecord>): Promise<void>;
|
|
130
130
|
listRuns(options?: ListRunsOptions): Promise<PaginatedResult<WorkflowRunRecord>>;
|
|
131
|
-
createStep(step: Omit<WorkflowRunStepRecord,
|
|
131
|
+
createStep(step: Omit<WorkflowRunStepRecord, 'id'>): Promise<WorkflowRunStepRecord>;
|
|
132
132
|
getStep(stepId: string): Promise<WorkflowRunStepRecord | null>;
|
|
133
133
|
updateStep(stepId: string, updates: Partial<WorkflowRunStepRecord>): Promise<void>;
|
|
134
134
|
getStepsForRun(runId: string): Promise<WorkflowRunStepRecord[]>;
|
|
135
|
-
saveEvent(event: Omit<WorkflowEventRecord,
|
|
135
|
+
saveEvent(event: Omit<WorkflowEventRecord, 'id'>): Promise<void>;
|
|
136
136
|
getEventsForRun(runId: string, options?: ListEventsOptions): Promise<WorkflowEventRecord[]>;
|
|
137
137
|
/**
|
|
138
138
|
* Execute a function within a database transaction (async interface).
|
|
@@ -296,7 +296,7 @@ declare class PostgresStorageAdapter implements StorageAdapter {
|
|
|
296
296
|
* Create a new workflow run.
|
|
297
297
|
* Supports both legacy and new CreateRunInput interfaces.
|
|
298
298
|
*/
|
|
299
|
-
createRun(run: CreateRunInput | Omit<WorkflowRunRecord,
|
|
299
|
+
createRun(run: CreateRunInput | Omit<WorkflowRunRecord, 'id' | 'createdAt'>): Promise<WorkflowRunRecord>;
|
|
300
300
|
getRun(runId: string): Promise<WorkflowRunRecord | null>;
|
|
301
301
|
/**
|
|
302
302
|
* Update a workflow run.
|
|
@@ -312,11 +312,11 @@ declare class PostgresStorageAdapter implements StorageAdapter {
|
|
|
312
312
|
*/
|
|
313
313
|
private applyRunsFilters;
|
|
314
314
|
listRuns(options?: ListRunsOptions): Promise<PaginatedResult<WorkflowRunRecord>>;
|
|
315
|
-
createStep(step: Omit<WorkflowRunStepRecord,
|
|
315
|
+
createStep(step: Omit<WorkflowRunStepRecord, 'id'>): Promise<WorkflowRunStepRecord>;
|
|
316
316
|
getStep(stepId: string): Promise<WorkflowRunStepRecord | null>;
|
|
317
317
|
updateStep(stepId: string, updates: Partial<WorkflowRunStepRecord>): Promise<void>;
|
|
318
318
|
getStepsForRun(runId: string): Promise<WorkflowRunStepRecord[]>;
|
|
319
|
-
saveEvent(event: Omit<WorkflowEventRecord,
|
|
319
|
+
saveEvent(event: Omit<WorkflowEventRecord, 'id'>): Promise<void>;
|
|
320
320
|
getEventsForRun(runId: string, options?: ListEventsOptions): Promise<WorkflowEventRecord[]>;
|
|
321
321
|
/**
|
|
322
322
|
* Execute a function within a database transaction.
|
|
@@ -386,7 +386,7 @@ declare class PostgresStorageAdapter implements StorageAdapter {
|
|
|
386
386
|
* Save or update a step result.
|
|
387
387
|
* Uses upsert to handle both new and existing results.
|
|
388
388
|
*/
|
|
389
|
-
saveStepResult(result: Omit<StepResult,
|
|
389
|
+
saveStepResult(result: Omit<StepResult, 'id'> & {
|
|
390
390
|
id?: string;
|
|
391
391
|
}): Promise<void>;
|
|
392
392
|
/**
|
package/dist/storage/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
MemoryStorageAdapter,
|
|
3
3
|
PostgresStorageAdapter,
|
|
4
4
|
SQLiteStorageAdapter
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-4VOKMGP6.js";
|
|
6
|
+
import "../chunk-ML35PIHX.js";
|
|
7
7
|
export {
|
|
8
8
|
MemoryStorageAdapter,
|
|
9
9
|
PostgresStorageAdapter as PostgresStorage,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunStatus, W as WorkflowKind, S as StepStatus, a as WorkflowError } from './types-
|
|
1
|
+
import { R as RunStatus, W as WorkflowKind, S as StepStatus, a as WorkflowError } from './types-K5Gjk3H_.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Storage interface types for the workflow engine.
|
|
@@ -9,12 +9,12 @@ import { R as RunStatus, W as WorkflowKind, S as StepStatus, a as WorkflowError
|
|
|
9
9
|
* Extended status of a workflow run.
|
|
10
10
|
* Adds 'pending' and 'timeout' to the core statuses.
|
|
11
11
|
*/
|
|
12
|
-
type ExtendedRunStatus =
|
|
12
|
+
type ExtendedRunStatus = 'pending' | 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'timeout';
|
|
13
13
|
/**
|
|
14
14
|
* Extended status of a workflow step.
|
|
15
15
|
* Uses 'completed' instead of 'succeeded' for consistency.
|
|
16
16
|
*/
|
|
17
|
-
type ExtendedStepStatus =
|
|
17
|
+
type ExtendedStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'canceled';
|
|
18
18
|
/**
|
|
19
19
|
* Stored representation of a workflow run.
|
|
20
20
|
*/
|
|
@@ -25,6 +25,7 @@ interface WorkflowRunRecord {
|
|
|
25
25
|
parentRunId?: string;
|
|
26
26
|
input: Record<string, unknown>;
|
|
27
27
|
context: Record<string, unknown>;
|
|
28
|
+
completedSteps?: string[];
|
|
28
29
|
output?: Record<string, unknown>;
|
|
29
30
|
error?: {
|
|
30
31
|
code: string;
|
|
@@ -60,7 +61,7 @@ interface WorkflowEventRecord {
|
|
|
60
61
|
runId: string;
|
|
61
62
|
stepKey?: string;
|
|
62
63
|
eventType: string;
|
|
63
|
-
level:
|
|
64
|
+
level: 'info' | 'warn' | 'error';
|
|
64
65
|
payload?: unknown;
|
|
65
66
|
timestamp: Date;
|
|
66
67
|
}
|
|
@@ -150,8 +151,8 @@ interface ListRunsOptions {
|
|
|
150
151
|
parentRunId?: string;
|
|
151
152
|
limit?: number;
|
|
152
153
|
offset?: number;
|
|
153
|
-
orderBy?:
|
|
154
|
-
orderDirection?:
|
|
154
|
+
orderBy?: 'createdAt' | 'startedAt' | 'finishedAt';
|
|
155
|
+
orderDirection?: 'asc' | 'desc';
|
|
155
156
|
}
|
|
156
157
|
/**
|
|
157
158
|
* Extended options for listing runs.
|
|
@@ -161,15 +162,15 @@ interface ExtendedListRunsOptions {
|
|
|
161
162
|
status?: ExtendedRunStatus | ExtendedRunStatus[];
|
|
162
163
|
limit?: number;
|
|
163
164
|
offset?: number;
|
|
164
|
-
orderBy?:
|
|
165
|
-
orderDir?:
|
|
165
|
+
orderBy?: 'createdAt' | 'startedAt' | 'finishedAt';
|
|
166
|
+
orderDir?: 'asc' | 'desc';
|
|
166
167
|
}
|
|
167
168
|
/**
|
|
168
169
|
* Options for listing events.
|
|
169
170
|
*/
|
|
170
171
|
interface ListEventsOptions {
|
|
171
172
|
stepKey?: string;
|
|
172
|
-
level?:
|
|
173
|
+
level?: 'info' | 'warn' | 'error';
|
|
173
174
|
limit?: number;
|
|
174
175
|
offset?: number;
|
|
175
176
|
}
|
|
@@ -198,7 +199,7 @@ interface WorkflowStorage {
|
|
|
198
199
|
getStepResult(runId: string, stepName: string): Promise<StepResult | undefined>;
|
|
199
200
|
getStepResults(runId: string): Promise<StepResult[]>;
|
|
200
201
|
getStepsForRun(runId: string): Promise<StepRecord[]>;
|
|
201
|
-
saveStepResult(result: Omit<StepResult,
|
|
202
|
+
saveStepResult(result: Omit<StepResult, 'id'> & {
|
|
202
203
|
id?: string;
|
|
203
204
|
}): Promise<void>;
|
|
204
205
|
initialize(): Promise<void>;
|
|
@@ -209,15 +210,15 @@ interface WorkflowStorage {
|
|
|
209
210
|
* Implement this interface to use your preferred database.
|
|
210
211
|
*/
|
|
211
212
|
interface StorageAdapter {
|
|
212
|
-
createRun(run: Omit<WorkflowRunRecord,
|
|
213
|
+
createRun(run: Omit<WorkflowRunRecord, 'id' | 'createdAt'>): Promise<WorkflowRunRecord>;
|
|
213
214
|
getRun(runId: string): Promise<WorkflowRunRecord | null>;
|
|
214
215
|
updateRun(runId: string, updates: Partial<WorkflowRunRecord>): Promise<void>;
|
|
215
216
|
listRuns(options?: ListRunsOptions): Promise<PaginatedResult<WorkflowRunRecord>>;
|
|
216
|
-
createStep(step: Omit<WorkflowRunStepRecord,
|
|
217
|
+
createStep(step: Omit<WorkflowRunStepRecord, 'id'>): Promise<WorkflowRunStepRecord>;
|
|
217
218
|
getStep(stepId: string): Promise<WorkflowRunStepRecord | null>;
|
|
218
219
|
updateStep(stepId: string, updates: Partial<WorkflowRunStepRecord>): Promise<void>;
|
|
219
220
|
getStepsForRun(runId: string): Promise<WorkflowRunStepRecord[]>;
|
|
220
|
-
saveEvent(event: Omit<WorkflowEventRecord,
|
|
221
|
+
saveEvent(event: Omit<WorkflowEventRecord, 'id'>): Promise<void>;
|
|
221
222
|
getEventsForRun(runId: string, options?: ListEventsOptions): Promise<WorkflowEventRecord[]>;
|
|
222
223
|
/**
|
|
223
224
|
* Optional transaction support.
|
|
@@ -269,8 +270,8 @@ interface StepflowStepResultsTable {
|
|
|
269
270
|
* Combined database schema for Stepflow.
|
|
270
271
|
*/
|
|
271
272
|
interface StepflowDatabase {
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
'stepflow.runs': StepflowRunsTable;
|
|
274
|
+
'stepflow.step_results': StepflowStepResultsTable;
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
export type { CreateRunInput as C, ExtendedListRunsOptions as E, ListEventsOptions as L, PaginatedResult as P, StepRecord as S, UpdateRunInput as U, WorkflowEventRecord as W, ExtendedRunStatus as a, ExtendedStepStatus as b, ExtendedWorkflowRunRecord as c, ListRunsOptions as d, StepResult as e, StepflowDatabase as f, StepflowRunsTable as g, StepflowStepResultsTable as h, StorageAdapter as i, WorkflowRunRecord as j, WorkflowRunStepRecord as k, WorkflowStorage as l };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WorkflowKind } from './types-
|
|
1
|
+
import { W as WorkflowKind } from './types-K5Gjk3H_.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Event system types for the workflow engine.
|
|
@@ -7,7 +7,7 @@ import { W as WorkflowKind } from './types-BVShq7zT.js';
|
|
|
7
7
|
/**
|
|
8
8
|
* Built-in event types emitted by the workflow engine.
|
|
9
9
|
*/
|
|
10
|
-
type BuiltInEventType =
|
|
10
|
+
type BuiltInEventType = 'run.created' | 'run.queued' | 'run.dequeued' | 'run.started' | 'run.resumed' | 'run.completed' | 'run.failed' | 'run.canceled' | 'run.timeout' | 'step.started' | 'step.completed' | 'step.failed' | 'step.skipped' | 'step.retry';
|
|
11
11
|
/**
|
|
12
12
|
* Event types emitted by the workflow engine.
|
|
13
13
|
* Includes built-in types and allows custom events via string.
|
|
@@ -10,18 +10,18 @@ type WorkflowKind = string;
|
|
|
10
10
|
/**
|
|
11
11
|
* Status of a workflow run.
|
|
12
12
|
*/
|
|
13
|
-
type RunStatus =
|
|
13
|
+
type RunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled';
|
|
14
14
|
/**
|
|
15
15
|
* Status of a workflow step.
|
|
16
16
|
*/
|
|
17
|
-
type StepStatus =
|
|
17
|
+
type StepStatus = 'pending' | 'running' | 'succeeded' | 'failed' | 'skipped' | 'canceled';
|
|
18
18
|
/**
|
|
19
19
|
* Error handling strategy for a step.
|
|
20
20
|
* - 'fail': Stop the workflow immediately
|
|
21
21
|
* - 'retry': Retry the step up to maxRetries times
|
|
22
22
|
* - 'skip': Mark as skipped and continue to next step
|
|
23
23
|
*/
|
|
24
|
-
type StepErrorStrategy =
|
|
24
|
+
type StepErrorStrategy = 'fail' | 'retry' | 'skip';
|
|
25
25
|
/**
|
|
26
26
|
* Structured error information stored with runs and steps.
|
|
27
27
|
*/
|
|
@@ -35,7 +35,7 @@ interface WorkflowError {
|
|
|
35
35
|
* Result of a completed workflow run.
|
|
36
36
|
*/
|
|
37
37
|
interface RunResult {
|
|
38
|
-
status:
|
|
38
|
+
status: 'succeeded' | 'failed' | 'canceled';
|
|
39
39
|
results: Record<string, unknown>;
|
|
40
40
|
error?: WorkflowError;
|
|
41
41
|
duration: number;
|
|
@@ -496,7 +496,6 @@ await scheduler.addSchedule({
|
|
|
496
496
|
await scheduler.removeSchedule(scheduleId);
|
|
497
497
|
await scheduler.updateSchedule(scheduleId, { enabled: false });
|
|
498
498
|
const schedules = await scheduler.getSchedules();
|
|
499
|
-
const schedule = scheduler.getSchedule(scheduleId);
|
|
500
499
|
const runId = await scheduler.triggerNow(scheduleId);
|
|
501
500
|
|
|
502
501
|
await scheduler.stop();
|
|
@@ -780,7 +779,7 @@ const storage = new SQLiteStorageAdapter({
|
|
|
780
779
|
tablePrefix: 'workflow', // default: 'workflow'
|
|
781
780
|
});
|
|
782
781
|
|
|
783
|
-
// Additional methods
|
|
782
|
+
// Additional methods (implementation-only; not part of the StorageAdapter interface)
|
|
784
783
|
storage.transactionSync<T>(fn: () => T): T;
|
|
785
784
|
await storage.getInterruptedRuns(): Promise<WorkflowRunRecord[]>;
|
|
786
785
|
await storage.getLastCompletedStep(runId): Promise<WorkflowRunStepRecord | null>;
|
|
@@ -868,7 +867,7 @@ await storage.getStepResults(runId): Promise<StepResult[]>;
|
|
|
868
867
|
await storage.saveStepResult(result): Promise<void>;
|
|
869
868
|
```
|
|
870
869
|
|
|
871
|
-
**Resume support
|
|
870
|
+
**Resume support** (implementation-only; not part of the StorageAdapter interface):
|
|
872
871
|
|
|
873
872
|
```typescript
|
|
874
873
|
await storage.getInterruptedRuns(): Promise<WorkflowRunRecord[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplier-labs/stepflow",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "A durable, type-safe workflow orchestration engine for Node.js with SQLite persistence, scheduling, and real-time events",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"url": "https://github.com/Multiplier-Labs/stepflow"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
|
-
"registry": "https://
|
|
12
|
+
"registry": "https://registry.npmjs.org",
|
|
13
|
+
"access": "public"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"workflow",
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
},
|
|
53
54
|
"dependencies": {
|
|
54
55
|
"cron-parser": "^5.5.0",
|
|
55
|
-
"re2": "^1.
|
|
56
|
+
"re2": "^1.24.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"better-sqlite3": ">=11.0.0",
|
|
@@ -74,12 +75,12 @@
|
|
|
74
75
|
"@types/better-sqlite3": "^7.6.11",
|
|
75
76
|
"@types/node": "^22.0.0",
|
|
76
77
|
"@types/pg": "^8.18.0",
|
|
77
|
-
"@vitest/coverage-v8": "^4.1.
|
|
78
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
78
79
|
"better-sqlite3": "^12.8.0",
|
|
79
|
-
"kysely": "^0.28.
|
|
80
|
+
"kysely": "^0.28.14",
|
|
80
81
|
"pg": "^8.20.0",
|
|
81
82
|
"tsup": "^8.3.5",
|
|
82
83
|
"typescript": "^5.7.2",
|
|
83
|
-
"vitest": "^4.1.
|
|
84
|
+
"vitest": "^4.1.4"
|
|
84
85
|
}
|
|
85
86
|
}
|