@superdurable/dex 0.1.4 → 0.1.6

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.
Files changed (54) hide show
  1. package/README.md +115 -5
  2. package/dist/src/client.d.ts +35 -18
  3. package/dist/src/client.js +121 -43
  4. package/dist/src/client.js.map +1 -1
  5. package/dist/src/codec.d.ts +1 -1
  6. package/dist/src/context.d.ts +20 -1
  7. package/dist/src/errors.d.ts +2 -33
  8. package/dist/src/errors.js +2 -45
  9. package/dist/src/errors.js.map +1 -1
  10. package/dist/src/flow-result.d.ts +47 -0
  11. package/dist/src/flow-result.js +82 -0
  12. package/dist/src/flow-result.js.map +1 -0
  13. package/dist/src/flow.d.ts +13 -1
  14. package/dist/src/flow.js +1 -0
  15. package/dist/src/flow.js.map +1 -1
  16. package/dist/src/gen/dex.d.ts +209 -33
  17. package/dist/src/gen/dex.js +1619 -213
  18. package/dist/src/gen/dex.js.map +1 -1
  19. package/dist/src/grpc-status.js +6 -5
  20. package/dist/src/grpc-status.js.map +1 -1
  21. package/dist/src/index.d.ts +2 -0
  22. package/dist/src/index.js +1 -0
  23. package/dist/src/index.js.map +1 -1
  24. package/dist/src/invocation-context.d.ts +7 -1
  25. package/dist/src/invocation-context.js +53 -1
  26. package/dist/src/invocation-context.js.map +1 -1
  27. package/dist/src/options.d.ts +42 -19
  28. package/dist/src/options.js +20 -4
  29. package/dist/src/options.js.map +1 -1
  30. package/dist/src/persistence.d.ts +12 -0
  31. package/dist/src/persistence.js +16 -0
  32. package/dist/src/persistence.js.map +1 -1
  33. package/dist/src/rpc.d.ts +3 -1
  34. package/dist/src/rpc.js.map +1 -1
  35. package/dist/src/step.d.ts +33 -3
  36. package/dist/src/step.js +38 -1
  37. package/dist/src/step.js.map +1 -1
  38. package/dist/src/subflow.d.ts +62 -0
  39. package/dist/src/subflow.js +62 -0
  40. package/dist/src/subflow.js.map +1 -0
  41. package/dist/src/wait.d.ts +23 -2
  42. package/dist/src/wait.js +17 -0
  43. package/dist/src/wait.js.map +1 -1
  44. package/dist/src/worker-dispatcher.d.ts +4 -3
  45. package/dist/src/worker-dispatcher.js +271 -37
  46. package/dist/src/worker-dispatcher.js.map +1 -1
  47. package/dist/src/worker.js +21 -5
  48. package/dist/src/worker.js.map +1 -1
  49. package/native/linux-aarch64/dex_blob_cache_node.node +0 -0
  50. package/native/linux-x86_64/dex_blob_cache_node.node +0 -0
  51. package/native/macos-aarch64/dex_blob_cache_node.node +0 -0
  52. package/native/macos-x86_64/dex_blob_cache_node.node +0 -0
  53. package/native/windows-x86_64/dex_blob_cache_node.node +0 -0
  54. package/package.json +1 -1
@@ -51,6 +51,13 @@ export declare enum StepDurability {
51
51
  STEP_DURABILITY_ASYNC = 2,
52
52
  UNRECOGNIZED = -1
53
53
  }
54
+ export declare enum FlowTimeoutPolicy {
55
+ FLOW_TIMEOUT_POLICY_UNSPECIFIED = 0,
56
+ FLOW_TIMEOUT_POLICY_FAIL = 1,
57
+ FLOW_TIMEOUT_POLICY_CANCEL = 2,
58
+ FLOW_TIMEOUT_POLICY_HANDLER = 3,
59
+ UNRECOGNIZED = -1
60
+ }
54
61
  export declare enum StopType {
55
62
  STOP_TYPE_UNSPECIFIED = 0,
56
63
  STOP_TYPE_CANCEL = 1,
@@ -63,7 +70,8 @@ export declare enum FlowStatus {
63
70
  FLOW_STATUS_RUNNING = 1,
64
71
  FLOW_STATUS_COMPLETED = 2,
65
72
  FLOW_STATUS_FAILED = 3,
66
- FLOW_STATUS_TIMEOUT = 4,
73
+ /** FLOW_STATUS_SERVER_SIDE_TIMEOUT_INTERNAL_ONLY - Reserved for reporting a backend hard timeout; applications must not depend on this status. */
74
+ FLOW_STATUS_SERVER_SIDE_TIMEOUT_INTERNAL_ONLY = 4,
67
75
  FLOW_STATUS_TERMINATED = 5,
68
76
  FLOW_STATUS_CANCELED = 6,
69
77
  FLOW_STATUS_CONTINUED_AS_NEW = 7,
@@ -76,10 +84,18 @@ export declare enum FlowErrorType {
76
84
  /** FLOW_ERROR_TYPE_WORKER_API_FAIL - includes waitFor/execute/rpc methods */
77
85
  FLOW_ERROR_TYPE_WORKER_API_FAIL = 3,
78
86
  FLOW_ERROR_TYPE_INVALID_USER_FLOW_CODE = 4,
87
+ FLOW_ERROR_TYPE_FLOW_TIMEOUT = 5,
79
88
  /** FLOW_ERROR_TYPE_INTERNAL - either bug in sdk or server */
80
89
  FLOW_ERROR_TYPE_INTERNAL = 6,
81
90
  UNRECOGNIZED = -1
82
91
  }
92
+ /** PendingStepMethodPhase reports the latest persisted backend lifecycle event. */
93
+ export declare enum PendingStepMethodPhase {
94
+ PENDING_STEP_METHOD_PHASE_UNSPECIFIED = 0,
95
+ PENDING_STEP_METHOD_PHASE_SCHEDULED = 1,
96
+ PENDING_STEP_METHOD_PHASE_STARTED = 2,
97
+ UNRECOGNIZED = -1
98
+ }
83
99
  export declare enum ActiveStepPhase {
84
100
  ACTIVE_STEP_PHASE_UNSPECIFIED = 0,
85
101
  ACTIVE_STEP_PHASE_ACTIVE = 1,
@@ -88,11 +104,16 @@ export declare enum ActiveStepPhase {
88
104
  }
89
105
  export declare enum FlowResetType {
90
106
  FLOW_RESET_TYPE_UNSPECIFIED = 0,
91
- FLOW_RESET_TYPE_HISTORY_EVENT_ID = 1,
92
- FLOW_RESET_TYPE_BEGINNING = 2,
93
- FLOW_RESET_TYPE_HISTORY_EVENT_TIME = 3,
94
- FLOW_RESET_TYPE_STEP_TYPE = 4,
95
- FLOW_RESET_TYPE_STEP_EXECUTION_ID = 5,
107
+ FLOW_RESET_TYPE_BEGINNING = 1,
108
+ FLOW_RESET_TYPE_HISTORY_EVENT_TIME = 2,
109
+ FLOW_RESET_TYPE_STEP_TYPE = 3,
110
+ FLOW_RESET_TYPE_STEP_EXECUTION_ID = 4,
111
+ UNRECOGNIZED = -1
112
+ }
113
+ export declare enum FlowResetStepMethod {
114
+ FLOW_RESET_STEP_METHOD_UNSPECIFIED = 0,
115
+ FLOW_RESET_STEP_METHOD_WAIT_FOR = 1,
116
+ FLOW_RESET_STEP_METHOD_EXECUTE = 2,
96
117
  UNRECOGNIZED = -1
97
118
  }
98
119
  export declare enum ErrorSubStatus {
@@ -120,6 +141,13 @@ export declare enum WaitingConditionType {
120
141
  WAITING_CONDITION_TYPE_ANY_COMBINATION_COMPLETED = 3,
121
142
  UNRECOGNIZED = -1
122
143
  }
144
+ export declare enum SubFlowReusePolicy {
145
+ SUB_FLOW_REUSE_POLICY_UNSPECIFIED = 0,
146
+ SUB_FLOW_REUSE_POLICY_ATTACH = 1,
147
+ SUB_FLOW_REUSE_POLICY_RESTART_IF_PREVIOUS_EXITS_ABNORMALLY = 2,
148
+ SUB_FLOW_REUSE_POLICY_ALWAYS_RESTART = 3,
149
+ UNRECOGNIZED = -1
150
+ }
123
151
  export declare enum ConditionStatus {
124
152
  CONDITION_STATUS_UNSPECIFIED = 0,
125
153
  CONDITION_STATUS_WAITING = 1,
@@ -143,6 +171,12 @@ export declare enum UpdateErrorType {
143
171
  UPDATE_ERROR_TYPE_SERVER_INTERNAL = 6,
144
172
  UNRECOGNIZED = -1
145
173
  }
174
+ export declare enum SubFlowCompletionDeliveryStatus {
175
+ SUB_FLOW_COMPLETION_DELIVERY_STATUS_UNSPECIFIED = 0,
176
+ SUB_FLOW_COMPLETION_DELIVERY_STATUS_DELIVERED = 1,
177
+ SUB_FLOW_COMPLETION_DELIVERY_STATUS_PARENT_CLOSED_OR_NOT_FOUND = 2,
178
+ UNRECOGNIZED = -1
179
+ }
146
180
  export interface Value {
147
181
  kind: //
148
182
  /** Hydrate from blob storage, then replace with string_value. */
@@ -211,8 +245,10 @@ export interface Context {
211
245
  attempt: number;
212
246
  /** Step execution that scheduled this execution, or a reserved source. */
213
247
  fromStepExecutionId: string;
248
+ /** Previous Step method failure supplied only to its configured recovery method. */
249
+ recoveryError: RecoveryErrorInfo | undefined;
214
250
  }
215
- export interface LocalActivityInput {
251
+ export interface LocalActivityMetadata {
216
252
  currentStepExecutionId: string;
217
253
  fromStepExecutionId: string;
218
254
  }
@@ -243,6 +279,7 @@ export interface StepOptions {
243
279
  executeDurabilityOverride: StepDurability;
244
280
  waitForLockAttributeKeys: string[];
245
281
  executeLockAttributeKeys: string[];
282
+ heartbeatTimeoutSeconds: number;
246
283
  }
247
284
  export interface FlowAlreadyStartedOptions {
248
285
  ignoreAlreadyStartedError: boolean;
@@ -274,6 +311,7 @@ export interface StartFlowRequest {
274
311
  flowId: string;
275
312
  flowType: string;
276
313
  flowTimeoutSeconds: number;
314
+ flowTimeoutPolicy: FlowTimeoutPolicy;
277
315
  startStepType: string;
278
316
  stepInput: Value | undefined;
279
317
  stepOptions: StepOptions | undefined;
@@ -344,7 +382,7 @@ export interface StepCompletionOutput {
344
382
  completedStepExecutionId: string;
345
383
  completedStepOutput: Value | undefined;
346
384
  }
347
- export interface WaitForFlowResponse {
385
+ export interface FlowResult {
348
386
  flowStatus: FlowStatus;
349
387
  results: StepCompletionOutput[];
350
388
  errorType: FlowErrorType;
@@ -449,13 +487,28 @@ export interface FlowHistoryEvent {
449
487
  } | {
450
488
  $case: "channelExternalPublish";
451
489
  value: ChannelExternalPublishEvent;
490
+ } | {
491
+ $case: "stepWaitForPending";
492
+ value: StepMethodPendingEvent;
493
+ } | {
494
+ $case: "stepExecutePending";
495
+ value: StepMethodPendingEvent;
496
+ } | {
497
+ $case: "timeTravelFork";
498
+ value: TimeTravelForkHistoryEvent;
452
499
  } | undefined;
453
500
  }
501
+ /** TimeTravelForkHistoryEvent identifies the preserved run whose history Time Travel forked. */
502
+ export interface TimeTravelForkHistoryEvent {
503
+ /** Previous run containing the original history branch. */
504
+ previousRunId: string;
505
+ }
454
506
  export interface FlowStartedOrContinuedHistoryEvent {
455
507
  flowExecutionId: FlowExecutionID | undefined;
456
508
  flowType: string;
457
509
  flowConfig: FlowConfig | undefined;
458
510
  flowTimeout: Duration | undefined;
511
+ flowTimeoutPolicy: FlowTimeoutPolicy;
459
512
  startOrContinue: {
460
513
  $case: "initialStart";
461
514
  value: FlowInitialStart;
@@ -491,14 +544,21 @@ export interface FlowClosedHistoryEvent {
491
544
  errorMessage: string;
492
545
  continuedToRunId: string;
493
546
  }
547
+ /** StepMethodPendingEvent describes a regular Step activity unresolved at flow closure. */
548
+ export interface StepMethodPendingEvent {
549
+ input: StepMethodEventInput | undefined;
550
+ context: StepMethodEventContext | undefined;
551
+ phase: PendingStepMethodPhase;
552
+ }
494
553
  export interface StepMethodFailure {
495
554
  backendError: string;
496
- details: ErrorResponse | undefined;
555
+ details: ServiceErrorResponse | undefined;
497
556
  attempt: number;
498
557
  }
499
558
  export interface StepMethodOptions {
500
559
  timeoutSeconds: number;
501
560
  retryPolicy: RetryPolicy | undefined;
561
+ heartbeatTimeoutSeconds: number;
502
562
  }
503
563
  export interface StepMethodEventInput {
504
564
  unavailable: boolean;
@@ -516,7 +576,6 @@ export interface StepMethodEventContext {
516
576
  startedTime: Date | undefined;
517
577
  duration: Duration | undefined;
518
578
  methodOptions: StepMethodOptions | undefined;
519
- isTransientStep?: boolean | undefined;
520
579
  lastFailureInfo: StepMethodFailure | undefined;
521
580
  }
522
581
  export interface StepWaitForCompletedOutput {
@@ -525,7 +584,6 @@ export interface StepWaitForCompletedOutput {
525
584
  publishToChannel: ChannelMessage[];
526
585
  recordEvents: KV[];
527
586
  upsertStepExecutionLocals: KV[];
528
- transientStepMovement: StepMovement | undefined;
529
587
  }
530
588
  export interface StepExecuteCompletedOutput {
531
589
  stepDecision: StepDecision | undefined;
@@ -557,6 +615,10 @@ export interface StepExecuteFailedEvent {
557
615
  output: StepMethodFailedOutput | undefined;
558
616
  context: StepMethodEventContext | undefined;
559
617
  }
618
+ /**
619
+ * Successful RPC history projection. Updates include input/output; signals include
620
+ * them only when configured.
621
+ */
560
622
  export interface RpcExecutionCompletedEvent {
561
623
  rpcName: string;
562
624
  input: Value | undefined;
@@ -565,6 +627,7 @@ export interface RpcExecutionCompletedEvent {
565
627
  upsertAttributes: AttributeWrite[];
566
628
  recordEvents: KV[];
567
629
  publishToChannel: ChannelMessage[];
630
+ isSetAttributeApi: boolean;
568
631
  }
569
632
  export interface ChannelExternalPublishEvent {
570
633
  messages: ChannelMessage[];
@@ -585,7 +648,7 @@ export interface ActiveStepExecutionState {
585
648
  stepType: string;
586
649
  phase: ActiveStepPhase;
587
650
  movement: StepMovement | undefined;
588
- waitingCondition: WaitingCondition | undefined;
651
+ waitingCondition: WaitingConditionState | undefined;
589
652
  completedConditions: StepExecutionCompletedConditions | undefined;
590
653
  stepExecutionLocals: KV[];
591
654
  timers: TimerInfo[];
@@ -613,29 +676,30 @@ export interface ResetFlowRequest {
613
676
  flowId: string;
614
677
  runId: string;
615
678
  resetType: FlowResetType;
616
- historyEventId: number;
617
679
  reason: string;
618
680
  historyEventTime: string;
619
681
  stepType: string;
620
682
  stepExecutionId: string;
621
- skipChannelMessagesReapply: boolean;
622
- skipLockingRpcReapply: boolean;
683
+ /** Skips reapplying RPCs, Channel publications, and Attribute writes after the reset point. */
684
+ skipWritesReapply: boolean;
685
+ stepMethod: FlowResetStepMethod;
623
686
  }
624
687
  export interface ResetFlowResponse {
625
688
  runId: string;
626
689
  }
627
690
  export interface InvokeRPCRequest {
628
691
  flowId: string;
692
+ /** Targets this run when set. */
629
693
  runId: string;
630
694
  rpcName: string;
631
695
  input: Value | undefined;
632
696
  timeoutSeconds: number;
633
697
  /**
634
698
  * Acquire exclusive lock on these attribute keys for the RPC's
635
- * read-modify-write. Empty = non-locking RPC.
699
+ * read-modify-write. Empty means no locking and uses the configured RPC path.
636
700
  */
637
701
  lockAttributeKeys: string[];
638
- /** Locking RPCs require per-call UUID, SDK-generated and future-overridable; identical retries reuse it. Server forwards run-scoped UpdateID; Continue-as-New resets scope. */
702
+ /** Per-call UUID, SDK-generated and future-overridable; identical retries reuse it. Temporal Update paths use it as the run-scoped Update ID; Continue-as-New resets scope. */
639
703
  requestId: string;
640
704
  }
641
705
  export interface InvokeRPCResponse {
@@ -692,7 +756,7 @@ export interface HealthInfo {
692
756
  hostname: string;
693
757
  duration: number;
694
758
  }
695
- export interface ErrorResponse {
759
+ export interface ServiceErrorResponse {
696
760
  detail: string;
697
761
  subStatus: ErrorSubStatus;
698
762
  originalWorkerErrorDetail: string;
@@ -704,6 +768,26 @@ export interface WorkerErrorResponse {
704
768
  detail: string;
705
769
  errorType: string;
706
770
  stackTrace: string;
771
+ retryAfterSeconds: number;
772
+ }
773
+ export interface InternalActivityError {
774
+ serverDetail: string;
775
+ workerGrpcStatus: number;
776
+ workerError: InternalWorkerError | undefined;
777
+ }
778
+ export interface InternalWorkerError {
779
+ detail: string;
780
+ errorType: string;
781
+ stackTrace: string;
782
+ }
783
+ export interface InternalFlowError {
784
+ failure: {
785
+ $case: "serverDetail";
786
+ value: string;
787
+ } | {
788
+ $case: "activityError";
789
+ value: InternalActivityError;
790
+ } | undefined;
707
791
  }
708
792
  export interface ChannelInfo {
709
793
  size: number;
@@ -717,13 +801,12 @@ export interface InvokeWaitForMethodRequest {
717
801
  }
718
802
  export interface InvokeWaitForMethodResponse {
719
803
  /** Server-populated lineage input for local activity history. */
720
- localActivityInput: LocalActivityInput | undefined;
804
+ localActivityMetadata: LocalActivityMetadata | undefined;
721
805
  upsertAttributes: AttributeWrite[];
722
806
  waitingCondition: WaitingCondition | undefined;
723
807
  upsertStepExeLocals: KV[];
724
808
  recordEvents: KV[];
725
809
  publishToChannel: ChannelMessage[];
726
- transientStepMovement: StepMovement | undefined;
727
810
  }
728
811
  export interface InvokeExecuteMethodRequest {
729
812
  context: Context | undefined;
@@ -736,7 +819,7 @@ export interface InvokeExecuteMethodRequest {
736
819
  }
737
820
  export interface InvokeExecuteMethodResponse {
738
821
  /** Server-populated lineage input for local activity history. */
739
- localActivityInput: LocalActivityInput | undefined;
822
+ localActivityMetadata: LocalActivityMetadata | undefined;
740
823
  stepDecision: StepDecision | undefined;
741
824
  upsertAttributes: AttributeWrite[];
742
825
  recordEvents: KV[];
@@ -767,6 +850,8 @@ export interface InvokeWorkerRPCResponse {
767
850
  export interface StepDecision {
768
851
  nextSteps: StepMovement[];
769
852
  closeDecision: CloseDecision | undefined;
853
+ cancelStepTypes: string[];
854
+ cancelSiblingStepTypes: string[];
770
855
  }
771
856
  export interface CloseDecision {
772
857
  closeDecisionType: CloseDecisionType;
@@ -779,6 +864,8 @@ export interface StepMovement {
779
864
  stepOptions: StepOptions | undefined;
780
865
  /** Server-owned scheduling source; workers must leave this empty. */
781
866
  fromStepExecutionIdInternalOnly: string;
867
+ /** Server-owned error passed only to an Execute failure recovery Step. */
868
+ recoveryErrorInternalOnly: RecoveryErrorInfo | undefined;
782
869
  }
783
870
  export interface ConditionCombination {
784
871
  conditionIds: string[];
@@ -788,6 +875,36 @@ export interface WaitingCondition {
788
875
  timerConditions: TimerCondition[];
789
876
  channelConditions: ChannelCondition[];
790
877
  conditionCombinations: ConditionCombination[];
878
+ subFlowConditions: SubFlowCondition[];
879
+ }
880
+ export interface WaitingConditionState {
881
+ waitingConditionType: WaitingConditionType;
882
+ timerConditions: TimerCondition[];
883
+ channelConditions: ChannelCondition[];
884
+ conditionCombinations: ConditionCombination[];
885
+ subFlowConditions: SubFlowConditionState[];
886
+ }
887
+ export interface SubFlowOptions {
888
+ reusePolicy: SubFlowReusePolicy;
889
+ flowTimeoutSeconds: number;
890
+ flowStartDelaySeconds: number;
891
+ retryPolicy: FlowRetryPolicy | undefined;
892
+ attributes: AttributeWrite[];
893
+ flowConfigOverride: FlowConfig | undefined;
894
+ flowTimeoutPolicy: FlowTimeoutPolicy;
895
+ }
896
+ export interface SubFlowCondition {
897
+ /** Optional unless waiting_condition_type is ANY_COMBINATION_COMPLETED. */
898
+ conditionId: string;
899
+ subFlowType: string;
900
+ startStepType: string;
901
+ stepInput: Value | undefined;
902
+ stepOptions: StepOptions | undefined;
903
+ options: SubFlowOptions | undefined;
904
+ subFlowIndex: number;
905
+ }
906
+ export interface SubFlowConditionState {
907
+ conditionId: string;
791
908
  }
792
909
  export interface TimerCondition {
793
910
  /** Optional unless waiting_condition_type is ANY_COMBINATION_COMPLETED. */
@@ -809,6 +926,7 @@ export interface ConditionResults {
809
926
  channelResults: ChannelResult[];
810
927
  timerResults: TimerResult[];
811
928
  waitForFailed: boolean;
929
+ subFlowResults: FlowResult[];
812
930
  }
813
931
  export interface TimerResult {
814
932
  conditionId: string;
@@ -841,16 +959,23 @@ export interface StepExecutionCompletedConditions {
841
959
  completedTimerConditions: {
842
960
  [key: number]: InternalTimerStatus;
843
961
  };
962
+ completedSubFlowResults: {
963
+ [key: number]: FlowResult;
964
+ };
844
965
  }
845
966
  export interface StepExecutionCompletedConditions_CompletedTimerConditionsEntry {
846
967
  key: number;
847
968
  value: InternalTimerStatus;
848
969
  }
970
+ export interface StepExecutionCompletedConditions_CompletedSubFlowResultsEntry {
971
+ key: number;
972
+ value: FlowResult | undefined;
973
+ }
849
974
  export interface StepExecutionResumeInfo {
850
975
  stepExecutionId: string;
851
976
  step: StepMovement | undefined;
852
977
  completedConditions: StepExecutionCompletedConditions | undefined;
853
- waitingCondition: WaitingCondition | undefined;
978
+ waitingCondition: WaitingConditionState | undefined;
854
979
  stepExeLocals: KV[];
855
980
  }
856
981
  export interface StepExecutionCounterInfo {
@@ -904,6 +1029,8 @@ export interface ContinueAsNewInput {
904
1029
  }
905
1030
  export interface InterpreterWorkflowInput {
906
1031
  flowType: string;
1032
+ configuredFlowTimeoutSeconds: number;
1033
+ flowTimeoutPolicy: FlowTimeoutPolicy;
907
1034
  startStepType: string;
908
1035
  stepInput: Value | undefined;
909
1036
  stepOptions: StepOptions | undefined;
@@ -932,8 +1059,17 @@ export interface InvokeWaitForMethodActivityOutput {
932
1059
  export interface InvokeExecuteMethodActivityInput {
933
1060
  workerTarget: WorkerTarget | undefined;
934
1061
  request: InvokeExecuteMethodRequest | undefined;
935
- /** Requires a DeadEnd close decision without next steps. */
936
- isTransientStep: boolean;
1062
+ }
1063
+ export interface RecoveryErrorInfo {
1064
+ detail: string;
1065
+ errorType: string;
1066
+ }
1067
+ export interface InternalLocalStepActivityFailure {
1068
+ localActivityMetadata: LocalActivityMetadata | undefined;
1069
+ firstAttemptTimestamp: bigint;
1070
+ methodOptions: StepMethodOptions | undefined;
1071
+ attempt: number;
1072
+ activityError: InternalActivityError | undefined;
937
1073
  }
938
1074
  export interface InvokeExecuteMethodActivityOutput {
939
1075
  response: InvokeExecuteMethodResponse | undefined;
@@ -950,6 +1086,8 @@ export interface InvokeWorkerRPCActivityInput {
950
1086
  }
951
1087
  export interface InvokeWorkerRPCActivityOutput {
952
1088
  response: InvokeWorkerRPCResponse | undefined;
1089
+ /** Correlates this local Activity result with its InvokeRpc Update. */
1090
+ requestId: string;
953
1091
  }
954
1092
  export interface CleanupBlobStoreActivityInput {
955
1093
  storeId: string;
@@ -967,6 +1105,26 @@ export interface SyncAttributeBatchActivityInput {
967
1105
  configName: string;
968
1106
  items: AttributeSyncItem[];
969
1107
  }
1108
+ export interface StartSubFlowActivityInput {
1109
+ condition: SubFlowCondition | undefined;
1110
+ parentFlowConfig: FlowConfig | undefined;
1111
+ /** Source Step; activity context supplies parent Flow and run IDs. */
1112
+ parentStepExecutionId: string;
1113
+ }
1114
+ export interface StartSubFlowActivityOutput {
1115
+ immediateFlowResult: FlowResult | undefined;
1116
+ }
1117
+ export interface SubFlowCompletionSignalRequest {
1118
+ subFlowId: string;
1119
+ flowResult: FlowResult | undefined;
1120
+ }
1121
+ export interface ReportSubFlowCompletionActivityInput {
1122
+ parentFlowId: string;
1123
+ request: SubFlowCompletionSignalRequest | undefined;
1124
+ }
1125
+ export interface ReportSubFlowCompletionActivityOutput {
1126
+ status: SubFlowCompletionDeliveryStatus;
1127
+ }
970
1128
  export interface ExecuteRpcSignalRequest {
971
1129
  rpcInput: Value | undefined;
972
1130
  rpcOutput: Value | undefined;
@@ -974,6 +1132,7 @@ export interface ExecuteRpcSignalRequest {
974
1132
  stepDecision: StepDecision | undefined;
975
1133
  recordEvents: KV[];
976
1134
  publishToChannel: ChannelMessage[];
1135
+ isSetAttributeApi: boolean;
977
1136
  }
978
1137
  export interface SkipTimerSignalRequest {
979
1138
  stepExecutionId: string;
@@ -1050,7 +1209,7 @@ export declare const AttributeSyncConfig: MessageFns<AttributeSyncConfig>;
1050
1209
  export declare const KV: MessageFns<KV>;
1051
1210
  export declare const IndexConfig: MessageFns<IndexConfig>;
1052
1211
  export declare const Context: MessageFns<Context>;
1053
- export declare const LocalActivityInput: MessageFns<LocalActivityInput>;
1212
+ export declare const LocalActivityMetadata: MessageFns<LocalActivityMetadata>;
1054
1213
  export declare const RetryPolicy: MessageFns<RetryPolicy>;
1055
1214
  export declare const FlowRetryPolicy: MessageFns<FlowRetryPolicy>;
1056
1215
  export declare const StepOptions: MessageFns<StepOptions>;
@@ -1071,7 +1230,7 @@ export declare const LoadBlobsResponse: MessageFns<LoadBlobsResponse>;
1071
1230
  export declare const LoadBlobsResponse_ValuesEntry: MessageFns<LoadBlobsResponse_ValuesEntry>;
1072
1231
  export declare const WaitForFlowRequest: MessageFns<WaitForFlowRequest>;
1073
1232
  export declare const StepCompletionOutput: MessageFns<StepCompletionOutput>;
1074
- export declare const WaitForFlowResponse: MessageFns<WaitForFlowResponse>;
1233
+ export declare const FlowResult: MessageFns<FlowResult>;
1075
1234
  export declare const SearchFlowsRequest: MessageFns<SearchFlowsRequest>;
1076
1235
  export declare const SearchFlowsResponse: MessageFns<SearchFlowsResponse>;
1077
1236
  export declare const SearchFlowsResponseEntry: MessageFns<SearchFlowsResponseEntry>;
@@ -1086,11 +1245,13 @@ export declare const InternalLocalActivityInput: MessageFns<InternalLocalActivit
1086
1245
  export declare const GetHistoryEventsRequest: MessageFns<GetHistoryEventsRequest>;
1087
1246
  export declare const GetHistoryEventsResponse: MessageFns<GetHistoryEventsResponse>;
1088
1247
  export declare const FlowHistoryEvent: MessageFns<FlowHistoryEvent>;
1248
+ export declare const TimeTravelForkHistoryEvent: MessageFns<TimeTravelForkHistoryEvent>;
1089
1249
  export declare const FlowStartedOrContinuedHistoryEvent: MessageFns<FlowStartedOrContinuedHistoryEvent>;
1090
1250
  export declare const FlowInitialStart: MessageFns<FlowInitialStart>;
1091
1251
  export declare const FlowContinuedStart: MessageFns<FlowContinuedStart>;
1092
1252
  export declare const FlowContinuedStart_PendingChannelMessagesEntry: MessageFns<FlowContinuedStart_PendingChannelMessagesEntry>;
1093
1253
  export declare const FlowClosedHistoryEvent: MessageFns<FlowClosedHistoryEvent>;
1254
+ export declare const StepMethodPendingEvent: MessageFns<StepMethodPendingEvent>;
1094
1255
  export declare const StepMethodFailure: MessageFns<StepMethodFailure>;
1095
1256
  export declare const StepMethodOptions: MessageFns<StepMethodOptions>;
1096
1257
  export declare const StepMethodEventInput: MessageFns<StepMethodEventInput>;
@@ -1123,8 +1284,11 @@ export declare const WaitForAttributeCondition: MessageFns<WaitForAttributeCondi
1123
1284
  export declare const WaitForAttributeEqual: MessageFns<WaitForAttributeEqual>;
1124
1285
  export declare const TriggerContinueAsNewRequest: MessageFns<TriggerContinueAsNewRequest>;
1125
1286
  export declare const HealthInfo: MessageFns<HealthInfo>;
1126
- export declare const ErrorResponse: MessageFns<ErrorResponse>;
1287
+ export declare const ServiceErrorResponse: MessageFns<ServiceErrorResponse>;
1127
1288
  export declare const WorkerErrorResponse: MessageFns<WorkerErrorResponse>;
1289
+ export declare const InternalActivityError: MessageFns<InternalActivityError>;
1290
+ export declare const InternalWorkerError: MessageFns<InternalWorkerError>;
1291
+ export declare const InternalFlowError: MessageFns<InternalFlowError>;
1128
1292
  export declare const ChannelInfo: MessageFns<ChannelInfo>;
1129
1293
  export declare const InvokeWaitForMethodRequest: MessageFns<InvokeWaitForMethodRequest>;
1130
1294
  export declare const InvokeWaitForMethodResponse: MessageFns<InvokeWaitForMethodResponse>;
@@ -1138,6 +1302,10 @@ export declare const CloseDecision: MessageFns<CloseDecision>;
1138
1302
  export declare const StepMovement: MessageFns<StepMovement>;
1139
1303
  export declare const ConditionCombination: MessageFns<ConditionCombination>;
1140
1304
  export declare const WaitingCondition: MessageFns<WaitingCondition>;
1305
+ export declare const WaitingConditionState: MessageFns<WaitingConditionState>;
1306
+ export declare const SubFlowOptions: MessageFns<SubFlowOptions>;
1307
+ export declare const SubFlowCondition: MessageFns<SubFlowCondition>;
1308
+ export declare const SubFlowConditionState: MessageFns<SubFlowConditionState>;
1141
1309
  export declare const TimerCondition: MessageFns<TimerCondition>;
1142
1310
  export declare const ChannelCondition: MessageFns<ChannelCondition>;
1143
1311
  export declare const ConditionResults: MessageFns<ConditionResults>;
@@ -1148,6 +1316,7 @@ export declare const ContinueAsNewDumpResponse: MessageFns<ContinueAsNewDumpResp
1148
1316
  export declare const ChannelValues: MessageFns<ChannelValues>;
1149
1317
  export declare const StepExecutionCompletedConditions: MessageFns<StepExecutionCompletedConditions>;
1150
1318
  export declare const StepExecutionCompletedConditions_CompletedTimerConditionsEntry: MessageFns<StepExecutionCompletedConditions_CompletedTimerConditionsEntry>;
1319
+ export declare const StepExecutionCompletedConditions_CompletedSubFlowResultsEntry: MessageFns<StepExecutionCompletedConditions_CompletedSubFlowResultsEntry>;
1151
1320
  export declare const StepExecutionResumeInfo: MessageFns<StepExecutionResumeInfo>;
1152
1321
  export declare const StepExecutionCounterInfo: MessageFns<StepExecutionCounterInfo>;
1153
1322
  export declare const StepExecutionCounterInfo_StepTypeStartedCountEntry: MessageFns<StepExecutionCounterInfo_StepTypeStartedCountEntry>;
@@ -1164,6 +1333,8 @@ export declare const BlobStoreCleanupWorkflowOutput: MessageFns<BlobStoreCleanup
1164
1333
  export declare const InvokeWaitForMethodActivityInput: MessageFns<InvokeWaitForMethodActivityInput>;
1165
1334
  export declare const InvokeWaitForMethodActivityOutput: MessageFns<InvokeWaitForMethodActivityOutput>;
1166
1335
  export declare const InvokeExecuteMethodActivityInput: MessageFns<InvokeExecuteMethodActivityInput>;
1336
+ export declare const RecoveryErrorInfo: MessageFns<RecoveryErrorInfo>;
1337
+ export declare const InternalLocalStepActivityFailure: MessageFns<InternalLocalStepActivityFailure>;
1167
1338
  export declare const InvokeExecuteMethodActivityOutput: MessageFns<InvokeExecuteMethodActivityOutput>;
1168
1339
  export declare const DumpFlowForContinueAsNewActivityInput: MessageFns<DumpFlowForContinueAsNewActivityInput>;
1169
1340
  export declare const DumpFlowForContinueAsNewActivityOutput: MessageFns<DumpFlowForContinueAsNewActivityOutput>;
@@ -1173,6 +1344,11 @@ export declare const CleanupBlobStoreActivityInput: MessageFns<CleanupBlobStoreA
1173
1344
  export declare const CleanupBlobStoreActivityOutput: MessageFns<CleanupBlobStoreActivityOutput>;
1174
1345
  export declare const AttributeSyncItem: MessageFns<AttributeSyncItem>;
1175
1346
  export declare const SyncAttributeBatchActivityInput: MessageFns<SyncAttributeBatchActivityInput>;
1347
+ export declare const StartSubFlowActivityInput: MessageFns<StartSubFlowActivityInput>;
1348
+ export declare const StartSubFlowActivityOutput: MessageFns<StartSubFlowActivityOutput>;
1349
+ export declare const SubFlowCompletionSignalRequest: MessageFns<SubFlowCompletionSignalRequest>;
1350
+ export declare const ReportSubFlowCompletionActivityInput: MessageFns<ReportSubFlowCompletionActivityInput>;
1351
+ export declare const ReportSubFlowCompletionActivityOutput: MessageFns<ReportSubFlowCompletionActivityOutput>;
1176
1352
  export declare const ExecuteRpcSignalRequest: MessageFns<ExecuteRpcSignalRequest>;
1177
1353
  export declare const SkipTimerSignalRequest: MessageFns<SkipTimerSignalRequest>;
1178
1354
  export declare const StopFlowSignalRequest: MessageFns<StopFlowSignalRequest>;
@@ -1252,8 +1428,8 @@ export declare const FlowServiceService: {
1252
1428
  readonly responseStream: false;
1253
1429
  readonly requestSerialize: (value: WaitForFlowRequest) => Buffer;
1254
1430
  readonly requestDeserialize: (value: Buffer) => WaitForFlowRequest;
1255
- readonly responseSerialize: (value: WaitForFlowResponse) => Buffer;
1256
- readonly responseDeserialize: (value: Buffer) => WaitForFlowResponse;
1431
+ readonly responseSerialize: (value: FlowResult) => Buffer;
1432
+ readonly responseDeserialize: (value: Buffer) => FlowResult;
1257
1433
  };
1258
1434
  readonly searchFlows: {
1259
1435
  readonly path: "/dex.FlowService/SearchFlows";
@@ -1389,7 +1565,7 @@ export interface FlowServiceServer extends UntypedServiceImplementation {
1389
1565
  getAttributes: handleUnaryCall<GetAttributesRequest, GetAttributesResponse>;
1390
1566
  setAttributes: handleUnaryCall<SetAttributesRequest, Empty>;
1391
1567
  loadBlobs: handleUnaryCall<LoadBlobsRequest, LoadBlobsResponse>;
1392
- waitForFlow: handleUnaryCall<WaitForFlowRequest, WaitForFlowResponse>;
1568
+ waitForFlow: handleUnaryCall<WaitForFlowRequest, FlowResult>;
1393
1569
  searchFlows: handleUnaryCall<SearchFlowsRequest, SearchFlowsResponse>;
1394
1570
  syncAttributeIndexes: handleUnaryCall<SyncAttributeIndexRequest, SyncAttributeIndexResponse>;
1395
1571
  getFlowSummary: handleUnaryCall<GetFlowSummaryRequest, GetFlowSummaryResponse>;
@@ -1424,9 +1600,9 @@ export interface FlowServiceClient extends Client {
1424
1600
  loadBlobs(request: LoadBlobsRequest, callback: (error: ServiceError | null, response: LoadBlobsResponse) => void): ClientUnaryCall;
1425
1601
  loadBlobs(request: LoadBlobsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: LoadBlobsResponse) => void): ClientUnaryCall;
1426
1602
  loadBlobs(request: LoadBlobsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: LoadBlobsResponse) => void): ClientUnaryCall;
1427
- waitForFlow(request: WaitForFlowRequest, callback: (error: ServiceError | null, response: WaitForFlowResponse) => void): ClientUnaryCall;
1428
- waitForFlow(request: WaitForFlowRequest, metadata: Metadata, callback: (error: ServiceError | null, response: WaitForFlowResponse) => void): ClientUnaryCall;
1429
- waitForFlow(request: WaitForFlowRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: WaitForFlowResponse) => void): ClientUnaryCall;
1603
+ waitForFlow(request: WaitForFlowRequest, callback: (error: ServiceError | null, response: FlowResult) => void): ClientUnaryCall;
1604
+ waitForFlow(request: WaitForFlowRequest, metadata: Metadata, callback: (error: ServiceError | null, response: FlowResult) => void): ClientUnaryCall;
1605
+ waitForFlow(request: WaitForFlowRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: FlowResult) => void): ClientUnaryCall;
1430
1606
  searchFlows(request: SearchFlowsRequest, callback: (error: ServiceError | null, response: SearchFlowsResponse) => void): ClientUnaryCall;
1431
1607
  searchFlows(request: SearchFlowsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SearchFlowsResponse) => void): ClientUnaryCall;
1432
1608
  searchFlows(request: SearchFlowsRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SearchFlowsResponse) => void): ClientUnaryCall;