diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx index d6cdb1fd..6707cd4d 100644 --- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx +++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx @@ -192,6 +192,9 @@ function RunWorkflowForm({ lsKeys.browserSessionId, (initialValues.browserSessionId as string | undefined) ?? null, ); + const apiCredential = useApiCredential(); + const { data: workflow } = useWorkflowQuery({ workflowPermanentId }); + const form = useForm({ defaultValues: { ...initialValues, @@ -203,12 +206,10 @@ function RunWorkflowForm({ extraHttpHeaders: initialSettings.extraHttpHeaders ? JSON.stringify(initialSettings.extraHttpHeaders) : null, - runWithCode: false, - aiFallback: true, + runWithCode: workflow?.generate_script ?? false, + aiFallback: workflow?.ai_fallback ?? true, }, }); - const apiCredential = useApiCredential(); - const { data: workflow } = useWorkflowQuery({ workflowPermanentId }); useSyncFormFieldToStorage(form, "browserSessionId", lsKeys.browserSessionId); diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx index 31fc150d..7c839eb6 100644 --- a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx @@ -30,7 +30,6 @@ import { useDebugStore } from "@/store/useDebugStore"; import { useWorkflowTitleStore } from "@/store/WorkflowTitleStore"; import { useWorkflowHasChangesStore } from "@/store/WorkflowHasChangesStore"; import { cn } from "@/util/utils"; -import { WorkflowApiResponse } from "../types/workflowTypes"; import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes"; interface Dom { @@ -44,7 +43,6 @@ type Props = { parametersPanelOpen: boolean; saving: boolean; showAllCode: boolean; - workflow: WorkflowApiResponse; onCacheKeyValueAccept: (cacheKeyValue: string | null) => void; onCacheKeyValuesBlurred: (cacheKeyValue: string | null) => void; onCacheKeyValuesFilter: (cacheKeyValue: string) => void; @@ -64,7 +62,6 @@ function WorkflowHeader({ parametersPanelOpen, saving, showAllCode, - workflow, onCacheKeyValueAccept, onCacheKeyValuesBlurred, onCacheKeyValuesFilter, @@ -135,8 +132,7 @@ function WorkflowHeader({ />
- {user && workflow.generate_script && ( - // (cacheKeyValues?.total_count ?? 0) > 0 && ( + {user && (cacheKeyValues?.total_count ?? 0) > 0 && ( <> {debugStore.isDebugMode && (
- -
-
-
- - - { - handleChange("useScriptCache", value); +
+
+
+
+ + +
+ +
+
+
+ + + { + handleChange("aiFallback", value); + }} + /> +
-
- {/* {inputs.useScriptCache && ( .. // TODO(jdo/always-generate): put back */} -
@@ -238,19 +268,6 @@ function StartNode({ id, data }: NodeProps) { className="nopan text-xs" />
-
-
- - - { - handleChange("aiFallback", value); - }} - /> -
-
{/* )} */}