diff --git a/samples/apps/autogen-studio/frontend/src/components/views/playground/sessions.tsx b/samples/apps/autogen-studio/frontend/src/components/views/playground/sessions.tsx
index be5d0be308dc..c8f73c47e31b 100644
--- a/samples/apps/autogen-studio/frontend/src/components/views/playground/sessions.tsx
+++ b/samples/apps/autogen-studio/frontend/src/components/views/playground/sessions.tsx
@@ -379,6 +379,7 @@ const SessionsView = ({}: any) => {
Session Name
diff --git a/samples/apps/autogen-studio/frontend/src/components/views/playground/utils/selectors.tsx b/samples/apps/autogen-studio/frontend/src/components/views/playground/utils/selectors.tsx
index c3517a891798..d4083db071f7 100644
--- a/samples/apps/autogen-studio/frontend/src/components/views/playground/utils/selectors.tsx
+++ b/samples/apps/autogen-studio/frontend/src/components/views/playground/utils/selectors.tsx
@@ -9,10 +9,12 @@ import { Link } from "gatsby";
const WorkflowSelector = ({
workflow,
setWorkflow,
+ workflow_id,
disabled,
}: {
workflow: IWorkflow | null;
setWorkflow: (workflow: IWorkflow) => void;
+ workflow_id: number | undefined;
disabled?: boolean;
}) => {
const [error, setError] = React.useState({
@@ -42,7 +44,15 @@ const WorkflowSelector = ({
// message.success(data.message);
setWorkflows(data.data);
if (data.data.length > 0) {
- setWorkflow(data.data[0]);
+ if (!disabled) {
+ setWorkflow(data.data[0]);
+ } else {
+ const index = data.data.findIndex((item:IWorkflow) => item.id === workflow_id);
+ if (index !== -1) {
+ setSelectedWorkflow(index);
+ setWorkflow(data.data[index]);
+ }
+ }
}
} else {
message.error(data.message);