@brandboostinggmbh/observable-workflows 0.11.5 → 0.12.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/dist/index.d.ts +3 -1
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -394,6 +394,8 @@ type WorkflowQueueMessage = {
|
|
|
394
394
|
tenantId: string;
|
|
395
395
|
retryInstanceId: string;
|
|
396
396
|
triggerId?: string | null;
|
|
397
|
+
/** If true the workflow will attempt to reuse all results from successful steps. Defaults to True */
|
|
398
|
+
reuseSuccessfulSteps?: boolean;
|
|
397
399
|
};
|
|
398
400
|
type RetryWorkflowOptions = {
|
|
399
401
|
/** If true the retry will attept to reuse all results from successful steps. Defaults to True */
|
|
@@ -452,7 +454,7 @@ declare function createQueueWorkflowContext(options: QueueWorkflowContextOptions
|
|
|
452
454
|
input: I;
|
|
453
455
|
initialName: string;
|
|
454
456
|
}>) => Promise<void>;
|
|
455
|
-
enqueueRetryWorkflow: <I>(workflow: WorkflowFunction<I>, tenantId: string, oldInstanceId: string) => Promise<void>;
|
|
457
|
+
enqueueRetryWorkflow: <I>(workflow: WorkflowFunction<I>, tenantId: string, oldInstanceId: string, reuseSuccessfulSteps?: boolean) => Promise<void>;
|
|
456
458
|
handleWorkflowQueueMessage: ({
|
|
457
459
|
message,
|
|
458
460
|
env,
|
package/dist/index.js
CHANGED
|
@@ -912,14 +912,15 @@ function createQueueWorkflowContext(options) {
|
|
|
912
912
|
triggerId
|
|
913
913
|
});
|
|
914
914
|
};
|
|
915
|
-
const enqueueRetryWorkflow = async (workflow, tenantId, oldInstanceId) => {
|
|
915
|
+
const enqueueRetryWorkflow = async (workflow, tenantId, oldInstanceId, reuseSuccessfulSteps) => {
|
|
916
916
|
const triggerId = idFactory();
|
|
917
917
|
await options.QUEUE.send({
|
|
918
918
|
type: "workflow-retry",
|
|
919
919
|
workflowType: workflow.workflowType,
|
|
920
920
|
retryInstanceId: oldInstanceId,
|
|
921
921
|
tenantId,
|
|
922
|
-
triggerId
|
|
922
|
+
triggerId,
|
|
923
|
+
reuseSuccessfulSteps: reuseSuccessfulSteps ?? true
|
|
923
924
|
});
|
|
924
925
|
};
|
|
925
926
|
const enqueueWorkflowBatch = async (workflows) => {
|
|
@@ -950,7 +951,8 @@ function createQueueWorkflowContext(options) {
|
|
|
950
951
|
await wfc.retry({
|
|
951
952
|
workflow: workflowFunction,
|
|
952
953
|
retryInstanceId: message.retryInstanceId,
|
|
953
|
-
triggerId: message.triggerId
|
|
954
|
+
triggerId: message.triggerId,
|
|
955
|
+
retryOptions: { reuseSuccessfulSteps: message.reuseSuccessfulSteps ?? true }
|
|
954
956
|
});
|
|
955
957
|
}
|
|
956
958
|
};
|