diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx index d7f4fef1..faf969a7 100644 --- a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx @@ -1,7 +1,7 @@ import { useParams } from "react-router-dom"; import { useWorkflowQuery } from "../hooks/useWorkflowQuery"; import { getElements } from "./workflowEditorUtils"; -import { useMutation } from "@tanstack/react-query"; +import { useMutation, useQueryClient } from "@tanstack/react-query"; import { BlockYAML, ParameterYAML, @@ -18,6 +18,7 @@ import { AxiosError } from "axios"; function WorkflowEditor() { const { workflowPermanentId } = useParams(); const credentialGetter = useCredentialGetter(); + const queryClient = useQueryClient(); const { data: workflow, isLoading } = useWorkflowQuery({ workflowPermanentId, @@ -60,6 +61,9 @@ function WorkflowEditor() { description: "Your changes have been saved", variant: "success", }); + queryClient.invalidateQueries({ + queryKey: ["workflow", workflowPermanentId], + }); }, onError: (error: AxiosError) => { toast({