Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

feat: enable flow updates across all deployment modes and add non-admin notification UI (#2260)

Lucas Oliveira3c5052b85b7d
diff --git a/frontend/app/globals.css b/frontend/app/globals.css
index 2b1100f04..c353595c4 100644
--- a/frontend/app/globals.css
+++ b/frontend/app/globals.css
@@ -250,7 +250,28 @@
[data-theme="ibm"] [data-slot="dialog-content"] > button[class*="absolute"],
[data-theme="ibm"] [role="dialog"] > button[class*="absolute"] {
- display: none !important;
+ display: flex !important;
+ align-items: center !important;
+ justify-content: center !important;
+ top: 0.75rem !important;
+ right: 0.75rem !important;
+ width: 1.5rem !important;
+ height: 1.5rem !important;
+ padding: 0 !important;
+ border-radius: 0 !important;
+ color: hsl(var(--foreground)) !important;
+ opacity: 0.75 !important;
+ transition:
+ background-color 0.1s ease,
+ opacity 0.1s ease !important;
+ }
+
+ [data-theme="ibm"]
+ [data-slot="dialog-content"]
+ > button[class*="absolute"]:hover,
+ [data-theme="ibm"] [role="dialog"] > button[class*="absolute"]:hover {
+ opacity: 1 !important;
+ background-color: hsl(var(--muted)) !important;
}
[data-theme="ibm"] [data-slot="dialog-content"] form {
@@ -320,6 +341,17 @@
margin-top: 1rem !important;
}
+ /* Confirmation / alert dialogs without body content: remove header bottom border and footer top margin */
+ [data-theme="ibm"]
+ [data-slot="dialog-header"]:has(+ [data-slot="dialog-footer"]) {
+ border-bottom: none !important;
+ padding-bottom: 1.5rem !important;
+ }
+
+ [data-theme="ibm"] [data-slot="dialog-header"] + [data-slot="dialog-footer"] {
+ margin-top: 0 !important;
+ }
+
/*
* Carbon 3-button footer (e.g. Remove + Cancel + Save): a 2-column grid
* wraps the third action onto a new row. Use 4 columns so tertiary sits
@@ -426,6 +458,30 @@
box-shadow: none !important;
}
+ /* Single-button footer: primary action sits on the right side (column 2). */
+ [data-theme="ibm"] [data-slot="dialog-footer"] > button:only-child,
+ [data-theme="ibm"] [data-slot="dialog-footer"] > span:only-child,
+ [data-theme="ibm"]
+ [data-slot="dialog-footer"]:has(> :only-child)
+ > :only-child {
+ grid-column: 2 !important;
+ background-color: #0f62fe !important;
+ color: #ffffff !important;
+ }
+
+ [data-theme="ibm"] [data-slot="dialog-footer"] > button:only-child:hover,
+ [data-theme="ibm"]
+ [data-slot="dialog-footer"]:has(> :only-child)
+ > :only-child:hover,
+ [data-theme="ibm"]
+ [data-slot="dialog-footer"]
+ > span:only-child
+ button:hover {
+ background-color: #0353e9 !important;
+ border: 0 !important;
+ outline: none !important;
+ }
+
/* After hover resets: restore a visible focus ring (matches Button focus-visible:ring). */
[data-theme="ibm"] [data-slot="dialog-footer"] > button:focus-visible,
[data-theme="ibm"] [data-slot="dialog-footer"] > span button:focus-visible {
diff --git a/frontend/app/settings/[tab]/page.tsx b/frontend/app/settings/[tab]/page.tsx
index 8b5b2aa8e..9accd9bee 100644
--- a/frontend/app/settings/[tab]/page.tsx
+++ b/frontend/app/settings/[tab]/page.tsx
@@ -12,7 +12,6 @@ import { ApiKeysSection } from "../_components/api-keys-section";
import { ConnectorAccessSection } from "../_components/connector-access-section";
import { ConnectorsTab } from "../_components/connectors-tab";
import { IngestionTab } from "../_components/ingestion-tab";
-import { LangflowUpdatesBanner } from "../_components/langflow-updates-banner";
import ModelProviders from "../_components/model-providers";
const VALID_TABS = [
@@ -148,12 +147,7 @@ export default async function SettingsTabPage({
{tab === "connectors" && <ConnectorsTab />}
{tab === "providers" && <ModelProviders />}
{tab === "ingestion" && <IngestionTab />}
- {tab === "agent" && (
- <div className="space-y-6">
- <LangflowUpdatesBanner />
- <AgentSettingsSection />
- </div>
- )}
+ {tab === "agent" && <AgentSettingsSection />}
{tab === "api-keys" && <ApiKeysSection />}
{tab === "connector-access" && <ConnectorAccessSection />}
</HydrationBoundary>
diff --git a/frontend/app/settings/_components/langflow-updates-banner.tsx b/frontend/app/settings/_components/langflow-updates-banner.tsx
index 12b8c5848..08a179eec 100644
--- a/frontend/app/settings/_components/langflow-updates-banner.tsx
+++ b/frontend/app/settings/_components/langflow-updates-banner.tsx
@@ -4,32 +4,25 @@ import { AlertTriangle, X } from "lucide-react";
import { useState } from "react";
import { useGetFlowsUpdatesQuery } from "@/app/api/queries/useGetFlowsUpdatesQuery";
import { FlowsUpdateDialog } from "@/components/flows-update-dialog";
-import { useAuth } from "@/contexts/auth-context";
import { useBrand } from "@/contexts/brand-context";
-import { usePermissions } from "@/hooks/use-permissions";
+import { useSettingsTabAccess } from "@/hooks/use-permissions";
+import { canViewFlowUpdates } from "@/lib/brand";
import { cn } from "@/lib/utils";
export function LangflowUpdatesBanner() {
const { brand } = useBrand();
const isIbm = brand === "ibm";
- const { runMode } = useAuth();
- const { can } = usePermissions();
- const canEdit = can("flows:edit") && runMode === "oss";
+ const tabAccess = useSettingsTabAccess();
+ const canView = canViewFlowUpdates(tabAccess);
const { data: updates, isLoading } = useGetFlowsUpdatesQuery({
- enabled: canEdit,
+ enabled: canView,
});
const [isDismissed, setIsDismissed] = useState(false);
const [showModal, setShowModal] = useState(false);
- const undismissedUpdates = updates?.filter((u) => !u.dismissed) ?? [];
+ const hasUpdates = (updates?.length ?? 0) > 0;
- if (
- !canEdit ||
- isLoading ||
- !updates ||
- undismissedUpdates.length === 0 ||
- isDismissed
- ) {
+ if (!canView || isLoading || !updates || !hasUpdates || isDismissed) {
return null;
}
@@ -54,11 +47,10 @@ export function LangflowUpdatesBanner() {
)}
<div className="truncate">
<span className="font-semibold text-foreground">
- Langflow update detected
+ Langflow flow updates available
</span>
<span className="text-muted-foreground ml-2 hidden sm:inline text-mmd">
- Modifications to Langflow require an update to revert any custom
- changes.
+ New versions of one or more Langflow flows are available.
</span>
</div>
</div>
diff --git a/frontend/app/settings/_components/settings-shell.tsx b/frontend/app/settings/_components/settings-shell.tsx
index 5dbe7e1ab..478b42f49 100644
--- a/frontend/app/settings/_components/settings-shell.tsx
+++ b/frontend/app/settings/_components/settings-shell.tsx
@@ -2,6 +2,7 @@
import { useIsCloudBrand } from "@/contexts/brand-context";
import { cn } from "@/lib/utils";
+import { LangflowUpdatesBanner } from "./langflow-updates-banner";
import { SettingsNav } from "./settings-nav";
import { UnsavedChangesDialog } from "./unsaved-changes-dialog";
@@ -22,6 +23,7 @@ export function SettingsShell({ children }: { children: React.ReactNode }) {
>
Settings
</h2>
+ <LangflowUpdatesBanner />
<SettingsNav />
{children}
<UnsavedChangesDialog />
diff --git a/frontend/components/delete-confirmation-dialog.tsx b/frontend/components/delete-confirmation-dialog.tsx
index acf700c1f..725951aec 100644
--- a/frontend/components/delete-confirmation-dialog.tsx
+++ b/frontend/components/delete-confirmation-dialog.tsx
@@ -93,7 +93,9 @@ export const DeleteConfirmationDialog = ({
</div>
<DialogDescription>{description}</DialogDescription>
</DialogHeader>
- <div className="text-sm text-muted-foreground">{children}</div>
+ {children ? (
+ <div className="text-sm text-muted-foreground">{children}</div>
+ ) : null}
<DialogFooter>
<Button
type="button"
diff --git a/frontend/components/flows-update-dialog.tsx b/frontend/components/flows-update-dialog.tsx
index 5a1095ae5..d589093bb 100644
--- a/frontend/components/flows-update-dialog.tsx
+++ b/frontend/components/flows-update-dialog.tsx
@@ -1,97 +1,151 @@
"use client";
-import { AlertCircle } from "lucide-react";
-import { useEffect, useState } from "react";
+import { useState } from "react";
import { toast } from "sonner";
import { useDismissFlowsUpdateMutation } from "@/app/api/mutations/useDismissFlowsUpdateMutation";
import { useUpdateFlowsMutation } from "@/app/api/mutations/useUpdateFlowsMutation";
import { useGetFlowsUpdatesQuery } from "@/app/api/queries/useGetFlowsUpdatesQuery";
-import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
-import { Button } from "@/components/ui/button";
-import { Checkbox } from "@/components/ui/checkbox";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { usePermissions } from "@/hooks/use-permissions";
+import { AdminUpdateDialog } from "@/components/flows-update-dialog/admin-update-dialog";
+import { NonAdminUpdateDialog } from "@/components/flows-update-dialog/non-admin-update-dialog";
+import { SkipUpdateConfirmDialog } from "@/components/flows-update-dialog/skip-update-confirm-dialog";
+import { UpdateWithoutBackupDialog } from "@/components/flows-update-dialog/update-without-backup-dialog";
+import { useOnboardingState } from "@/hooks/use-onboarding-state";
+import { useSettingsTabAccess } from "@/hooks/use-permissions";
+import { canManageFlowUpdates, canViewFlowUpdates } from "@/lib/brand";
import { formatFlowName } from "@/lib/utils";
+const SESSION_DISMISSED_KEY = "openrag_flows_update_dismissed_session";
+
+function hasDismissedFlowsUpdateInSession() {
+ if (typeof window === "undefined") return false;
+ try {
+ return Boolean(sessionStorage.getItem(SESSION_DISMISSED_KEY));
+ } catch {
+ return false;
+ }
+}
+
interface FlowsUpdateDialogProps {
overrideOpen?: boolean;
onOpenChange?: (open: boolean) => void;
+ isOnboarding?: boolean;
}
export function FlowsUpdateDialog({
overrideOpen,
onOpenChange,
+ isOnboarding: propIsOnboarding,
}: FlowsUpdateDialogProps = {}) {
- const { can } = usePermissions();
- const canEdit = can("flows:edit");
+ const tabAccess = useSettingsTabAccess();
+ const isAdmin = canManageFlowUpdates(tabAccess);
+ const canView = canViewFlowUpdates(tabAccess);
+
+ const { isOnboardingComplete } = useOnboardingState();
+ const isOnboarding = propIsOnboarding ?? !isOnboardingComplete;
+
const { data: updates, isLoading } = useGetFlowsUpdatesQuery({
- enabled: canEdit,
+ enabled: canView,
});
const updateMutation = useUpdateFlowsMutation();
const dismissMutation = useDismissFlowsUpdateMutation();
- const [internalIsOpen, setInternalIsOpen] = useState(false);
- const [showConfirm, setShowConfirm] = useState(false);
+ const [closedUpdateKey, setClosedUpdateKey] = useState<string | null>(null);
+ const [isSessionDismissed, setIsSessionDismissed] = useState(
+ hasDismissedFlowsUpdateInSession,
+ );
+ const [showSkipConfirm, setShowSkipConfirm] = useState(false);
+ const [showUpdateConfirm, setShowUpdateConfirm] = useState(false);
+ const [isUpdatingWithBackup, setIsUpdatingWithBackup] = useState<
+ boolean | null
+ >(null);
const [backupCustom, setBackupCustom] = useState(true);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
- const isOpen = overrideOpen ?? internalIsOpen;
- const setIsOpen = (open: boolean) => {
- setInternalIsOpen(open);
- onOpenChange?.(open);
- };
-
- const undismissedUpdates = updates?.filter((u) => !u.dismissed) ?? [];
+ const allUpdates = updates ?? [];
+ const undismissedUpdates = allUpdates.filter((u) => !u.dismissed);
+ const targetUpdates =
+ undismissedUpdates.length > 0 ? undismissedUpdates : allUpdates;
const hasUndismissed = undismissedUpdates.length > 0;
-
- const [prevIsLoading, setPrevIsLoading] = useState(isLoading);
- const [prevHasUndismissed, setPrevHasUndismissed] = useState(hasUndismissed);
-
- if (isLoading !== prevIsLoading || hasUndismissed !== prevHasUndismissed) {
- setPrevIsLoading(isLoading);
- setPrevHasUndismissed(hasUndismissed);
- if (overrideOpen === undefined) {
- if (!isLoading && hasUndismissed) {
- setInternalIsOpen(true);
- } else if (!isLoading) {
- setInternalIsOpen(false);
- }
+ const currentUpdateKey = targetUpdates
+ .map((update) => `${update.flow_type}:${update.flow_id}`)
+ .sort()
+ .join("|");
+ const isAutoOpen =
+ !isLoading && hasUndismissed && closedUpdateKey !== currentUpdateKey;
+
+ const isMainOpen =
+ !showSkipConfirm &&
+ !showUpdateConfirm &&
+ (overrideOpen ?? (isAutoOpen && !(!isAdmin && isSessionDismissed)));
+
+ const handleClose = () => {
+ if (currentUpdateKey) {
+ setClosedUpdateKey(currentUpdateKey);
}
- }
+ setShowSkipConfirm(false);
+ setShowUpdateConfirm(false);
+ setIsUpdatingWithBackup(null);
+ onOpenChange?.(false);
+ };
const handleDismiss = async () => {
- setIsOpen(false);
- setShowConfirm(false);
- if (undismissedUpdates.length === 0) return;
+ handleClose();
+ if (targetUpdates.length === 0) return;
try {
await dismissMutation.mutateAsync({
- flow_types: undismissedUpdates.map((u) => u.flow_type),
+ flow_types: targetUpdates.map((u) => u.flow_type),
});
} catch (e) {
console.error("Failed to dismiss flow updates", e);
}
};
+ const handleNonAdminDismiss = () => {
+ handleClose();
+ if (typeof window !== "undefined") {
+ try {
+ sessionStorage.setItem(SESSION_DISMISSED_KEY, "true");
+ } catch {
+ // ignore
+ }
+ }
+ setIsSessionDismissed(true);
+ };
+
+ const handleSkipClick = () => {
+ setShowSkipConfirm(true);
+ };
+
+ const handleSkipConfirmOpenChange = (open: boolean) => {
+ setShowSkipConfirm(open);
+ };
+
+ const handleSkipUpdateClick = () => {
+ setShowSkipConfirm(false);
+ if (!backupCustom) {
+ setShowUpdateConfirm(true);
+ } else {
+ handleConfirmUpdate(true);
+ }
+ };
+
const handleInitialUpdateClick = () => {
- setIsOpen(false);
- setShowConfirm(true);
+ if (!backupCustom) {
+ setShowUpdateConfirm(true);
+ } else {
+ handleConfirmUpdate(true);
+ }
};
- const handleConfirmUpdate = async () => {
- if (undismissedUpdates.length === 0) return;
+ const handleConfirmUpdate = async (withBackup: boolean) => {
+ if (targetUpdates.length === 0) return;
setErrorMessage(null);
- const flowTypes = undismissedUpdates.map((u) => u.flow_type);
+ setIsUpdatingWithBackup(withBackup);
+ const flowTypes = targetUpdates.map((u) => u.flow_type);
try {
const results = await updateMutation.mutateAsync({
flow_types: flowTypes,
- backup_custom: backupCustom,
+ backup_custom: withBackup,
});
const failed = results.filter((r) => !r.success);
@@ -104,107 +158,73 @@ export function FlowsUpdateDialog({
.join("; ");
setErrorMessage(errorText);
toast.error(`Flow update failed: ${errorText}`);
+ setShowUpdateConfirm(false);
+ setClosedUpdateKey(null);
} else {
toast.success("Flows updated successfully");
- setShowConfirm(false);
+ handleClose();
}
- } catch (e: any) {
- const msg = e?.message || "Failed to update flows";
+ } catch (e: unknown) {
+ const msg = e instanceof Error ? e.message : "Failed to update flows";
setErrorMessage(msg);
toast.error(msg);
+ setShowUpdateConfirm(false);
+ setClosedUpdateKey(null);
+ } finally {
+ setIsUpdatingWithBackup(null);
}
};
- if (
- !can("flows:edit") ||
- (overrideOpen === undefined && undismissedUpdates.length === 0)
- )
+ if (targetUpdates.length === 0) return null;
+ if (overrideOpen === undefined && undismissedUpdates.length === 0)
return null;
+ if (!isAdmin && overrideOpen === undefined && isSessionDismissed) return null;
+
+ if (!isAdmin) {
+ return (
+ <NonAdminUpdateDialog
+ open={isMainOpen}
+ onClose={handleClose}
+ onDismiss={handleNonAdminDismiss}
+ />
+ );
+ }
+
+ const isBusy = updateMutation.isPending || dismissMutation.isPending;
return (
<>
- <Dialog open={isOpen} onOpenChange={setIsOpen}>
- <DialogContent className="sm:max-w-[540px]">
- <DialogHeader>
- <DialogTitle>Update required from Langflow</DialogTitle>
- <DialogDescription>
- OpenRAG will back up your customized flows first
- </DialogDescription>
- </DialogHeader>
-
- <div className="space-y-4 py-2">
- {errorMessage && (
- <Alert variant="destructive">
- <AlertCircle className="h-4 w-4" />
- <AlertTitle>Update Failed</AlertTitle>
- <AlertDescription>{errorMessage}</AlertDescription>
- </Alert>
- )}
-
- <p className="text-sm text-muted-foreground leading-relaxed">
- Updating Langflow discards your customizations to OpenRAG flows.
- OpenRAG copies the core flows before updating, so you can reapply
- your changes afterward. OpenRAG stores the copies in its embedded
- Langflow instance.
- </p>
-
- <div className="flex items-center space-x-2 pt-2">
- <Checkbox
- id="backup-custom"
- checked={backupCustom}
- onCheckedChange={(checked) => setBackupCustom(!!checked)}
- />
- <label
- htmlFor="backup-custom"
- className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
- >
- Back up my flows in Langflow before updating
- </label>
- </div>
- </div>
-
- <DialogFooter>
- <Button variant="outline" onClick={handleDismiss}>
- Skip action
- </Button>
- <Button onClick={handleInitialUpdateClick}>Update flow</Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
-
- <Dialog open={showConfirm} onOpenChange={setShowConfirm}>
- <DialogContent className="sm:max-w-[540px]">
- <DialogHeader>
- <DialogTitle>Confirm Langflow Update</DialogTitle>
- </DialogHeader>
-
- <div className="py-2">
- <p className="text-sm text-muted-foreground leading-relaxed">
- Updating Langflow will overwrite any custom changes made. Backup
- copies of your flows will be created in Langflow. Do you want to
- continue?
- </p>
- </div>
-
- <DialogFooter>
- <Button
- variant="outline"
- onClick={() => {
- setShowConfirm(false);
- setIsOpen(true);
- }}
- >
- Cancel
- </Button>
- <Button
- onClick={handleConfirmUpdate}
- disabled={updateMutation.isPending}
- >
- {updateMutation.isPending ? "Updating..." : "Continue update"}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
+ <AdminUpdateDialog
+ open={isMainOpen}
+ errorMessage={errorMessage}
+ backupCustom={backupCustom}
+ isOnboarding={isOnboarding}
+ isUpdating={updateMutation.isPending}
+ isBusy={isBusy}
+ onClose={handleClose}
+ onBackupCustomChange={setBackupCustom}
+ onSkip={handleSkipClick}
+ onUpdate={handleInitialUpdateClick}
+ />
+ <SkipUpdateConfirmDialog
+ open={showSkipConfirm}
+ isBusy={isBusy}
+ isDismissing={dismissMutation.isPending}
+ onOpenChange={handleSkipConfirmOpenChange}
+ onUpdate={handleSkipUpdateClick}
+ onDismiss={handleDismiss}
+ />
+ <UpdateWithoutBackupDialog
+ open={showUpdateConfirm}
+ isUpdating={updateMutation.isPending}
+ isUpdatingWithBackup={isUpdatingWithBackup}
+ onOpenChange={setShowUpdateConfirm}
+ onBackupAndUpdate={() => {
+ setBackupCustom(true);
+ handleConfirmUpdate(true);
+ }}
+ onContinueWithoutBackup={() => handleConfirmUpdate(false)}
+ />
</>
);
}
diff --git a/frontend/components/flows-update-dialog/admin-update-dialog.tsx b/frontend/components/flows-update-dialog/admin-update-dialog.tsx
new file mode 100644
index 000000000..e89af10aa
--- /dev/null
+++ b/frontend/components/flows-update-dialog/admin-update-dialog.tsx
@@ -0,0 +1,102 @@
+import { AlertCircle } from "lucide-react";
+import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
+import { Button } from "@/components/ui/button";
+import { Checkbox } from "@/components/ui/checkbox";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+
+interface AdminUpdateDialogProps {
+ open: boolean;
+ errorMessage: string | null;
+ backupCustom: boolean;
+ isOnboarding: boolean;
+ isUpdating: boolean;
+ isBusy: boolean;
+ onClose: () => void;
+ onBackupCustomChange: (checked: boolean) => void;
+ onSkip: () => void;
+ onUpdate: () => void;
+}
+
+export function AdminUpdateDialog({
+ open,
+ errorMessage,
+ backupCustom,
+ isOnboarding,
+ isUpdating,
+ isBusy,
+ onClose,
+ onBackupCustomChange,
+ onSkip,
+ onUpdate,
+}: AdminUpdateDialogProps) {
+ return (
+ <Dialog open={open} onOpenChange={(nextOpen) => !nextOpen && onClose()}>
+ <DialogContent className="sm:max-w-[540px]">
+ <DialogHeader>
+ <DialogTitle>Update Langflow flows</DialogTitle>
+ <DialogDescription>
+ New versions of one or more Langflow flows are available.
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="space-y-4 py-2">
+ {errorMessage && (
+ <Alert variant="destructive">
+ <AlertCircle className="h-4 w-4" />
+ <AlertTitle>Update Failed</AlertTitle>
+ <AlertDescription>{errorMessage}</AlertDescription>
+ </Alert>
+ )}
+
+ <div className="space-y-3 text-sm text-muted-foreground leading-relaxed">
+ <p>
+ If you have customized any flows, those customizations will be
+ removed during the update.
+ </p>
+ <p>
+ By default, OpenRAG backs up customized flows and stores the
+ backups in its embedded Langflow instance. After the update, you
+ can use the backups to manually reapply your customizations.
+ </p>
+ <p>
+ If you don&apos;t have customized flows, a backup isn&apos;t
+ required.
+ </p>
+ </div>
+
+ <div className="flex items-center space-x-2 pt-2">
+ <Checkbox
+ id="backup-custom"
+ checked={backupCustom}
+ onCheckedChange={(checked) => onBackupCustomChange(!!checked)}
+ />
+ <label
+ htmlFor="backup-custom"
+ className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer"
+ >
+ Back up my flows before updating
+ </label>
+ </div>
+ </div>
+
+ <DialogFooter>
+ {!isOnboarding && (
+ <Button variant="outline" onClick={onSkip} disabled={isBusy}>
+ <div>Skip update</div>
+ </Button>
+ )}
+ <Button onClick={onUpdate} disabled={isBusy}>
+ <div>{isUpdating ? "Updating..." : "Update"}</div>
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/frontend/components/flows-update-dialog/non-admin-update-dialog.tsx b/frontend/components/flows-update-dialog/non-admin-update-dialog.tsx
new file mode 100644
index 000000000..11a95d2a3
--- /dev/null
+++ b/frontend/components/flows-update-dialog/non-admin-update-dialog.tsx
@@ -0,0 +1,54 @@
+import { AlertTriangle } from "lucide-react";
+import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+
+interface NonAdminUpdateDialogProps {
+ open: boolean;
+ onClose: () => void;
+ onDismiss: () => void;
+}
+
+export function NonAdminUpdateDialog({
+ open,
+ onClose,
+ onDismiss,
+}: NonAdminUpdateDialogProps) {
+ return (
+ <Dialog open={open} onOpenChange={(nextOpen) => !nextOpen && onClose()}>
+ <DialogContent className="sm:max-w-[540px]">
+ <DialogHeader>
+ <DialogTitle>Langflow flow updates available</DialogTitle>
+ <DialogDescription>
+ Action required by an administrator
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="space-y-4 py-2">
+ <Alert>
+ <AlertTriangle className="h-4 w-4" />
+ <AlertTitle>Updates Available</AlertTitle>
+ <AlertDescription className="text-muted-foreground leading-relaxed">
+ New versions of one or more Langflow flows are available. An
+ administrator must review and apply the updates. Until then, some
+ flows might not work as expected.
+ </AlertDescription>
+ </Alert>
+ </div>
+
+ <DialogFooter>
+ <Button onClick={onDismiss}>
+ <div>Understood</div>
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/frontend/components/flows-update-dialog/skip-update-confirm-dialog.tsx b/frontend/components/flows-update-dialog/skip-update-confirm-dialog.tsx
new file mode 100644
index 000000000..f35a7a18d
--- /dev/null
+++ b/frontend/components/flows-update-dialog/skip-update-confirm-dialog.tsx
@@ -0,0 +1,60 @@
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+
+interface SkipUpdateConfirmDialogProps {
+ open: boolean;
+ isBusy: boolean;
+ isDismissing: boolean;
+ onOpenChange: (open: boolean) => void;
+ onUpdate: () => void;
+ onDismiss: () => void;
+}
+
+export function SkipUpdateConfirmDialog({
+ open,
+ isBusy,
+ isDismissing,
+ onOpenChange,
+ onUpdate,
+ onDismiss,
+}: SkipUpdateConfirmDialogProps) {
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent className="sm:max-w-[540px]">
+ <DialogHeader>
+ <DialogTitle>Skip the Langflow update</DialogTitle>
+ <DialogDescription className="sr-only">
+ Skip the Langflow update confirmation
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="space-y-3 py-2 text-sm text-muted-foreground leading-relaxed">
+ <p>
+ OpenRAG flows are designed to work with the latest supported version
+ of Langflow.
+ </p>
+ <p>
+ If you skip this update, some flows might become incompatible and
+ stop working correctly.
+ </p>
+ </div>
+
+ <DialogFooter>
+ <Button onClick={onUpdate} disabled={isBusy}>
+ <div>Update</div>
+ </Button>
+ <Button variant="outline" onClick={onDismiss} disabled={isBusy}>
+ <div>{isDismissing ? "Skipping..." : "Skip update"}</div>
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/frontend/components/flows-update-dialog/update-without-backup-dialog.tsx b/frontend/components/flows-update-dialog/update-without-backup-dialog.tsx
new file mode 100644
index 000000000..e305ff47c
--- /dev/null
+++ b/frontend/components/flows-update-dialog/update-without-backup-dialog.tsx
@@ -0,0 +1,69 @@
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+
+interface UpdateWithoutBackupDialogProps {
+ open: boolean;
+ isUpdating: boolean;
+ isUpdatingWithBackup: boolean | null;
+ onOpenChange: (open: boolean) => void;
+ onBackupAndUpdate: () => void;
+ onContinueWithoutBackup: () => void;
+}
+
+export function UpdateWithoutBackupDialog({
+ open,
+ isUpdating,
+ isUpdatingWithBackup,
+ onOpenChange,
+ onBackupAndUpdate,
+ onContinueWithoutBackup,
+}: UpdateWithoutBackupDialogProps) {
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent className="sm:max-w-[540px]">
+ <DialogHeader>
+ <DialogTitle>Update without a backup</DialogTitle>
+ <DialogDescription className="sr-only">
+ Update without a backup confirmation
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="py-2 text-sm text-muted-foreground leading-relaxed">
+ <p>
+ If you&apos;ve customized any OpenRAG flows, updating without a
+ backup permanently removes those customizations. You won&apos;t be
+ able to restore them after the update.
+ </p>
+ </div>
+
+ <DialogFooter>
+ <Button onClick={onBackupAndUpdate} disabled={isUpdating}>
+ <div>
+ {isUpdating && isUpdatingWithBackup
+ ? "Updating..."
+ : "Back up my flows"}
+ </div>
+ </Button>
+ <Button
+ variant="outline"
+ onClick={onContinueWithoutBackup}
+ disabled={isUpdating}
+ >
+ <div>
+ {isUpdating && isUpdatingWithBackup === false
+ ? "Updating..."
+ : "Continue without backup"}
+ </div>
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/frontend/components/layout-wrapper.tsx b/frontend/components/layout-wrapper.tsx
index d9a567f7c..1afec756a 100644
--- a/frontend/components/layout-wrapper.tsx
+++ b/frontend/components/layout-wrapper.tsx
@@ -192,9 +192,7 @@ export function LayoutWrapper({ children }: { children: React.ReactNode }) {
runMode === "oss" && (
<ConsoleStatusPanel isOpen={isStatusOpen} onClose={closeStatus} />
)}
- {(isAuthenticated || isNoAuthMode) && runMode === "oss" && (
- <FlowsUpdateDialog />
- )}
+ {(isAuthenticated || isNoAuthMode) && <FlowsUpdateDialog />}
</div>
);
}
diff --git a/frontend/lib/brand.ts b/frontend/lib/brand.ts
index 2767086fc..5edb00879 100644
--- a/frontend/lib/brand.ts
+++ b/frontend/lib/brand.ts
@@ -165,3 +165,18 @@ export function canAccessConnectorAccessTab(
): boolean {
return ctx.isSaasPolicy && hasRbacPermission("connectors:manage:access", ctx);
}
+
+/**
+ * Policy check for whether the current user is an administrator who can
+ * manage system configuration and apply flow updates.
+ */
+export function canManageFlowUpdates(ctx: SettingsTabAccessContext): boolean {
+ return canShowRbacGatedSettingsTab("config:write", ctx);
+}
+
+/**
+ * Policy check for whether the user can view flow update notifications.
+ */
+export function canViewFlowUpdates(ctx: SettingsTabAccessContext): boolean {
+ return canShowRbacGatedSettingsTab("flows:read", ctx);
+}
diff --git a/frontend/lib/constants.ts b/frontend/lib/constants.ts
index 21b2b707b..38f242ef1 100644
--- a/frontend/lib/constants.ts
+++ b/frontend/lib/constants.ts
@@ -30,7 +30,7 @@ export const DEFAULT_KNOWLEDGE_SETTINGS = {
* UI Constants
*/
export const UI_CONSTANTS = {
- MAX_SYSTEM_PROMPT_CHARS: 5000,
+ MAX_SYSTEM_PROMPT_CHARS: 5500,
} as const;
/**
diff --git a/frontend/tests/utils/onboarding.ts b/frontend/tests/utils/onboarding.ts
index d4dae5988..916496c4a 100644
--- a/frontend/tests/utils/onboarding.ts
+++ b/frontend/tests/utils/onboarding.ts
@@ -151,6 +151,8 @@ export async function completeOnboarding(
const setupProvider = async (provider: string, isEmbedding: boolean) => {
const tabId = `${provider}-${isEmbedding ? "embedding" : "llm"}-tab`;
+ await page.getByTestId(tabId).scrollIntoViewIfNeeded();
+ await page.waitForTimeout(500);
await page.getByTestId(tabId).click();
if (provider === "azure") {
diff --git a/src/api/flows.py b/src/api/flows.py
index b65de9a73..a64b3e115 100644
--- a/src/api/flows.py
+++ b/src/api/flows.py
@@ -15,12 +15,6 @@ logger = get_logger(__name__)
FlowType = Literal["nudges", "retrieval", "ingest"]
-def _is_oss_mode() -> bool:
- from config.settings import IBM_AUTH_ENABLED, is_dev_ibm_cos_enabled
-
- return not (IBM_AUTH_ENABLED or is_dev_ibm_cos_enabled())
-
-
async def reset_flow_endpoint(
flow_type: str,
flows_service=Depends(get_flows_service),
@@ -64,8 +58,6 @@ async def get_flows_updates_endpoint(
user: User = Depends(require_permission("flows:read")),
):
"""Get available updates for core flows"""
- if not _is_oss_mode():
- return JSONResponse({"success": True, "updates": []}, status_code=200)
try:
user_id = getattr(user, "db_user_id", None) or getattr(user, "user_id", None)
updates = await flows_service.get_flows_updates_available(user_id=user_id)
@@ -78,14 +70,9 @@ async def get_flows_updates_endpoint(
async def bulk_update_flows_endpoint(
request: BulkUpdateFlowsRequest,
flows_service=Depends(get_flows_service),
- user: User = Depends(require_permission("flows:edit")),
+ user: User = Depends(require_permission("config:write")),
):
"""Bulk update multiple flows and optionally backup custom flows"""
- if not _is_oss_mode():
- return JSONResponse(
- {"success": False, "error": "Flow updates are only available in OSS mode"},
- status_code=403,
- )
try:
results = await flows_service.bulk_update_flows(request.flow_types, request.backup_custom)
overall_success = all(r.get("success", False) for r in results)
@@ -105,8 +92,6 @@ async def dismiss_flows_update_endpoint(
user: User = Depends(require_permission("flows:read")),
):
"""Dismiss available flow update notifications ephemerally in backend memory"""
- if not _is_oss_mode():
- return JSONResponse({"success": True}, status_code=200)
try:
flow_types = request.flow_types if request else None
user_id = getattr(user, "db_user_id", None) or getattr(user, "user_id", None)
diff --git a/tests/unit/api/test_flows_api.py b/tests/unit/api/test_flows_api.py
new file mode 100644
index 000000000..b555fd8e7
--- /dev/null
+++ b/tests/unit/api/test_flows_api.py
@@ -0,0 +1,81 @@
+"""Unit tests for src/api/flows.py endpoints across all run modes."""
+
+import json
+from unittest.mock import AsyncMock, MagicMock
+
+import pytest
+
+from api.flows import (
+ BulkUpdateFlowsRequest,
+ DismissFlowsUpdateRequest,
+ bulk_update_flows_endpoint,
+ dismiss_flows_update_endpoint,
+ get_flows_updates_endpoint,
+)
+from session_manager import User
+
+
+async def test_get_flows_updates_endpoint_returns_updates():
+ """Verify get_flows_updates_endpoint returns updates regardless of mode."""
+ flows_service = MagicMock()
+ flows_service.get_flows_updates_available = AsyncMock(
+ return_value=[
+ {
+ "flow_type": "retrieval",
+ "flow_id": "flow-retrieval-123",
+ "is_custom": False,
+ "dismissed": False,
+ }
+ ]
+ )
+ user = MagicMock(spec=User)
+ user.db_user_id = None
+ user.user_id = "user_123"
+
+ response = await get_flows_updates_endpoint(flows_service=flows_service, user=user)
+
+ assert response.status_code == 200
+ data = json.loads(response.body)
+ assert data["success"] is True
+ assert len(data["updates"]) == 1
+ assert data["updates"][0]["flow_type"] == "retrieval"
+
+
+async def test_bulk_update_flows_endpoint_executes():
+ """Verify bulk_update_flows_endpoint executes update."""
+ flows_service = MagicMock()
+ flows_service.bulk_update_flows = AsyncMock(
+ return_value=[{"flow_type": "retrieval", "success": True}]
+ )
+ user = MagicMock(spec=User)
+
+ request = BulkUpdateFlowsRequest(flow_types=["retrieval"], backup_custom=True)
+ response = await bulk_update_flows_endpoint(
+ request=request, flows_service=flows_service, user=user
+ )
+
+ assert response.status_code == 200
+ data = json.loads(response.body)
+ assert data["success"] is True
+ assert data["results"][0]["flow_type"] == "retrieval"
+
+
+async def test_dismiss_flows_update_endpoint_executes():
+ """Verify dismiss_flows_update_endpoint executes dismissal."""
+ flows_service = MagicMock()
+ user = MagicMock(spec=User)
+ user.db_user_id = None
+ user.user_id = "user_123"
+
+ request = DismissFlowsUpdateRequest(flow_types=["retrieval"])
+ response = await dismiss_flows_update_endpoint(
+ request=request, flows_service=flows_service, user=user
+ )
+
+ assert response.status_code == 200
+ data = json.loads(response.body)
+ assert data["success"] is True
+ flows_service.dismiss_flows_updates.assert_called_once_with(["retrieval"], user_id="user_123")