You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The optional `start()` method initializes any background tasks needed by your World (e.g., queue polling).
43
+
The optional `start()` method initializes background tasks (for example, queue polling). The optional `close()` method releases resources like connection pools and listeners. The optional `getEncryptionKeyForRun()` method returns the AES-256 key used to encrypt data for a run; if it is not implemented, encryption is disabled.
41
44
42
45
## The Event Log Model
43
46
@@ -63,8 +66,8 @@ interface Storage {
63
66
};
64
67
65
68
events: {
66
-
// Create a new workflow run (runId must be null - server generates it)
2. Atomically update the affected entity (run, step, or hook)
89
92
3. Return both the created event and the updated entity
90
93
91
-
**Run Creation:** For `run_created` events, the `runId` parameter is `null`. Your World generates and returns a new `runId`.
94
+
**Run Creation:** For `run_created` events, the `runId` parameter may be a client-provided string or `null`. When `null`, your World generates and returns a new `runId`.
92
95
93
96
**Hook Tokens:** Hook tokens must be unique. If a `hook_created` event conflicts with an existing token, return a `hook_conflict` event instead.
94
97
@@ -165,13 +168,19 @@ The Streamer interface enables real-time data streaming:
165
168
interfaceStreamer {
166
169
writeToStream(
167
170
name:string,
168
-
runId:string|Promise<string>,
171
+
runId:string,
169
172
chunk:string|Uint8Array
170
173
):Promise<void>;
171
174
175
+
writeToStreamMulti?(
176
+
name:string,
177
+
runId:string,
178
+
chunks: (string|Uint8Array)[]
179
+
):Promise<void>;
180
+
172
181
closeStream(
173
182
name:string,
174
-
runId:string|Promise<string>
183
+
runId:string
175
184
):Promise<void>;
176
185
177
186
readFromStream(
@@ -202,6 +211,7 @@ interface Streamer {
202
211
```
203
212
204
213
Streams are identified by a combination of `runId` and `name`. Each workflow run can have multiple named streams.
214
+
`writeToStreamMulti()` is an optional optimization for batching multiple writes.
205
215
206
216
`getStreamChunks` returns a paginated snapshot of currently available chunks (unlike `readFromStream` which returns a live `ReadableStream` that waits for new chunks). `getStreamInfo` returns the tail index (last chunk index, 0-based, or `-1` when empty) and whether the stream is complete — useful for resolving negative `startIndex` values into absolute positions.
Copy file name to clipboardExpand all lines: docs/content/docs/observability/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Workflow DevKit provides powerful tools to inspect, monitor, and debug your work
18
18
npx workflow
19
19
```
20
20
21
-
The CLI comes pre-installed with the Workflow DevKit and registers the `workflow` command. If the `workflow` package is not already installed, `npx workflow` will install it globally, or use the local installed version if available.
21
+
The CLI comes pre-installed with the Workflow DevKit and registers the `workflow` command. If the `workflow` package is not already installed, `npx workflow` will download and run the CLI temporarily, or use the local installed version if available.
0 commit comments