Releases: VoltAgent/voltagent
@voltagent/core@2.6.1
Patch Changes
-
#1103
edd7181Thanks @omeraplak! - fix: preserve getter-basedfullStreamtee behavior after startup probing instreamText/streamObjectThis prevents
TypeError [ERR_INVALID_STATE]: Invalid state: ReadableStream is lockedwhen SDK consumers iterateresult.fullStreamwhile other result accessors (such asresult.textor UI stream helpers) are also consuming the stream.
@voltagent/core@2.6.0
Minor Changes
-
#1100
314ed40Thanks @omeraplak! - feat: add workflow observer/watch APIs for stream resultsWhat's New
- Added run-level observer APIs on
WorkflowStreamResult:watch(cb)watchAsync(cb)observeStream()streamLegacy()
- These APIs are now available on:
workflow.stream(...)workflow.timeTravelStream(...)- resumed stream results returned from
.resume(...)
- Added test coverage for event ordering, unsubscribe behavior, multiple watchers, callback isolation, and
observeStream()close semantics.
SDK Example
const stream = workflow.stream({ value: 3 }); const unwatch = stream.watch((event) => { console.log("[watch]", event.type, event.from); }); const unwatchAsync = await stream.watchAsync(async (event) => { if (event.type === "workflow-error") { await notifyOps(event); } }); const reader = stream.observeStream().getReader(); const observerTask = (async () => { while (true) { const { done, value } = await reader.read(); if (done) break; console.log("[observeStream]", value.type); } })(); for await (const event of stream) { console.log("[main iterator]", event.type); } unwatch(); unwatchAsync(); await observerTask; const state = await stream.streamLegacy().getWorkflowState(); console.log("final status:", state?.status);
Time Travel Stream Example
const replayStream = workflow.timeTravelStream({ executionId: sourceExecutionId, stepId: "step-approval", }); const stopReplayWatch = replayStream.watch((event) => { console.log("[replay]", event.type, event.from); }); for await (const event of replayStream) { console.log("[replay iterator]", event.type); } stopReplayWatch();
- Added run-level observer APIs on
-
#1102
7f923d2Thanks @omeraplak! - feat: add workflow execution primitives (bail,abort,getStepResult,getInitData)What's New
Step execution context now includes four new primitives:
bail(result?): complete the workflow early with a custom final resultabort(): cancel the workflow immediatelygetStepResult(stepId): get a prior step output directly (returnsnullif not available)getInitData(): get the original workflow input (stable across resume paths)
These primitives are available in all step contexts, including nested step flows.
Example: Early Complete with
bailconst workflow = createWorkflowChain({ id: "bail-demo", input: z.object({ amount: z.number() }), result: z.object({ status: z.string() }), }) .andThen({ id: "risk-check", execute: async ({ data, bail }) => { if (data.amount > 10_000) { bail({ status: "rejected" }); } return { status: "approved" }; }, }) .andThen({ id: "never-runs-on-bail", execute: async () => ({ status: "approved" }), });
Example: Cancel with
abortconst workflow = createWorkflowChain({ id: "abort-demo", input: z.object({ requestId: z.string() }), result: z.object({ done: z.boolean() }), }) .andThen({ id: "authorization", execute: async ({ abort }) => { abort(); // terminal status: cancelled }, }) .andThen({ id: "never-runs-on-abort", execute: async () => ({ done: true }), });
Example: Use
getStepResult+getInitDataconst workflow = createWorkflowChain({ id: "introspection-demo", input: z.object({ userId: z.string(), value: z.number() }), result: z.object({ total: z.number(), userId: z.string() }), }) .andThen({ id: "step-1", execute: async ({ data }) => ({ partial: data.value + 1 }), }) .andThen({ id: "step-2", execute: async ({ getStepResult, getInitData }) => { const s1 = getStepResult<{ partial: number }>("step-1"); const init = getInitData(); return { total: (s1?.partial ?? 0) + init.value, userId: init.userId, }; }, });
@voltagent/server-core@2.1.8
@voltagent/core@2.5.0
Minor Changes
-
#1097
e15bb6eThanks @omeraplak! - AddstartAsync()to workflow and workflow chain APIs for fire-and-forget execution.startAsync()starts a workflow run in the background and returns{ executionId, workflowId, startAt }immediately. The run keeps existing execution semantics, respects providedexecutionId, and persists terminal states in memory for later inspection.Also adds workflow documentation updates with
startAsync()usage examples in the workflow overview and streaming docs. -
#1099
160e60bThanks @omeraplak! - Add workflow time-travel and deterministic replay APIs.New APIs:
workflow.timeTravel(options)workflow.timeTravelStream(options)workflowChain.timeTravel(options)workflowChain.timeTravelStream(options)
timeTravelreplays a historical execution from a selected step with a new execution ID, preserving the original execution history. Replay runs can optionally override selected-step input (inputData), resume payload (resumeData), and shared workflow state (workflowStateOverride).Replay lineage metadata is now persisted on workflow state records:
replayedFromExecutionIdreplayFromStepId
New public type exports from
@voltagent/coreincludeWorkflowTimeTravelOptions.Also adds workflow documentation and usage examples for deterministic replay in overview, suspend/resume, and streaming docs.
Adds REST API documentation for replay endpoint
POST /workflows/:id/executions/:executionId/replay, including request/response details and both cURL and JavaScript (fetch) code examples for default replay and replay with overrides (inputData,resumeData,workflowStateOverride). -
#1098
b610ec6Thanks @omeraplak! - Add workflow restart and crash-recovery APIs.New APIs:
workflow.restart(executionId, options?)workflow.restartAllActive()workflowChain.restart(executionId, options?)workflowChain.restartAllActive()WorkflowRegistry.restartWorkflowExecution(workflowId, executionId, options?)WorkflowRegistry.restartAllActiveWorkflowRuns(options?)
The workflow runtime now persists running checkpoints during execution, including step progress, shared workflow state, context, and usage snapshots, so interrupted runs in
runningstate can be recovered deterministically.New public types are now exported from
@voltagent/corefor consumer annotations, includingWorkflowRestartAllResultandWorkflowRestartCheckpoint.Also adds docs for restart/crash-recovery usage under workflow overview and suspend/resume docs.
@voltagent/supabase@2.1.3
Patch Changes
-
#1082
73cf1d3Thanks @omeraplak! - Fix workflow state persistence parity across SQL adapters.This update persists and returns
input,context, and top-levelworkflowStatein workflow state operations. It also ensures suspended workflow state queries includeevents,output, andcancellation, and adds adapter migrations/column additions where needed.
@voltagent/serverless-hono@2.0.9
Patch Changes
-
#1084
95ad610Thanks @omeraplak! - Add stream attach support for in-progress workflow executions.- Add
GET /workflows/:id/executions/:executionId/streamto attach to an active workflow SSE stream. - Add replay support for missed SSE events via
fromSequenceandLast-Event-ID. - Keep
POST /workflows/:id/streambehavior unchanged for starting new executions. - Ensure streamed workflow resume uses a fresh suspend controller so attach clients continue receiving events after resume.
- Add
-
Updated dependencies [
f275daf,95ad610]:- @voltagent/server-core@2.1.7
@voltagent/server-hono@2.0.7
Patch Changes
-
#1084
95ad610Thanks @omeraplak! - Add stream attach support for in-progress workflow executions.- Add
GET /workflows/:id/executions/:executionId/streamto attach to an active workflow SSE stream. - Add replay support for missed SSE events via
fromSequenceandLast-Event-ID. - Keep
POST /workflows/:id/streambehavior unchanged for starting new executions. - Ensure streamed workflow resume uses a fresh suspend controller so attach clients continue receiving events after resume.
- Add
-
Updated dependencies [
f275daf,95ad610]:- @voltagent/core@2.4.4
- @voltagent/server-core@2.1.7
@voltagent/server-elysia@2.0.6
Patch Changes
-
#1084
95ad610Thanks @omeraplak! - Add stream attach support for in-progress workflow executions.- Add
GET /workflows/:id/executions/:executionId/streamto attach to an active workflow SSE stream. - Add replay support for missed SSE events via
fromSequenceandLast-Event-ID. - Keep
POST /workflows/:id/streambehavior unchanged for starting new executions. - Ensure streamed workflow resume uses a fresh suspend controller so attach clients continue receiving events after resume.
- Add
-
Updated dependencies [
f275daf,95ad610]:- @voltagent/core@2.4.4
- @voltagent/server-core@2.1.7
@voltagent/server-core@2.1.7
Patch Changes
-
#1085
f275dafThanks @omeraplak! - Fix workflow execution filtering by persisted metadata across adapters.- Persist
options.metadataon workflow execution state so/workflows/executionsfilters can match tenant/user metadata. - Preserve existing execution metadata when updating cancelled/error workflow states.
- Accept
options.metadatain server workflow execution request schema. - Fix LibSQL and Cloudflare D1 JSON metadata query comparisons for
metadataandmetadata.<key>filters.
- Persist
-
#1084
95ad610Thanks @omeraplak! - Add stream attach support for in-progress workflow executions.- Add
GET /workflows/:id/executions/:executionId/streamto attach to an active workflow SSE stream. - Add replay support for missed SSE events via
fromSequenceandLast-Event-ID. - Keep
POST /workflows/:id/streambehavior unchanged for starting new executions. - Ensure streamed workflow resume uses a fresh suspend controller so attach clients continue receiving events after resume.
- Add
-
Updated dependencies [
f275daf,95ad610]:- @voltagent/core@2.4.4
@voltagent/postgres@2.1.2
Patch Changes
-
#1082
73cf1d3Thanks @omeraplak! - Fix workflow state persistence parity across SQL adapters.This update persists and returns
input,context, and top-levelworkflowStatein workflow state operations. It also ensures suspended workflow state queries includeevents,output, andcancellation, and adds adapter migrations/column additions where needed.