@brandboostinggmbh/observable-workflows 0.22.1 → 0.23.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/CHANGELOG.md +9 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.js +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,15 @@ Changes that will be included in the next release will be documented here.
|
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
+
## [v0.23.0] - 2026-03-16
|
|
26
|
+
|
|
27
|
+
### ✨ Features
|
|
28
|
+
|
|
29
|
+
- `call()` and `retry()` now return a `WorkflowCallResult<O>` instead of `void`, containing `instanceId`, `workflowType`, `tenantId`, `result`, `workflowStatus`, `startTime`, `endTime`, `parentInstanceId`, and `triggerId`
|
|
30
|
+
- New exported type `WorkflowCallResult<O, TYPE>` built via `Pick` from `TypedWorkflowRun` with narrowed `workflowStatus: 'completed'` and non-null `result: O` / `endTime: number`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
25
34
|
## [v0.22.1] - 2026-02-19
|
|
26
35
|
|
|
27
36
|
### 📚 Documentation
|
package/dist/index.d.ts
CHANGED
|
@@ -671,8 +671,8 @@ type WorkflowContextOptions = {
|
|
|
671
671
|
};
|
|
672
672
|
type InternalWorkflowContextOptions = WorkflowContextOptions & Required<Pick<WorkflowContextOptions, 'serializer' | 'idFactory'>>;
|
|
673
673
|
type WorkflowContextInstance = {
|
|
674
|
-
call: <I, O>(args: WorkflowCallParams<I, O>) => Promise<
|
|
675
|
-
retry: <I, O>(params: RetryWorkflowParams<I, O>) => Promise<
|
|
674
|
+
call: <I, O>(args: WorkflowCallParams<I, O>) => Promise<WorkflowCallResult<O>>;
|
|
675
|
+
retry: <I, O>(params: RetryWorkflowParams<I, O>) => Promise<WorkflowCallResult<O>>;
|
|
676
676
|
};
|
|
677
677
|
type QueueWorkflowContextOptions = {
|
|
678
678
|
QUEUE: Queue<WorkflowQueueMessage>;
|
|
@@ -778,6 +778,11 @@ type WorkflowCallParams<I, O> = {
|
|
|
778
778
|
/** Optional: Provide an existing workflow instance ID. When provided, this workflow will update the existing instance. This is used when you have an workflow that is marked as waiting or scheduled and want to execute it. */
|
|
779
779
|
scheduledInstanceId?: string | undefined;
|
|
780
780
|
};
|
|
781
|
+
type WorkflowCallResult<O, TYPE extends string = string> = Pick<TypedWorkflowRun<never, O, TYPE>, 'instanceId' | 'workflowType' | 'tenantId' | 'parentInstanceId' | 'triggerId' | 'startTime'> & {
|
|
782
|
+
result: O;
|
|
783
|
+
workflowStatus: 'completed';
|
|
784
|
+
endTime: number;
|
|
785
|
+
};
|
|
781
786
|
type ScheduledWorkflowExecutionStub<O, TYPE extends string = string> = {
|
|
782
787
|
instanceId: string;
|
|
783
788
|
workflowType: TYPE;
|
|
@@ -983,4 +988,4 @@ type R2ExternalBlobStorageOptions = {
|
|
|
983
988
|
*/
|
|
984
989
|
declare function createR2ExternalBlobStorage(options: R2ExternalBlobStorageOptions): ExternalBlobStorage;
|
|
985
990
|
//#endregion
|
|
986
|
-
export { ConsoleWrapper, DateRangeFilter, ExternalBlobStorage, HandleWorkflowQueueMessageParams, InternalWorkflowContextOptions, Log, PossibleValueTypeNames, PossibleValueTypes, PropertyFilter, QueueWorkflowContextOptions, R2ExternalBlobStorageOptions, RetryConfig, Serializer, Step, StepContextOptions, StepCtx, StepWorkflowStatus, StringFilter, ValueTypeMap, WorkflowContext, WorkflowContextInstance, WorkflowContextOptions, WorkflowEnqueueBatchItem, WorkflowFilter, WorkflowFunction, WorkflowProperty, WorkflowPropertyDefinition, WorkflowQueueMessage, WorkflowRun, WorkflowStatus, createCleanupManager, createLogAccessor, createQueueWorkflowContext, createR2ExternalBlobStorage, createStepContext, createWorkflowContext, createWorkflowDependencies, createWorkflowDependency, defaultIdFactory, defaultSerializer, defineWorkflow, deleteWorkflowDependency, deserializeWithExternalStorage, ensureTables, finalizeWorkflowRecord, insertStepRecordFull, insertWorkflowRecord, pushLogToDB, retryD1Operation, serializeWithExternalStorage, tryDeserializeObj, updateWorkflow, updateWorkflowName, upsertWorkflowProperty, workflowTableRowToWorkflowRun };
|
|
991
|
+
export { ConsoleWrapper, DateRangeFilter, ExternalBlobStorage, HandleWorkflowQueueMessageParams, InternalWorkflowContextOptions, Log, PossibleValueTypeNames, PossibleValueTypes, PropertyFilter, QueueWorkflowContextOptions, R2ExternalBlobStorageOptions, RetryConfig, Serializer, Step, StepContextOptions, StepCtx, StepWorkflowStatus, StringFilter, ValueTypeMap, WorkflowCallResult, WorkflowContext, WorkflowContextInstance, WorkflowContextOptions, WorkflowEnqueueBatchItem, WorkflowFilter, WorkflowFunction, WorkflowProperty, WorkflowPropertyDefinition, WorkflowQueueMessage, WorkflowRun, WorkflowStatus, createCleanupManager, createLogAccessor, createQueueWorkflowContext, createR2ExternalBlobStorage, createStepContext, createWorkflowContext, createWorkflowDependencies, createWorkflowDependency, defaultIdFactory, defaultSerializer, defineWorkflow, deleteWorkflowDependency, deserializeWithExternalStorage, ensureTables, finalizeWorkflowRecord, insertStepRecordFull, insertWorkflowRecord, pushLogToDB, retryD1Operation, serializeWithExternalStorage, tryDeserializeObj, updateWorkflow, updateWorkflowName, upsertWorkflowProperty, workflowTableRowToWorkflowRun };
|
package/dist/index.js
CHANGED
|
@@ -2320,6 +2320,17 @@ function createWorkflowContext(options) {
|
|
|
2320
2320
|
result
|
|
2321
2321
|
});
|
|
2322
2322
|
await logBatcher.destroy();
|
|
2323
|
+
return {
|
|
2324
|
+
instanceId,
|
|
2325
|
+
workflowType: workflow.workflowType,
|
|
2326
|
+
tenantId,
|
|
2327
|
+
parentInstanceId: parentInstanceId ?? null,
|
|
2328
|
+
triggerId: triggerId ?? null,
|
|
2329
|
+
startTime,
|
|
2330
|
+
result,
|
|
2331
|
+
workflowStatus,
|
|
2332
|
+
endTime
|
|
2333
|
+
};
|
|
2323
2334
|
} catch (error) {
|
|
2324
2335
|
const endTime = Date.now();
|
|
2325
2336
|
const workflowStatus = "failed";
|
|
@@ -2345,7 +2356,7 @@ function createWorkflowContext(options) {
|
|
|
2345
2356
|
const encodedInput = oldRun?.input;
|
|
2346
2357
|
if (inputRef === void 0 || encodedInput === void 0) throw new Error(`No input found for instanceId ${retryInstanceId}`);
|
|
2347
2358
|
const input = await deserializeWithExternalStorage(encodedInput, inputRef, internalContext.serializer, options.externalBlobStorage);
|
|
2348
|
-
await call({
|
|
2359
|
+
return await call({
|
|
2349
2360
|
workflow,
|
|
2350
2361
|
input,
|
|
2351
2362
|
workflowName: oldWorkflowName ?? "unknown",
|