@fluidgrids/workflows 2026.1028.2 → 2026.1030.1
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/README.md +181 -11
- package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
- package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
- package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
- package/dist/chunk-3U2NU7YC.cjs +124 -0
- package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
- package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
- package/dist/chunk-5HIVIV53.js +330 -0
- package/dist/chunk-5MFVJM76.js +1222 -0
- package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
- package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
- package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
- package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
- package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
- package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
- package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
- package/dist/chunk-C4F5KJTI.js +293 -0
- package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
- package/dist/chunk-GEQDGUGB.cjs +2719 -0
- package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
- package/dist/chunk-HMZUGSMU.cjs +1554 -0
- package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
- package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
- package/dist/chunk-JSC75O5C.cjs +167 -0
- package/dist/chunk-M272AHEX.js +25 -0
- package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
- package/dist/chunk-ODZ2IAR2.cjs +1247 -0
- package/dist/chunk-Q4MWQNJK.cjs +28 -0
- package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
- package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
- package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
- package/dist/chunk-VA4OFR72.cjs +324 -0
- package/dist/chunk-VU5S5A7V.js +150 -0
- package/dist/chunk-YEHR4NNE.js +1522 -0
- package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
- package/dist/codegen/index.d.cts +2 -2
- package/dist/codegen/index.d.ts +2 -2
- package/dist/collect-6NIEufHd.d.ts +103 -0
- package/dist/collect-CcTCKqx6.d.cts +103 -0
- package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
- package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
- package/dist/history/index.cjs +375 -86
- package/dist/history/index.d.cts +590 -12
- package/dist/history/index.d.ts +590 -12
- package/dist/history/index.js +50 -4
- package/dist/index.cjs +156 -50
- package/dist/index.d.cts +38 -58
- package/dist/index.d.ts +38 -58
- package/dist/index.js +6 -4
- package/dist/interceptors-CNcr2dlk.d.ts +159 -0
- package/dist/interceptors-CqkNZVfI.d.cts +159 -0
- package/dist/ir/index.cjs +362 -38
- package/dist/ir/index.d.cts +282 -7
- package/dist/ir/index.d.ts +282 -7
- package/dist/ir/index.js +329 -23
- package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
- package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
- package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
- package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
- package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
- package/dist/node-evaluator-LEEVD7H7.js +14 -0
- package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
- package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
- package/dist/quickjs/index.cjs +28 -27
- package/dist/quickjs/index.d.cts +6 -6
- package/dist/quickjs/index.d.ts +6 -6
- package/dist/quickjs/index.js +10 -9
- package/dist/roundtrip/index.cjs +259 -51
- package/dist/roundtrip/index.d.cts +100 -9
- package/dist/roundtrip/index.d.ts +100 -9
- package/dist/roundtrip/index.js +177 -11
- package/dist/runtime/index.cjs +21 -20
- package/dist/runtime/index.d.cts +184 -15
- package/dist/runtime/index.d.ts +184 -15
- package/dist/runtime/index.js +8 -7
- package/dist/testing/index.cjs +1122 -115
- package/dist/testing/index.d.cts +294 -13
- package/dist/testing/index.d.ts +294 -13
- package/dist/testing/index.js +1086 -84
- package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
- package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
- package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
- package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
- package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
- package/dist/workflow-BGnv8SS6.d.ts +803 -0
- package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
- package/dist/workflow-DS32Gtws.d.cts +803 -0
- package/fixtures/histories/activity-options-updated.history.json +159 -0
- package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
- package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
- package/fixtures/histories/benign-failure.history.json +146 -0
- package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
- package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
- package/fixtures/histories/child-options-roundtrip.history.json +192 -0
- package/fixtures/histories/codec-opaque.history.json +229 -0
- package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
- package/fixtures/histories/continue-as-new-options.history.json +99 -0
- package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
- package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
- package/fixtures/histories/dynamic-workflow.history.json +150 -0
- package/fixtures/histories/execution-timeout-chain.history.json +98 -0
- package/fixtures/histories/external-cancel-resolved.history.json +123 -0
- package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
- package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
- package/fixtures/histories/handler-drain-warn.history.json +222 -0
- package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
- package/fixtures/histories/interceptor-headers.history.json +339 -0
- package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
- package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
- package/fixtures/histories/local-activity-completed.history.json +157 -0
- package/fixtures/histories/local-activity-failed.history.json +93 -0
- package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
- package/fixtures/histories/query-custom.history.json +213 -0
- package/fixtures/histories/query-default-handler.history.json +120 -0
- package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
- package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
- package/fixtures/histories/run-retry-last-failure.history.json +90 -0
- package/fixtures/histories/run-timeout.history.json +159 -0
- package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
- package/fixtures/histories/search-attributes-upserted.history.json +177 -0
- package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
- package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
- package/fixtures/histories/update-accepted-completed.history.json +45 -30
- package/fixtures/histories/update-default-handler.history.json +246 -0
- package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
- package/fixtures/histories/update-not-handled.history.json +138 -0
- package/fixtures/histories/update-rejected-no-event.history.json +190 -0
- package/fixtures/histories/update-with-start-admitted.history.json +150 -0
- package/fixtures/histories/user-activity-cancel.history.json +149 -0
- package/fixtures/histories/user-activity-retry.history.json +143 -0
- package/fixtures/histories/user-activity.history.json +149 -0
- package/package.json +1 -1
- package/schema/bridge-v2.schema.json +1062 -0
- package/schema/history-file.schema.json +538 -83
- package/schema/ir-v2.schema.json +290 -0
- package/schema/payload-fields.json +162 -0
- package/schema/run-event.schema.json +503 -82
- package/schema/workflow-command.schema.json +372 -69
- package/schema/workflow-task.schema.json +924 -171
- package/dist/assemble-BLqQ8lSu.d.cts +0 -39
- package/dist/assemble-DWgaXHd-.d.ts +0 -39
- package/dist/chunk-DHTLALBL.cjs +0 -80
- package/dist/chunk-DJYMDLV5.js +0 -227
- package/dist/chunk-I5LR3D2K.js +0 -869
- package/dist/chunk-M4BBAERY.cjs +0 -1635
- package/dist/chunk-N23SKIG4.js +0 -73
- package/dist/chunk-PZCVF76Q.cjs +0 -868
- package/dist/chunk-QQ6ULXHI.cjs +0 -885
- package/dist/chunk-UK3WM7YZ.cjs +0 -75
- package/dist/chunk-VOKMAAJP.js +0 -848
- package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
- package/dist/node-evaluator-SX4LEYQC.js +0 -12
- package/dist/workflow-C2a05WUJ.d.ts +0 -444
- package/dist/workflow-J-yYixny.d.cts +0 -444
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as JsonObject, E as ErrorType, a as Json } from './types-
|
|
1
|
+
import { J as JsonObject, E as ErrorType, a as Json } from './types-V7jEEUaL.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The durable-function history contract (PLAN-B C-HIST, C-CMD, C-ABI):
|
|
@@ -13,6 +13,25 @@ import { J as JsonObject, E as ErrorType, a as Json } from './types-BGoPzgcl.js'
|
|
|
13
13
|
|
|
14
14
|
/** Version of the runtime ABI and of the history file format. */
|
|
15
15
|
declare const HISTORY_PROTOCOL = 1;
|
|
16
|
+
/**
|
|
17
|
+
* The runtime compatibility release of this SDK (the runtime train of
|
|
18
|
+
* PLAN-B19 critique 4.5). R1 is the Phase B core runtime; R2 adds local
|
|
19
|
+
* activities, handler drain, run handles by workflow id and the R2 history
|
|
20
|
+
* fields. Release 3 (Phase C, C-R1) adds updates, custom and default queries,
|
|
21
|
+
* dynamic workflows, user activities, search attributes, interceptors with
|
|
22
|
+
* header propagation and sinks. A history recorded by release N replays under
|
|
23
|
+
* every release >= N; the service and the workers pin the release whose
|
|
24
|
+
* histories they accept.
|
|
25
|
+
*/
|
|
26
|
+
declare const RUNTIME_RELEASE = 3;
|
|
27
|
+
/**
|
|
28
|
+
* What the runtime of this release can answer (C-ABI-H, reported as
|
|
29
|
+
* `FluidgridsRuntimeAbi.capabilities`). A bundle built before C-R1 reports no
|
|
30
|
+
* capabilities, and the service refuses updates and custom queries for it
|
|
31
|
+
* (DC4) instead of delivering requests the bundle would ignore.
|
|
32
|
+
*/
|
|
33
|
+
declare const RUNTIME_CAPABILITIES: readonly ["updates", "queries", "dynamic"];
|
|
34
|
+
type RuntimeCapability = (typeof RUNTIME_CAPABILITIES)[number];
|
|
16
35
|
/** Every value of the `type` column of `workflow_run_events`, UPPER_SNAKE (DB4). */
|
|
17
36
|
declare const EVENT_TYPES: readonly ["WORKFLOW_STARTED", "WORKFLOW_TASK_SCHEDULED", "WORKFLOW_TASK_STARTED", "WORKFLOW_TASK_COMPLETED", "WORKFLOW_TASK_FAILED", "WORKFLOW_TASK_TIMED_OUT", "ACTIVITY_SCHEDULED", "ACTIVITY_STARTED", "ACTIVITY_HEARTBEAT", "ACTIVITY_COMPLETED", "ACTIVITY_FAILED", "ACTIVITY_TIMED_OUT", "ACTIVITY_CANCEL_REQUESTED", "ACTIVITY_CANCELLED", "ACTIVITY_PAUSED", "ACTIVITY_UNPAUSED", "ACTIVITY_RESET", "ACTIVITY_OPTIONS_UPDATED", "TIMER_STARTED", "TIMER_FIRED", "TIMER_CANCELLED", "SIGNAL_RECEIVED", "UPDATE_ADMITTED", "UPDATE_ACCEPTED", "UPDATE_COMPLETED", "CHILD_RUN_INITIATED", "CHILD_RUN_STARTED", "CHILD_RUN_COMPLETED", "CHILD_RUN_FAILED", "CHILD_RUN_CANCELLED", "CHILD_RUN_TERMINATED", "CHILD_RUN_TIMED_OUT", "EXTERNAL_RUN_CANCEL_REQUESTED", "EXTERNAL_RUN_CANCEL_RESOLVED", "EXTERNAL_RUN_SIGNALED", "SIDE_EFFECT_RECORDED", "LOCAL_ACTIVITY_COMPLETED", "LOCAL_ACTIVITY_FAILED", "SEARCH_ATTRIBUTES_UPSERTED", "CONTEXT_UPSERTED", "MARKER_RECORDED", "WORKFLOW_CANCEL_REQUESTED", "WORKFLOW_RESET", "VERSIONING_OVERRIDE_SET", "WORKFLOW_COMPLETED", "WORKFLOW_FAILED", "WORKFLOW_CANCELLED", "WORKFLOW_TERMINATED", "WORKFLOW_TIMED_OUT", "WORKFLOW_CONTINUED_AS_NEW"];
|
|
18
37
|
type RunEventType = (typeof EVENT_TYPES)[number];
|
|
@@ -23,7 +42,11 @@ type CommandType = (typeof COMMAND_TYPES)[number];
|
|
|
23
42
|
declare const PHASE_B_CORE_COMMANDS: ReadonlySet<CommandType>;
|
|
24
43
|
/** Commands of the Phase B parity releases (defined now, enabled by the service per release). */
|
|
25
44
|
declare const PHASE_B_PARITY_COMMANDS: ReadonlySet<CommandType>;
|
|
26
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Commands of Phase C. They were refused throughout Phase B; from C-R1 the
|
|
47
|
+
* C-GATE feature set decides (`c.updates`, `c.searchAttributes`), and the
|
|
48
|
+
* deprecated release levels of `isCommandEnabled` still refuse them.
|
|
49
|
+
*/
|
|
27
50
|
declare const PHASE_C_COMMANDS: ReadonlySet<CommandType>;
|
|
28
51
|
/** Commands that end the run; one may appear, and only last in a batch. */
|
|
29
52
|
declare const TERMINAL_COMMANDS: ReadonlySet<CommandType>;
|
|
@@ -106,7 +129,11 @@ type Headers = Record<string, string>;
|
|
|
106
129
|
interface CommandBase {
|
|
107
130
|
headers?: Headers;
|
|
108
131
|
}
|
|
109
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Signal and cancel targets. `workflowKey`/`workflowId` addressing is parity
|
|
134
|
+
* (11 §2.1): it reaches the open run of that business id, following the
|
|
135
|
+
* continue-as-new chain; `firstRunId` pins the chain whose first run it names.
|
|
136
|
+
*/
|
|
110
137
|
type RunTarget = {
|
|
111
138
|
runId: string;
|
|
112
139
|
} | {
|
|
@@ -116,16 +143,63 @@ type RunTarget = {
|
|
|
116
143
|
} | {
|
|
117
144
|
workflowKey: string;
|
|
118
145
|
workflowId: string;
|
|
146
|
+
firstRunId?: string;
|
|
119
147
|
};
|
|
120
|
-
|
|
148
|
+
/** `idReusePolicy` of a start (11 §2.1): what a closed run with the same workflow id allows. */
|
|
149
|
+
declare const WORKFLOW_ID_REUSE_POLICIES: readonly ["ALLOW_DUPLICATE", "ALLOW_DUPLICATE_FAILED_ONLY", "REJECT_DUPLICATE"];
|
|
150
|
+
type WorkflowIdReusePolicy = (typeof WORKFLOW_ID_REUSE_POLICIES)[number];
|
|
151
|
+
/** `idConflictPolicy` of a start (11 §2.1): what an open run with the same workflow id does. */
|
|
152
|
+
declare const WORKFLOW_ID_CONFLICT_POLICIES: readonly ["FAIL", "USE_EXISTING", "TERMINATE_EXISTING"];
|
|
153
|
+
type WorkflowIdConflictPolicy = (typeof WORKFLOW_ID_CONFLICT_POLICIES)[number];
|
|
154
|
+
/** `versioningBehavior` of a version or a run (11 §2.27). */
|
|
155
|
+
declare const VERSIONING_BEHAVIORS: readonly ["PINNED", "AUTO_UPGRADE"];
|
|
156
|
+
type VersioningBehavior = (typeof VERSIONING_BEHAVIORS)[number];
|
|
157
|
+
/** `timeoutType` of `WORKFLOW_TIMED_OUT` and `CHILD_RUN_TIMED_OUT` (11 §2.20). */
|
|
158
|
+
declare const WORKFLOW_TIMEOUT_TYPES: readonly ["WORKFLOW_RUN", "WORKFLOW_EXECUTION"];
|
|
159
|
+
type WorkflowTimeoutType = (typeof WORKFLOW_TIMEOUT_TYPES)[number];
|
|
160
|
+
/**
|
|
161
|
+
* The run-level retry policy of a DURABLE_FN run (11 §2.17), in milliseconds.
|
|
162
|
+
* A run that fails with a retryable failure, or whose run timeout expires,
|
|
163
|
+
* is started again as a new run of the same chain, up to `maxAttempts`
|
|
164
|
+
* attempts in total (absent: unlimited, bounded by the execution timeout).
|
|
165
|
+
*/
|
|
166
|
+
interface RunRetryPolicy {
|
|
167
|
+
maxAttempts?: number;
|
|
168
|
+
/** Delay before the second attempt. */
|
|
169
|
+
initialDelayMs: number;
|
|
170
|
+
backoffMultiplier?: number;
|
|
171
|
+
maxDelayMs?: number;
|
|
172
|
+
/** Allow-list on `errorType`. */
|
|
173
|
+
retryOnErrorTypes?: ErrorType[];
|
|
174
|
+
/** Deny-list on the free-form `Failure.type`; wins over the allow-list. */
|
|
175
|
+
nonRetryableErrorTypes?: string[];
|
|
176
|
+
}
|
|
177
|
+
/** The three workflow timeouts of a run (11 §2.20), in milliseconds. */
|
|
178
|
+
interface WorkflowTimeouts {
|
|
179
|
+
executionTimeout?: number;
|
|
180
|
+
runTimeout?: number;
|
|
181
|
+
workflowTaskTimeout?: number;
|
|
182
|
+
}
|
|
183
|
+
/** The longest fairness key (11 §2.11). */
|
|
184
|
+
declare const FAIRNESS_KEY_MAX_LENGTH = 255;
|
|
185
|
+
/** The range of a fairness weight (11 §2.11); the default is 1. */
|
|
186
|
+
declare const FAIRNESS_WEIGHT_MIN = 0.1;
|
|
187
|
+
declare const FAIRNESS_WEIGHT_MAX = 10;
|
|
188
|
+
/** The name of a user activity (C-CMD-C). */
|
|
189
|
+
declare const ACTIVITY_NAME_PATTERN = "^[A-Za-z_][A-Za-z0-9_.-]{0,127}$";
|
|
190
|
+
/** The name of a task queue (C-CMD-C); `managed` is the platform's queue. */
|
|
191
|
+
declare const TASK_QUEUE_NAME_PATTERN = "^[a-z0-9][a-z0-9-]{0,62}$";
|
|
192
|
+
/** At most this many connections a user activity may name. */
|
|
193
|
+
declare const MAX_ACTIVITY_CONNECTIONS = 16;
|
|
194
|
+
/** UTF-8 bytes of the JSON of a command's `headers` map, at most. */
|
|
195
|
+
declare const MAX_HEADERS_BYTES: number;
|
|
196
|
+
/** At most this many sink calls one workflow task reports. */
|
|
197
|
+
declare const MAX_SINK_CALLS = 256;
|
|
198
|
+
/** What both kinds of `SCHEDULE_ACTIVITY` carry. */
|
|
199
|
+
interface ScheduleActivityBase extends CommandBase {
|
|
121
200
|
type: 'SCHEDULE_ACTIVITY';
|
|
122
201
|
activityId: string;
|
|
123
|
-
kind: 'node';
|
|
124
|
-
nodeType: string;
|
|
125
|
-
nodeVersion?: string;
|
|
126
|
-
operation: string;
|
|
127
202
|
args: Json;
|
|
128
|
-
connection?: string;
|
|
129
203
|
retry: RetryPolicy;
|
|
130
204
|
startToCloseTimeout?: number;
|
|
131
205
|
scheduleToCloseTimeout?: number;
|
|
@@ -134,8 +208,34 @@ interface ScheduleActivityCommand extends CommandBase {
|
|
|
134
208
|
cancellationType?: ActivityCancellationType;
|
|
135
209
|
priority?: number;
|
|
136
210
|
summary?: string;
|
|
211
|
+
/** Fairness within the queue (11 §2.11, Phase C); default the workspace id. */
|
|
212
|
+
fairnessKey?: string;
|
|
213
|
+
/** 0.1 to 10; default 1. */
|
|
214
|
+
fairnessWeight?: number;
|
|
215
|
+
}
|
|
216
|
+
/** A canvas node operation run as an activity (`ctx.run`). */
|
|
217
|
+
interface ScheduleNodeActivityCommand extends ScheduleActivityBase {
|
|
218
|
+
kind: 'node';
|
|
219
|
+
nodeType: string;
|
|
220
|
+
nodeVersion?: string;
|
|
221
|
+
operation: string;
|
|
222
|
+
connection?: string;
|
|
137
223
|
runOn?: string;
|
|
138
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* A user activity (`ctx.activity`, Phase C, C-CMD-C): a function a
|
|
227
|
+
* self-hosted worker polling `taskQueue` implements. It has no node type,
|
|
228
|
+
* operation or `runOn`.
|
|
229
|
+
*/
|
|
230
|
+
interface ScheduleUserActivityCommand extends ScheduleActivityBase {
|
|
231
|
+
kind: 'user';
|
|
232
|
+
activityName: string;
|
|
233
|
+
taskQueue: string;
|
|
234
|
+
/** Connection names the worker may resolve per attempt (H2), at most 16. */
|
|
235
|
+
connections?: string[];
|
|
236
|
+
}
|
|
237
|
+
/** `SCHEDULE_ACTIVITY`, a `oneOf` on `kind` (C-CMD-C). */
|
|
238
|
+
type ScheduleActivityCommand = ScheduleNodeActivityCommand | ScheduleUserActivityCommand;
|
|
139
239
|
interface RequestCancelActivityCommand extends CommandBase {
|
|
140
240
|
type: 'REQUEST_CANCEL_ACTIVITY';
|
|
141
241
|
activityId: string;
|
|
@@ -164,7 +264,15 @@ interface ChildRunOptions {
|
|
|
164
264
|
runTimeout?: number;
|
|
165
265
|
workflowTaskTimeout?: number;
|
|
166
266
|
startDelay?: number;
|
|
167
|
-
|
|
267
|
+
/** Run-level retry of the child (11 §2.17). */
|
|
268
|
+
retry?: RunRetryPolicy;
|
|
269
|
+
versioningBehavior?: VersioningBehavior;
|
|
270
|
+
idReusePolicy?: WorkflowIdReusePolicy;
|
|
271
|
+
idConflictPolicy?: WorkflowIdConflictPolicy;
|
|
272
|
+
/** Fairness of the child's tasks (11 §2.11, Phase C); inherited by default. */
|
|
273
|
+
fairnessKey?: string;
|
|
274
|
+
fairnessWeight?: number;
|
|
275
|
+
[key: string]: Json | RunRetryPolicy | undefined;
|
|
168
276
|
}
|
|
169
277
|
interface StartChildRunCommand extends CommandBase {
|
|
170
278
|
type: 'START_CHILD_RUN';
|
|
@@ -216,6 +324,10 @@ interface RecordLocalActivityCommand extends CommandBase {
|
|
|
216
324
|
result?: Json;
|
|
217
325
|
failure?: Failure;
|
|
218
326
|
attempts: number;
|
|
327
|
+
/** The node operation that ran (R2), for the History tab and replay matching. */
|
|
328
|
+
nodeType?: string;
|
|
329
|
+
operation?: string;
|
|
330
|
+
summary?: string;
|
|
219
331
|
}
|
|
220
332
|
interface ContinueAsNewCommand extends CommandBase {
|
|
221
333
|
type: 'CONTINUE_AS_NEW';
|
|
@@ -258,15 +370,28 @@ declare const DEFAULT_HISTORY_LIMIT: HistoryLimit;
|
|
|
258
370
|
declare const CONTINUE_AS_NEW_SUGGESTED_RATIO = 0.8;
|
|
259
371
|
/** Fraction of the cap at which the next command throws `HistoryLimitExceeded`. */
|
|
260
372
|
declare const HISTORY_LIMIT_EXCEEDED_RATIO = 0.95;
|
|
261
|
-
/**
|
|
373
|
+
/**
|
|
374
|
+
* What a task knows about its run (C-ABI `WorkflowInfoSnapshot`). From SDK R2
|
|
375
|
+
* the runtime reads `workflowId`, `runAttempt`, `lastResult`, `lastFailure`,
|
|
376
|
+
* `summary`, `details`, the memo (`context`), the timeouts, `retry`,
|
|
377
|
+
* `priority` and `versioningBehavior` from `WORKFLOW_STARTED` when the event
|
|
378
|
+
* carries them, so a replay sees what the first execution saw; the lease
|
|
379
|
+
* values here are the fallback for histories written before R2.
|
|
380
|
+
*/
|
|
262
381
|
interface WorkflowInfoSnapshot {
|
|
263
382
|
runId: string;
|
|
264
383
|
workspaceId: string;
|
|
265
384
|
workflowKey?: string;
|
|
266
385
|
version?: number | string;
|
|
267
386
|
buildId?: string;
|
|
387
|
+
/** The column name of the workflow id (11 §2.1). */
|
|
268
388
|
businessId?: string;
|
|
389
|
+
/** The caller-chosen workflow id (`businessId`), else the first run's id. */
|
|
390
|
+
workflowId?: string;
|
|
391
|
+
/** Run-level retry attempt, 1-based (same value as `runAttempt`). */
|
|
269
392
|
attempt?: number;
|
|
393
|
+
/** Run-level retry attempt, 1-based (11 §2.17). */
|
|
394
|
+
runAttempt?: number;
|
|
270
395
|
taskQueue?: string;
|
|
271
396
|
parentRunId?: string | null;
|
|
272
397
|
rootRunId?: string | null;
|
|
@@ -286,11 +411,58 @@ interface WorkflowInfoSnapshot {
|
|
|
286
411
|
priority?: number;
|
|
287
412
|
summary?: string;
|
|
288
413
|
details?: string;
|
|
414
|
+
/** The run's memo (11 §2.22); `memo` is the same value under its Temporal name. */
|
|
289
415
|
context?: JsonObject;
|
|
416
|
+
memo?: JsonObject;
|
|
417
|
+
versioningBehavior?: VersioningBehavior;
|
|
418
|
+
/** The run-level retry policy of the chain. */
|
|
419
|
+
retry?: RunRetryPolicy;
|
|
420
|
+
/** The run's search attributes at the start (11 §2.8, Phase C). */
|
|
421
|
+
searchAttributes?: JsonObject;
|
|
422
|
+
/** Fairness of the run's tasks (11 §2.11, Phase C). */
|
|
423
|
+
fairnessKey?: string;
|
|
424
|
+
fairnessWeight?: number;
|
|
290
425
|
}
|
|
291
|
-
/** A built-in query (11 §2.21)
|
|
426
|
+
/** A built-in query (11 §2.21); any other name is a custom query (Phase C). */
|
|
292
427
|
type BuiltInQueryName = '__stack_trace' | '__enhanced_stack_trace' | '__metadata';
|
|
293
428
|
declare const BUILT_IN_QUERIES: readonly BuiltInQueryName[];
|
|
429
|
+
/**
|
|
430
|
+
* A pending update the lease delivers to a workflow task (C-ABI-H). The
|
|
431
|
+
* request is not in history until the task accepts it (`UPDATE_ACCEPTED`);
|
|
432
|
+
* `admitted` marks one that history already holds as `UPDATE_ADMITTED`
|
|
433
|
+
* (update-with-start, reset re-application), which the runtime delivers from
|
|
434
|
+
* that event instead.
|
|
435
|
+
*/
|
|
436
|
+
interface UpdateRequest {
|
|
437
|
+
updateId: string;
|
|
438
|
+
name: string;
|
|
439
|
+
args?: Json;
|
|
440
|
+
admitted?: boolean;
|
|
441
|
+
headers?: Headers;
|
|
442
|
+
}
|
|
443
|
+
/** A query a task answers (11 §2.21). Built-in names need no handler. */
|
|
444
|
+
interface QueryRequest {
|
|
445
|
+
queryId: string;
|
|
446
|
+
name: string;
|
|
447
|
+
args?: Json;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* The answer to one query. `rejected` means no handler took the name (the
|
|
451
|
+
* service answers `VALIDATION`); `error` without `rejected` means the handler
|
|
452
|
+
* threw or the replay failed.
|
|
453
|
+
*/
|
|
454
|
+
interface QueryResult {
|
|
455
|
+
queryId: string;
|
|
456
|
+
value?: Json;
|
|
457
|
+
error?: string;
|
|
458
|
+
rejected?: boolean;
|
|
459
|
+
}
|
|
460
|
+
/** One call workflow code made to a worker-side sink (11 §2.31); never on replay. */
|
|
461
|
+
interface SinkCall {
|
|
462
|
+
sink: string;
|
|
463
|
+
fn: string;
|
|
464
|
+
args: Json[];
|
|
465
|
+
}
|
|
294
466
|
/** The input of one workflow task (C-ABI). */
|
|
295
467
|
interface WorkflowTaskRequest {
|
|
296
468
|
protocol: number;
|
|
@@ -300,27 +472,63 @@ interface WorkflowTaskRequest {
|
|
|
300
472
|
history: RunEventRecord[];
|
|
301
473
|
/** The task's start time; the clock for new side effects only. */
|
|
302
474
|
nowMs: number;
|
|
303
|
-
localActivityResults?:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
475
|
+
localActivityResults?: LocalActivityResult[];
|
|
476
|
+
/** Pending updates the lease delivers (C-ABI-H, Phase C). */
|
|
477
|
+
updates?: UpdateRequest[];
|
|
478
|
+
/** Queries to answer once the history is replayed. */
|
|
479
|
+
queries?: QueryRequest[];
|
|
480
|
+
/**
|
|
481
|
+
* The bundle features (C-FEATURES, the names of `code.features`) the
|
|
482
|
+
* workspace enables for this task, from its flags (Phase C). From C-R1 the
|
|
483
|
+
* runtime reads `interceptors`: a `task` of a bundle that exports
|
|
484
|
+
* interceptors fails with `UNSUPPORTED_COMMAND` unless it is listed, so
|
|
485
|
+
* turning `fluidgrids.run-control` off stops interceptors from running even
|
|
486
|
+
* for a bundle pushed while it was on. Absent means none.
|
|
487
|
+
*/
|
|
488
|
+
features?: string[];
|
|
489
|
+
}
|
|
490
|
+
/** The result of one local activity, as the worker passes it back into the task (C-ABI). */
|
|
491
|
+
interface LocalActivityResult {
|
|
492
|
+
localActivityId: string;
|
|
493
|
+
result?: Json;
|
|
494
|
+
failure?: Failure;
|
|
495
|
+
/** Attempts run so far, the last one included. */
|
|
496
|
+
attempts: number;
|
|
497
|
+
}
|
|
498
|
+
/** The largest `startToCloseTimeout` of a local activity, and its default (11 §2.12). */
|
|
499
|
+
declare const LOCAL_ACTIVITY_MAX_TIMEOUT_MS = 30000;
|
|
500
|
+
/**
|
|
501
|
+
* A local activity the task wants run before it can continue (parity, 11
|
|
502
|
+
* §2.12). The worker runs attempt `attempt` (after waiting `backoffMs` when
|
|
503
|
+
* it is a retry) inside the task's budget, then runs the same task again with
|
|
504
|
+
* the outcome in `localActivityResults`. The runtime decides with
|
|
505
|
+
* `computeRetryDelay` whether a failure is final; a retryable one is
|
|
506
|
+
* requested again with the next attempt. A worker that cannot fit the wait
|
|
507
|
+
* and the attempt into the remaining budget answers with a non-retryable
|
|
508
|
+
* `TIMEOUT` failure of type `LocalActivityBudgetExceeded` instead.
|
|
509
|
+
*/
|
|
316
510
|
interface LocalActivityRequest {
|
|
317
511
|
localActivityId: string;
|
|
512
|
+
kind: 'node';
|
|
318
513
|
nodeType: string;
|
|
514
|
+
nodeVersion?: string;
|
|
319
515
|
operation: string;
|
|
320
516
|
args: Json;
|
|
321
517
|
connection?: string;
|
|
322
|
-
retry
|
|
323
|
-
|
|
518
|
+
retry: RetryPolicy;
|
|
519
|
+
/** Milliseconds; at most {@link LOCAL_ACTIVITY_MAX_TIMEOUT_MS}. */
|
|
520
|
+
startToCloseTimeout: number;
|
|
521
|
+
/** The attempt to run, 1-based. */
|
|
522
|
+
attempt: number;
|
|
523
|
+
/** Milliseconds to wait before this attempt (0 for the first). */
|
|
524
|
+
backoffMs: number;
|
|
525
|
+
summary?: string;
|
|
526
|
+
}
|
|
527
|
+
/** Signal or update handlers still running when the workflow finished (11 §2.18). */
|
|
528
|
+
interface UnfinishedHandler {
|
|
529
|
+
kind: 'signal' | 'update';
|
|
530
|
+
name: string;
|
|
531
|
+
count: number;
|
|
324
532
|
}
|
|
325
533
|
interface TaskLogLine {
|
|
326
534
|
level: 'debug' | 'info' | 'warn' | 'error';
|
|
@@ -333,11 +541,9 @@ interface WorkflowTaskResult {
|
|
|
333
541
|
outcome: 'commands' | 'failed' | 'localActivityRequested';
|
|
334
542
|
commands: WorkflowCommand[];
|
|
335
543
|
localActivityRequests?: LocalActivityRequest[];
|
|
336
|
-
queryResults?:
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
error?: string;
|
|
340
|
-
}>;
|
|
544
|
+
queryResults?: QueryResult[];
|
|
545
|
+
/** Sink calls of the open activation, at most {@link MAX_SINK_CALLS} (Phase C). */
|
|
546
|
+
sinkCalls?: SinkCall[];
|
|
341
547
|
failure?: {
|
|
342
548
|
cause: WorkflowTaskFailureCause;
|
|
343
549
|
message: string;
|
|
@@ -347,6 +553,11 @@ interface WorkflowTaskResult {
|
|
|
347
553
|
};
|
|
348
554
|
logs: TaskLogLine[];
|
|
349
555
|
stackTrace?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Handlers still running when this task's terminal command was issued, with
|
|
558
|
+
* policy `WARN_AND_ABANDON` (R2). Never set on replay.
|
|
559
|
+
*/
|
|
560
|
+
unfinishedHandlers?: UnfinishedHandler[];
|
|
350
561
|
}
|
|
351
562
|
/**
|
|
352
563
|
* The event each command appends (C-CMD). `REJECT_UPDATE` appends nothing: a
|
|
@@ -377,4 +588,4 @@ declare function isCommandEvent(event: {
|
|
|
377
588
|
payload: JsonObject;
|
|
378
589
|
}): boolean;
|
|
379
590
|
|
|
380
|
-
export {
|
|
591
|
+
export { PARENT_CLOSE_POLICIES as $, ACTIVITY_CANCELLATION_TYPES as A, BUILT_IN_QUERIES as B, type ChildCancellationType as C, DEFAULT_HISTORY_LIMIT as D, ERROR_TYPES as E, type Failure as F, FAIRNESS_WEIGHT_MAX as G, FAIRNESS_WEIGHT_MIN as H, type FailWorkflowCommand as I, type FailureSource as J, HISTORY_LIMIT_EXCEEDED_RATIO as K, HISTORY_PROTOCOL as L, type Headers as M, type HistoryLimit as N, INPUT_EVENTS as O, type ParentClosePolicy as P, type QueryResult as Q, type RunEventRecord as R, LOCAL_ACTIVITY_MAX_TIMEOUT_MS as S, type TaskLogLine as T, type UnfinishedHandler as U, type LocalActivityRequest as V, type WorkflowCommand as W, type LocalActivityResult as X, MAX_ACTIVITY_CONNECTIONS as Y, MAX_HEADERS_BYTES as Z, MAX_SINK_CALLS as _, type WorkflowTaskFailureCause as a, PHASE_B_CORE_COMMANDS as a0, PHASE_B_PARITY_COMMANDS as a1, PHASE_C_COMMANDS as a2, RUNTIME_CAPABILITIES as a3, RUNTIME_RELEASE as a4, type RecordLocalActivityCommand as a5, type RecordMarkerCommand as a6, type RecordSideEffectCommand as a7, type RejectUpdateCommand as a8, type RequestCancelActivityCommand as a9, type WorkflowTaskResult as aA, type WorkflowTimeoutType as aB, type WorkflowTimeouts as aC, isCommandEvent as aD, isInputEvent as aE, type RequestCancelExternalRunCommand as aa, type RunEventDraft as ab, type RunEventType as ac, type RunTarget as ad, type RuntimeCapability as ae, type ScheduleActivityCommand as af, type ScheduleNodeActivityCommand as ag, type ScheduleUserActivityCommand as ah, type SignalRunCommand as ai, type SinkCall as aj, type StartChildRunCommand as ak, type StartTimerCommand as al, TASK_FAILURE_CAUSES as am, TASK_QUEUE_NAME_PATTERN as an, TERMINAL_COMMANDS as ao, TERMINAL_EVENTS as ap, type UpsertContextCommand as aq, type UpsertSearchAttributesCommand as ar, VERSIONING_BEHAVIORS as as, type VersioningBehavior as at, WORKFLOW_ID_CONFLICT_POLICIES as au, WORKFLOW_ID_REUSE_POLICIES as av, WORKFLOW_TIMEOUT_TYPES as aw, type WorkflowIdConflictPolicy as ax, type WorkflowIdReusePolicy as ay, type WorkflowTaskRequest as az, type WorkflowInfoSnapshot as b, type UpdateRequest as c, type QueryRequest as d, type RetryPolicy as e, type RunRetryPolicy as f, ACTIVITY_NAME_PATTERN as g, type AcceptUpdateCommand as h, type ActivityCancellationType as i, type BuiltInQueryName as j, CHILD_CANCELLATION_TYPES as k, COMMAND_EVENTS as l, COMMAND_EVENT_TYPES as m, COMMAND_TYPES as n, CONTINUE_AS_NEW_SUGGESTED_RATIO as o, type CancelTimerCommand as p, type CancelWorkflowCommand as q, type ChildRunOptions as r, type CommandType as s, type CompleteUpdateCommand as t, type CompleteWorkflowCommand as u, type ContinueAsNewCommand as v, EVENT_TYPES as w, EXECUTION_KINDS as x, type ExecutionKind as y, FAIRNESS_KEY_MAX_LENGTH as z };
|