@cloudflare/workers-types 4.20250529.0 → 4.20250531.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.
@@ -6153,6 +6153,7 @@ declare module "cloudflare:workers" {
6153
6153
  | number;
6154
6154
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6155
6155
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6156
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6156
6157
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6157
6158
  export type WorkflowStepConfig = {
6158
6159
  retries?: {
@@ -6767,6 +6768,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6767
6768
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6768
6769
  ): Promise<WorkflowInstance[]>;
6769
6770
  }
6771
+ type WorkflowDurationLabel =
6772
+ | "second"
6773
+ | "minute"
6774
+ | "hour"
6775
+ | "day"
6776
+ | "week"
6777
+ | "month"
6778
+ | "year";
6779
+ type WorkflowSleepDuration =
6780
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6781
+ | number;
6782
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6770
6783
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6771
6784
  /**
6772
6785
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6776,6 +6789,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6776
6789
  * The event payload the Workflow instance is triggered with
6777
6790
  */
6778
6791
  params?: PARAMS;
6792
+ /**
6793
+ * The retention policy for Workflow instance.
6794
+ * Defaults to the maximum retention period available for the owner's account.
6795
+ */
6796
+ retention?: {
6797
+ successRetention?: WorkflowRetentionDuration;
6798
+ errorRetention?: WorkflowRetentionDuration;
6799
+ };
6779
6800
  }
6780
6801
  type InstanceStatus = {
6781
6802
  status:
@@ -6622,6 +6622,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6622
6622
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6623
6623
  ): Promise<WorkflowInstance[]>;
6624
6624
  }
6625
+ export type WorkflowDurationLabel =
6626
+ | "second"
6627
+ | "minute"
6628
+ | "hour"
6629
+ | "day"
6630
+ | "week"
6631
+ | "month"
6632
+ | "year";
6633
+ export type WorkflowSleepDuration =
6634
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6635
+ | number;
6636
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6625
6637
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6626
6638
  /**
6627
6639
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6631,6 +6643,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6631
6643
  * The event payload the Workflow instance is triggered with
6632
6644
  */
6633
6645
  params?: PARAMS;
6646
+ /**
6647
+ * The retention policy for Workflow instance.
6648
+ * Defaults to the maximum retention period available for the owner's account.
6649
+ */
6650
+ retention?: {
6651
+ successRetention?: WorkflowRetentionDuration;
6652
+ errorRetention?: WorkflowRetentionDuration;
6653
+ };
6634
6654
  }
6635
6655
  export type InstanceStatus = {
6636
6656
  status:
@@ -6179,6 +6179,7 @@ declare module "cloudflare:workers" {
6179
6179
  | number;
6180
6180
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6181
6181
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6182
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6182
6183
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6183
6184
  export type WorkflowStepConfig = {
6184
6185
  retries?: {
@@ -6793,6 +6794,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6793
6794
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6794
6795
  ): Promise<WorkflowInstance[]>;
6795
6796
  }
6797
+ type WorkflowDurationLabel =
6798
+ | "second"
6799
+ | "minute"
6800
+ | "hour"
6801
+ | "day"
6802
+ | "week"
6803
+ | "month"
6804
+ | "year";
6805
+ type WorkflowSleepDuration =
6806
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6807
+ | number;
6808
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6796
6809
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6797
6810
  /**
6798
6811
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6802,6 +6815,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6802
6815
  * The event payload the Workflow instance is triggered with
6803
6816
  */
6804
6817
  params?: PARAMS;
6818
+ /**
6819
+ * The retention policy for Workflow instance.
6820
+ * Defaults to the maximum retention period available for the owner's account.
6821
+ */
6822
+ retention?: {
6823
+ successRetention?: WorkflowRetentionDuration;
6824
+ errorRetention?: WorkflowRetentionDuration;
6825
+ };
6805
6826
  }
6806
6827
  type InstanceStatus = {
6807
6828
  status:
@@ -6648,6 +6648,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6648
6648
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6649
6649
  ): Promise<WorkflowInstance[]>;
6650
6650
  }
6651
+ export type WorkflowDurationLabel =
6652
+ | "second"
6653
+ | "minute"
6654
+ | "hour"
6655
+ | "day"
6656
+ | "week"
6657
+ | "month"
6658
+ | "year";
6659
+ export type WorkflowSleepDuration =
6660
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6661
+ | number;
6662
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6651
6663
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6652
6664
  /**
6653
6665
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6657,6 +6669,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6657
6669
  * The event payload the Workflow instance is triggered with
6658
6670
  */
6659
6671
  params?: PARAMS;
6672
+ /**
6673
+ * The retention policy for Workflow instance.
6674
+ * Defaults to the maximum retention period available for the owner's account.
6675
+ */
6676
+ retention?: {
6677
+ successRetention?: WorkflowRetentionDuration;
6678
+ errorRetention?: WorkflowRetentionDuration;
6679
+ };
6660
6680
  }
6661
6681
  export type InstanceStatus = {
6662
6682
  status:
@@ -6197,6 +6197,7 @@ declare module "cloudflare:workers" {
6197
6197
  | number;
6198
6198
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6199
6199
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6200
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6200
6201
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6201
6202
  export type WorkflowStepConfig = {
6202
6203
  retries?: {
@@ -6811,6 +6812,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6811
6812
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6812
6813
  ): Promise<WorkflowInstance[]>;
6813
6814
  }
6815
+ type WorkflowDurationLabel =
6816
+ | "second"
6817
+ | "minute"
6818
+ | "hour"
6819
+ | "day"
6820
+ | "week"
6821
+ | "month"
6822
+ | "year";
6823
+ type WorkflowSleepDuration =
6824
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6825
+ | number;
6826
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6814
6827
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6815
6828
  /**
6816
6829
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6820,6 +6833,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6820
6833
  * The event payload the Workflow instance is triggered with
6821
6834
  */
6822
6835
  params?: PARAMS;
6836
+ /**
6837
+ * The retention policy for Workflow instance.
6838
+ * Defaults to the maximum retention period available for the owner's account.
6839
+ */
6840
+ retention?: {
6841
+ successRetention?: WorkflowRetentionDuration;
6842
+ errorRetention?: WorkflowRetentionDuration;
6843
+ };
6823
6844
  }
6824
6845
  type InstanceStatus = {
6825
6846
  status:
@@ -6666,6 +6666,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6666
6666
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6667
6667
  ): Promise<WorkflowInstance[]>;
6668
6668
  }
6669
+ export type WorkflowDurationLabel =
6670
+ | "second"
6671
+ | "minute"
6672
+ | "hour"
6673
+ | "day"
6674
+ | "week"
6675
+ | "month"
6676
+ | "year";
6677
+ export type WorkflowSleepDuration =
6678
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6679
+ | number;
6680
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6669
6681
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6670
6682
  /**
6671
6683
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6675,6 +6687,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6675
6687
  * The event payload the Workflow instance is triggered with
6676
6688
  */
6677
6689
  params?: PARAMS;
6690
+ /**
6691
+ * The retention policy for Workflow instance.
6692
+ * Defaults to the maximum retention period available for the owner's account.
6693
+ */
6694
+ retention?: {
6695
+ successRetention?: WorkflowRetentionDuration;
6696
+ errorRetention?: WorkflowRetentionDuration;
6697
+ };
6678
6698
  }
6679
6699
  export type InstanceStatus = {
6680
6700
  status:
@@ -6198,6 +6198,7 @@ declare module "cloudflare:workers" {
6198
6198
  | number;
6199
6199
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6200
6200
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6201
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6201
6202
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6202
6203
  export type WorkflowStepConfig = {
6203
6204
  retries?: {
@@ -6812,6 +6813,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6812
6813
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6813
6814
  ): Promise<WorkflowInstance[]>;
6814
6815
  }
6816
+ type WorkflowDurationLabel =
6817
+ | "second"
6818
+ | "minute"
6819
+ | "hour"
6820
+ | "day"
6821
+ | "week"
6822
+ | "month"
6823
+ | "year";
6824
+ type WorkflowSleepDuration =
6825
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6826
+ | number;
6827
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6815
6828
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6816
6829
  /**
6817
6830
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6821,6 +6834,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6821
6834
  * The event payload the Workflow instance is triggered with
6822
6835
  */
6823
6836
  params?: PARAMS;
6837
+ /**
6838
+ * The retention policy for Workflow instance.
6839
+ * Defaults to the maximum retention period available for the owner's account.
6840
+ */
6841
+ retention?: {
6842
+ successRetention?: WorkflowRetentionDuration;
6843
+ errorRetention?: WorkflowRetentionDuration;
6844
+ };
6824
6845
  }
6825
6846
  type InstanceStatus = {
6826
6847
  status:
@@ -6667,6 +6667,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6667
6667
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6668
6668
  ): Promise<WorkflowInstance[]>;
6669
6669
  }
6670
+ export type WorkflowDurationLabel =
6671
+ | "second"
6672
+ | "minute"
6673
+ | "hour"
6674
+ | "day"
6675
+ | "week"
6676
+ | "month"
6677
+ | "year";
6678
+ export type WorkflowSleepDuration =
6679
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6680
+ | number;
6681
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6670
6682
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6671
6683
  /**
6672
6684
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6676,6 +6688,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6676
6688
  * The event payload the Workflow instance is triggered with
6677
6689
  */
6678
6690
  params?: PARAMS;
6691
+ /**
6692
+ * The retention policy for Workflow instance.
6693
+ * Defaults to the maximum retention period available for the owner's account.
6694
+ */
6695
+ retention?: {
6696
+ successRetention?: WorkflowRetentionDuration;
6697
+ errorRetention?: WorkflowRetentionDuration;
6698
+ };
6679
6699
  }
6680
6700
  export type InstanceStatus = {
6681
6701
  status:
@@ -6202,6 +6202,7 @@ declare module "cloudflare:workers" {
6202
6202
  | number;
6203
6203
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6204
6204
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6205
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6205
6206
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6206
6207
  export type WorkflowStepConfig = {
6207
6208
  retries?: {
@@ -6816,6 +6817,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6816
6817
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6817
6818
  ): Promise<WorkflowInstance[]>;
6818
6819
  }
6820
+ type WorkflowDurationLabel =
6821
+ | "second"
6822
+ | "minute"
6823
+ | "hour"
6824
+ | "day"
6825
+ | "week"
6826
+ | "month"
6827
+ | "year";
6828
+ type WorkflowSleepDuration =
6829
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6830
+ | number;
6831
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6819
6832
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6820
6833
  /**
6821
6834
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6825,6 +6838,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6825
6838
  * The event payload the Workflow instance is triggered with
6826
6839
  */
6827
6840
  params?: PARAMS;
6841
+ /**
6842
+ * The retention policy for Workflow instance.
6843
+ * Defaults to the maximum retention period available for the owner's account.
6844
+ */
6845
+ retention?: {
6846
+ successRetention?: WorkflowRetentionDuration;
6847
+ errorRetention?: WorkflowRetentionDuration;
6848
+ };
6828
6849
  }
6829
6850
  type InstanceStatus = {
6830
6851
  status:
@@ -6671,6 +6671,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6671
6671
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6672
6672
  ): Promise<WorkflowInstance[]>;
6673
6673
  }
6674
+ export type WorkflowDurationLabel =
6675
+ | "second"
6676
+ | "minute"
6677
+ | "hour"
6678
+ | "day"
6679
+ | "week"
6680
+ | "month"
6681
+ | "year";
6682
+ export type WorkflowSleepDuration =
6683
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6684
+ | number;
6685
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6674
6686
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6675
6687
  /**
6676
6688
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6680,6 +6692,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6680
6692
  * The event payload the Workflow instance is triggered with
6681
6693
  */
6682
6694
  params?: PARAMS;
6695
+ /**
6696
+ * The retention policy for Workflow instance.
6697
+ * Defaults to the maximum retention period available for the owner's account.
6698
+ */
6699
+ retention?: {
6700
+ successRetention?: WorkflowRetentionDuration;
6701
+ errorRetention?: WorkflowRetentionDuration;
6702
+ };
6683
6703
  }
6684
6704
  export type InstanceStatus = {
6685
6705
  status:
@@ -6207,6 +6207,7 @@ declare module "cloudflare:workers" {
6207
6207
  | number;
6208
6208
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6209
6209
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6210
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6210
6211
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6211
6212
  export type WorkflowStepConfig = {
6212
6213
  retries?: {
@@ -6821,6 +6822,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6821
6822
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6822
6823
  ): Promise<WorkflowInstance[]>;
6823
6824
  }
6825
+ type WorkflowDurationLabel =
6826
+ | "second"
6827
+ | "minute"
6828
+ | "hour"
6829
+ | "day"
6830
+ | "week"
6831
+ | "month"
6832
+ | "year";
6833
+ type WorkflowSleepDuration =
6834
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6835
+ | number;
6836
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6824
6837
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6825
6838
  /**
6826
6839
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6830,6 +6843,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6830
6843
  * The event payload the Workflow instance is triggered with
6831
6844
  */
6832
6845
  params?: PARAMS;
6846
+ /**
6847
+ * The retention policy for Workflow instance.
6848
+ * Defaults to the maximum retention period available for the owner's account.
6849
+ */
6850
+ retention?: {
6851
+ successRetention?: WorkflowRetentionDuration;
6852
+ errorRetention?: WorkflowRetentionDuration;
6853
+ };
6833
6854
  }
6834
6855
  type InstanceStatus = {
6835
6856
  status:
@@ -6676,6 +6676,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6676
6676
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6677
6677
  ): Promise<WorkflowInstance[]>;
6678
6678
  }
6679
+ export type WorkflowDurationLabel =
6680
+ | "second"
6681
+ | "minute"
6682
+ | "hour"
6683
+ | "day"
6684
+ | "week"
6685
+ | "month"
6686
+ | "year";
6687
+ export type WorkflowSleepDuration =
6688
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6689
+ | number;
6690
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6679
6691
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6680
6692
  /**
6681
6693
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6685,6 +6697,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6685
6697
  * The event payload the Workflow instance is triggered with
6686
6698
  */
6687
6699
  params?: PARAMS;
6700
+ /**
6701
+ * The retention policy for Workflow instance.
6702
+ * Defaults to the maximum retention period available for the owner's account.
6703
+ */
6704
+ retention?: {
6705
+ successRetention?: WorkflowRetentionDuration;
6706
+ errorRetention?: WorkflowRetentionDuration;
6707
+ };
6688
6708
  }
6689
6709
  export type InstanceStatus = {
6690
6710
  status:
@@ -6209,6 +6209,7 @@ declare module "cloudflare:workers" {
6209
6209
  | number;
6210
6210
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6211
6211
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6212
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6212
6213
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6213
6214
  export type WorkflowStepConfig = {
6214
6215
  retries?: {
@@ -6823,6 +6824,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6823
6824
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6824
6825
  ): Promise<WorkflowInstance[]>;
6825
6826
  }
6827
+ type WorkflowDurationLabel =
6828
+ | "second"
6829
+ | "minute"
6830
+ | "hour"
6831
+ | "day"
6832
+ | "week"
6833
+ | "month"
6834
+ | "year";
6835
+ type WorkflowSleepDuration =
6836
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6837
+ | number;
6838
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6826
6839
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6827
6840
  /**
6828
6841
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6832,6 +6845,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6832
6845
  * The event payload the Workflow instance is triggered with
6833
6846
  */
6834
6847
  params?: PARAMS;
6848
+ /**
6849
+ * The retention policy for Workflow instance.
6850
+ * Defaults to the maximum retention period available for the owner's account.
6851
+ */
6852
+ retention?: {
6853
+ successRetention?: WorkflowRetentionDuration;
6854
+ errorRetention?: WorkflowRetentionDuration;
6855
+ };
6835
6856
  }
6836
6857
  type InstanceStatus = {
6837
6858
  status:
@@ -6678,6 +6678,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6678
6678
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6679
6679
  ): Promise<WorkflowInstance[]>;
6680
6680
  }
6681
+ export type WorkflowDurationLabel =
6682
+ | "second"
6683
+ | "minute"
6684
+ | "hour"
6685
+ | "day"
6686
+ | "week"
6687
+ | "month"
6688
+ | "year";
6689
+ export type WorkflowSleepDuration =
6690
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6691
+ | number;
6692
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6681
6693
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6682
6694
  /**
6683
6695
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6687,6 +6699,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6687
6699
  * The event payload the Workflow instance is triggered with
6688
6700
  */
6689
6701
  params?: PARAMS;
6702
+ /**
6703
+ * The retention policy for Workflow instance.
6704
+ * Defaults to the maximum retention period available for the owner's account.
6705
+ */
6706
+ retention?: {
6707
+ successRetention?: WorkflowRetentionDuration;
6708
+ errorRetention?: WorkflowRetentionDuration;
6709
+ };
6690
6710
  }
6691
6711
  export type InstanceStatus = {
6692
6712
  status:
@@ -6209,6 +6209,7 @@ declare module "cloudflare:workers" {
6209
6209
  | number;
6210
6210
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6211
6211
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6212
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6212
6213
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6213
6214
  export type WorkflowStepConfig = {
6214
6215
  retries?: {
@@ -6823,6 +6824,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6823
6824
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6824
6825
  ): Promise<WorkflowInstance[]>;
6825
6826
  }
6827
+ type WorkflowDurationLabel =
6828
+ | "second"
6829
+ | "minute"
6830
+ | "hour"
6831
+ | "day"
6832
+ | "week"
6833
+ | "month"
6834
+ | "year";
6835
+ type WorkflowSleepDuration =
6836
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6837
+ | number;
6838
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6826
6839
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6827
6840
  /**
6828
6841
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6832,6 +6845,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6832
6845
  * The event payload the Workflow instance is triggered with
6833
6846
  */
6834
6847
  params?: PARAMS;
6848
+ /**
6849
+ * The retention policy for Workflow instance.
6850
+ * Defaults to the maximum retention period available for the owner's account.
6851
+ */
6852
+ retention?: {
6853
+ successRetention?: WorkflowRetentionDuration;
6854
+ errorRetention?: WorkflowRetentionDuration;
6855
+ };
6835
6856
  }
6836
6857
  type InstanceStatus = {
6837
6858
  status:
@@ -6678,6 +6678,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6678
6678
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6679
6679
  ): Promise<WorkflowInstance[]>;
6680
6680
  }
6681
+ export type WorkflowDurationLabel =
6682
+ | "second"
6683
+ | "minute"
6684
+ | "hour"
6685
+ | "day"
6686
+ | "week"
6687
+ | "month"
6688
+ | "year";
6689
+ export type WorkflowSleepDuration =
6690
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6691
+ | number;
6692
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6681
6693
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6682
6694
  /**
6683
6695
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6687,6 +6699,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6687
6699
  * The event payload the Workflow instance is triggered with
6688
6700
  */
6689
6701
  params?: PARAMS;
6702
+ /**
6703
+ * The retention policy for Workflow instance.
6704
+ * Defaults to the maximum retention period available for the owner's account.
6705
+ */
6706
+ retention?: {
6707
+ successRetention?: WorkflowRetentionDuration;
6708
+ errorRetention?: WorkflowRetentionDuration;
6709
+ };
6690
6710
  }
6691
6711
  export type InstanceStatus = {
6692
6712
  status:
@@ -6450,6 +6450,7 @@ declare module "cloudflare:workers" {
6450
6450
  | number;
6451
6451
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6452
6452
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6453
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6453
6454
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6454
6455
  export type WorkflowStepConfig = {
6455
6456
  retries?: {
@@ -7064,6 +7065,18 @@ declare abstract class Workflow<PARAMS = unknown> {
7064
7065
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
7065
7066
  ): Promise<WorkflowInstance[]>;
7066
7067
  }
7068
+ type WorkflowDurationLabel =
7069
+ | "second"
7070
+ | "minute"
7071
+ | "hour"
7072
+ | "day"
7073
+ | "week"
7074
+ | "month"
7075
+ | "year";
7076
+ type WorkflowSleepDuration =
7077
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
7078
+ | number;
7079
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
7067
7080
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
7068
7081
  /**
7069
7082
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -7073,6 +7086,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
7073
7086
  * The event payload the Workflow instance is triggered with
7074
7087
  */
7075
7088
  params?: PARAMS;
7089
+ /**
7090
+ * The retention policy for Workflow instance.
7091
+ * Defaults to the maximum retention period available for the owner's account.
7092
+ */
7093
+ retention?: {
7094
+ successRetention?: WorkflowRetentionDuration;
7095
+ errorRetention?: WorkflowRetentionDuration;
7096
+ };
7076
7097
  }
7077
7098
  type InstanceStatus = {
7078
7099
  status:
@@ -6919,6 +6919,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6919
6919
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6920
6920
  ): Promise<WorkflowInstance[]>;
6921
6921
  }
6922
+ export type WorkflowDurationLabel =
6923
+ | "second"
6924
+ | "minute"
6925
+ | "hour"
6926
+ | "day"
6927
+ | "week"
6928
+ | "month"
6929
+ | "year";
6930
+ export type WorkflowSleepDuration =
6931
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6932
+ | number;
6933
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6922
6934
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6923
6935
  /**
6924
6936
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6928,6 +6940,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6928
6940
  * The event payload the Workflow instance is triggered with
6929
6941
  */
6930
6942
  params?: PARAMS;
6943
+ /**
6944
+ * The retention policy for Workflow instance.
6945
+ * Defaults to the maximum retention period available for the owner's account.
6946
+ */
6947
+ retention?: {
6948
+ successRetention?: WorkflowRetentionDuration;
6949
+ errorRetention?: WorkflowRetentionDuration;
6950
+ };
6931
6951
  }
6932
6952
  export type InstanceStatus = {
6933
6953
  status:
package/index.d.ts CHANGED
@@ -6153,6 +6153,7 @@ declare module "cloudflare:workers" {
6153
6153
  | number;
6154
6154
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6155
6155
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6156
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6156
6157
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6157
6158
  export type WorkflowStepConfig = {
6158
6159
  retries?: {
@@ -6767,6 +6768,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6767
6768
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6768
6769
  ): Promise<WorkflowInstance[]>;
6769
6770
  }
6771
+ type WorkflowDurationLabel =
6772
+ | "second"
6773
+ | "minute"
6774
+ | "hour"
6775
+ | "day"
6776
+ | "week"
6777
+ | "month"
6778
+ | "year";
6779
+ type WorkflowSleepDuration =
6780
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6781
+ | number;
6782
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6770
6783
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6771
6784
  /**
6772
6785
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6776,6 +6789,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6776
6789
  * The event payload the Workflow instance is triggered with
6777
6790
  */
6778
6791
  params?: PARAMS;
6792
+ /**
6793
+ * The retention policy for Workflow instance.
6794
+ * Defaults to the maximum retention period available for the owner's account.
6795
+ */
6796
+ retention?: {
6797
+ successRetention?: WorkflowRetentionDuration;
6798
+ errorRetention?: WorkflowRetentionDuration;
6799
+ };
6779
6800
  }
6780
6801
  type InstanceStatus = {
6781
6802
  status:
package/index.ts CHANGED
@@ -6622,6 +6622,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6622
6622
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6623
6623
  ): Promise<WorkflowInstance[]>;
6624
6624
  }
6625
+ export type WorkflowDurationLabel =
6626
+ | "second"
6627
+ | "minute"
6628
+ | "hour"
6629
+ | "day"
6630
+ | "week"
6631
+ | "month"
6632
+ | "year";
6633
+ export type WorkflowSleepDuration =
6634
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6635
+ | number;
6636
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6625
6637
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6626
6638
  /**
6627
6639
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6631,6 +6643,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6631
6643
  * The event payload the Workflow instance is triggered with
6632
6644
  */
6633
6645
  params?: PARAMS;
6646
+ /**
6647
+ * The retention policy for Workflow instance.
6648
+ * Defaults to the maximum retention period available for the owner's account.
6649
+ */
6650
+ retention?: {
6651
+ successRetention?: WorkflowRetentionDuration;
6652
+ errorRetention?: WorkflowRetentionDuration;
6653
+ };
6634
6654
  }
6635
6655
  export type InstanceStatus = {
6636
6656
  status:
package/latest/index.d.ts CHANGED
@@ -6216,6 +6216,7 @@ declare module "cloudflare:workers" {
6216
6216
  | number;
6217
6217
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6218
6218
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6219
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6219
6220
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6220
6221
  export type WorkflowStepConfig = {
6221
6222
  retries?: {
@@ -6830,6 +6831,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6830
6831
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6831
6832
  ): Promise<WorkflowInstance[]>;
6832
6833
  }
6834
+ type WorkflowDurationLabel =
6835
+ | "second"
6836
+ | "minute"
6837
+ | "hour"
6838
+ | "day"
6839
+ | "week"
6840
+ | "month"
6841
+ | "year";
6842
+ type WorkflowSleepDuration =
6843
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6844
+ | number;
6845
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6833
6846
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6834
6847
  /**
6835
6848
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6839,6 +6852,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6839
6852
  * The event payload the Workflow instance is triggered with
6840
6853
  */
6841
6854
  params?: PARAMS;
6855
+ /**
6856
+ * The retention policy for Workflow instance.
6857
+ * Defaults to the maximum retention period available for the owner's account.
6858
+ */
6859
+ retention?: {
6860
+ successRetention?: WorkflowRetentionDuration;
6861
+ errorRetention?: WorkflowRetentionDuration;
6862
+ };
6842
6863
  }
6843
6864
  type InstanceStatus = {
6844
6865
  status:
package/latest/index.ts CHANGED
@@ -6685,6 +6685,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6685
6685
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6686
6686
  ): Promise<WorkflowInstance[]>;
6687
6687
  }
6688
+ export type WorkflowDurationLabel =
6689
+ | "second"
6690
+ | "minute"
6691
+ | "hour"
6692
+ | "day"
6693
+ | "week"
6694
+ | "month"
6695
+ | "year";
6696
+ export type WorkflowSleepDuration =
6697
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6698
+ | number;
6699
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6688
6700
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6689
6701
  /**
6690
6702
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6694,6 +6706,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6694
6706
  * The event payload the Workflow instance is triggered with
6695
6707
  */
6696
6708
  params?: PARAMS;
6709
+ /**
6710
+ * The retention policy for Workflow instance.
6711
+ * Defaults to the maximum retention period available for the owner's account.
6712
+ */
6713
+ retention?: {
6714
+ successRetention?: WorkflowRetentionDuration;
6715
+ errorRetention?: WorkflowRetentionDuration;
6716
+ };
6697
6717
  }
6698
6718
  export type InstanceStatus = {
6699
6719
  status:
package/oldest/index.d.ts CHANGED
@@ -6153,6 +6153,7 @@ declare module "cloudflare:workers" {
6153
6153
  | number;
6154
6154
  export type WorkflowDelayDuration = WorkflowSleepDuration;
6155
6155
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
6156
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6156
6157
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
6157
6158
  export type WorkflowStepConfig = {
6158
6159
  retries?: {
@@ -6767,6 +6768,18 @@ declare abstract class Workflow<PARAMS = unknown> {
6767
6768
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6768
6769
  ): Promise<WorkflowInstance[]>;
6769
6770
  }
6771
+ type WorkflowDurationLabel =
6772
+ | "second"
6773
+ | "minute"
6774
+ | "hour"
6775
+ | "day"
6776
+ | "week"
6777
+ | "month"
6778
+ | "year";
6779
+ type WorkflowSleepDuration =
6780
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6781
+ | number;
6782
+ type WorkflowRetentionDuration = WorkflowSleepDuration;
6770
6783
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6771
6784
  /**
6772
6785
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6776,6 +6789,14 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6776
6789
  * The event payload the Workflow instance is triggered with
6777
6790
  */
6778
6791
  params?: PARAMS;
6792
+ /**
6793
+ * The retention policy for Workflow instance.
6794
+ * Defaults to the maximum retention period available for the owner's account.
6795
+ */
6796
+ retention?: {
6797
+ successRetention?: WorkflowRetentionDuration;
6798
+ errorRetention?: WorkflowRetentionDuration;
6799
+ };
6779
6800
  }
6780
6801
  type InstanceStatus = {
6781
6802
  status:
package/oldest/index.ts CHANGED
@@ -6622,6 +6622,18 @@ export declare abstract class Workflow<PARAMS = unknown> {
6622
6622
  batch: WorkflowInstanceCreateOptions<PARAMS>[],
6623
6623
  ): Promise<WorkflowInstance[]>;
6624
6624
  }
6625
+ export type WorkflowDurationLabel =
6626
+ | "second"
6627
+ | "minute"
6628
+ | "hour"
6629
+ | "day"
6630
+ | "week"
6631
+ | "month"
6632
+ | "year";
6633
+ export type WorkflowSleepDuration =
6634
+ | `${number} ${WorkflowDurationLabel}${"s" | ""}`
6635
+ | number;
6636
+ export type WorkflowRetentionDuration = WorkflowSleepDuration;
6625
6637
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6626
6638
  /**
6627
6639
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -6631,6 +6643,14 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
6631
6643
  * The event payload the Workflow instance is triggered with
6632
6644
  */
6633
6645
  params?: PARAMS;
6646
+ /**
6647
+ * The retention policy for Workflow instance.
6648
+ * Defaults to the maximum retention period available for the owner's account.
6649
+ */
6650
+ retention?: {
6651
+ successRetention?: WorkflowRetentionDuration;
6652
+ errorRetention?: WorkflowRetentionDuration;
6653
+ };
6634
6654
  }
6635
6655
  export type InstanceStatus = {
6636
6656
  status:
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20250529.0"
10
+ "version": "4.20250531.0"
11
11
  }