diff --git a/examples/nextjs-flowchart-builder/app/flowchart.tsx b/examples/nextjs-flowchart-builder/app/flowchart.tsx
index 687a601ecc1..f04a4d412f1 100644
--- a/examples/nextjs-flowchart-builder/app/flowchart.tsx
+++ b/examples/nextjs-flowchart-builder/app/flowchart.tsx
@@ -64,6 +64,7 @@ import {
Icon,
} from "@liveblocks/react-ui";
import { HelpControl } from "../components/HelpButton";
+import { VersionsDialog } from "./version-history-dialog";
import {
DndContext,
type DragEndEvent,
@@ -1694,6 +1695,7 @@ function Flow({ className, ...props }: ComponentProps<"div">) {
diff --git a/examples/nextjs-react-flow-ai/app/flowchart/agent/agent.ts b/examples/nextjs-react-flow-ai/app/flowchart/agent/agent.ts
index 9e6be898a76..c3f02271b3c 100644
--- a/examples/nextjs-react-flow-ai/app/flowchart/agent/agent.ts
+++ b/examples/nextjs-react-flow-ai/app/flowchart/agent/agent.ts
@@ -70,6 +70,12 @@ export async function runFlowchartAgent(
prompt: string,
options?: RunFlowchartAgentOptions
): Promise<{ text: string }> {
+ try {
+ await liveblocks.createVersionHistorySnapshot(roomId);
+ } catch (error) {
+ console.error("Failed to create version history snapshot", error);
+ }
+
const agentUser = createAgentUser();
let lastCursor: Point | null = null;
let lastThinking: boolean = true;
diff --git a/examples/nextjs-react-flow-ai/app/flowchart/editor.tsx b/examples/nextjs-react-flow-ai/app/flowchart/editor.tsx
index a9e90b0cdd9..dde05ae82a7 100644
--- a/examples/nextjs-react-flow-ai/app/flowchart/editor.tsx
+++ b/examples/nextjs-react-flow-ai/app/flowchart/editor.tsx
@@ -48,6 +48,7 @@ import {
} from "@xyflow/react";
import { AvatarStack, Cursor, Icon } from "@liveblocks/react-ui";
import { HelpControl } from "../../components/HelpButton";
+import { VersionsDialog } from "./version-history-dialog";
import {
useEditThreadMetadata,
useThreads,
@@ -1165,6 +1166,7 @@ function Flow({ className, ...props }: ComponentProps<"div">) {