From 3299a9fcddb90bc58e809faef0d751a673a9ac11 Mon Sep 17 00:00:00 2001 From: Jonathan Dobson Date: Thu, 4 Sep 2025 12:20:22 -0400 Subject: [PATCH] accept ai_fallback for new workflows (#3358) --- .../src/routes/tasks/create/PromptBox.tsx | 30 ++--- .../workflows/editor/WorkflowHeader.tsx | 107 +++++++++-------- .../workflows/editor/nodes/NodeActionMenu.tsx | 21 ++-- .../editor/nodes/StartNode/StartNode.tsx | 112 +++++++++--------- skyvern/forge/sdk/workflow/service.py | 1 + 5 files changed, 143 insertions(+), 128 deletions(-) diff --git a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx index 1a91c249..90ee5912 100644 --- a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx +++ b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx @@ -48,6 +48,7 @@ import { MAX_SCREENSHOT_SCROLLS_DEFAULT, MAX_STEPS_DEFAULT, } from "@/routes/workflows/editor/nodes/Taskv2Node/types"; +import { OrgWalled } from "@/components/Orgwalled"; function createTemplateTaskFromTaskGenerationParameters( values: TaskGenerationApiResponse, @@ -470,22 +471,23 @@ function PromptBox() { /> - -
-
-
Generate Script
-
- Whether to generate scripts for this task run (on - success). + +
+
+
Generate Script
+
+ Whether to generate scripts for this task run (on + success). +
+ { + setGenerateScript(Boolean(checked)); + }} + />
- { - setGenerateScript(Boolean(checked)); - }} - /> -
+
Publish Workflow
diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx index cadbc36d..ae17f4db 100644 --- a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx @@ -30,6 +30,7 @@ import { useWorkflowHasChangesStore } from "@/store/WorkflowHasChangesStore"; import { cn } from "@/util/utils"; import { WorkflowApiResponse } from "../types/workflowTypes"; import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes"; +import { OrgWalled } from "@/components/Orgwalled"; interface Dom { input: React.MutableRefObject; @@ -125,62 +126,64 @@ function WorkflowHeader({
{user && workflow.generate_script && ( // (cacheKeyValues?.total_count ?? 0) > 0 && ( -
- { - setChosenCacheKeyValue(e.target.value); - onCacheKeyValuesFilter(e.target.value); - }} - onMouseDown={() => { - if (!cacheKeyValuesPanelOpen) { - onCacheKeyValuesClick(); - } - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - const numFiltered = cacheKeyValues?.values?.length ?? 0; - - if (numFiltered === 1) { - const first = cacheKeyValues?.values?.[0]; - if (first) { - setChosenCacheKeyValue(first); - onCacheKeyValueAccept(first); - } - return; + +
+ { + setChosenCacheKeyValue(e.target.value); + onCacheKeyValuesFilter(e.target.value); + }} + onMouseDown={() => { + if (!cacheKeyValuesPanelOpen) { + onCacheKeyValuesClick(); } + }} + onKeyDown={(e) => { + if (e.key === "Enter") { + const numFiltered = cacheKeyValues?.values?.length ?? 0; - setChosenCacheKeyValue(chosenCacheKeyValue); - onCacheKeyValueAccept(chosenCacheKeyValue); - } - onCacheKeyValuesKeydown(e); - }} - placeholder="Code Key Value" - value={chosenCacheKeyValue ?? undefined} - onBlur={(e) => { - onCacheKeyValuesBlurred(e.target.value); - setChosenCacheKeyValue(e.target.value); - }} - /> - {cacheKeyValuesPanelOpen ? ( - - ) : ( - { - dom.input.current?.focus(); - onCacheKeyValuesClick(); + if (numFiltered === 1) { + const first = cacheKeyValues?.values?.[0]; + if (first) { + setChosenCacheKeyValue(first); + onCacheKeyValueAccept(first); + } + return; + } + + setChosenCacheKeyValue(chosenCacheKeyValue); + onCacheKeyValueAccept(chosenCacheKeyValue); + } + onCacheKeyValuesKeydown(e); + }} + placeholder="Code Key Value" + value={chosenCacheKeyValue ?? undefined} + onBlur={(e) => { + onCacheKeyValuesBlurred(e.target.value); + setChosenCacheKeyValue(e.target.value); }} /> - )} -
+ {cacheKeyValuesPanelOpen ? ( + + ) : ( + { + dom.input.current?.focus(); + onCacheKeyValuesClick(); + }} + /> + )} +
+ )} {isGlobalWorkflow ? ( + + +
Start
@@ -224,57 +227,58 @@ function StartNode({ id, data }: NodeProps) { }} />
- -
-
-
- - - { - handleChange("useScriptCache", value); - }} - /> -
-
- {inputs.useScriptCache && ( -
-
-
- - -
- { - const v = value.length ? value : null; - handleChange("scriptCacheKey", v); + +
+
+
+ + + { + handleChange("useScriptCache", value); }} - value={inputs.scriptCacheKey ?? ""} - placeholder={ - placeholders["scripts"]["scriptKey"] - } - className="nopan text-xs" />
-
-
- - - { - handleChange("aiFallback", value); +
+ {inputs.useScriptCache && ( +
+
+
+ + +
+ { + const v = value.length ? value : null; + handleChange("scriptCacheKey", v); }} + value={inputs.scriptCacheKey ?? ""} + placeholder={ + placeholders["scripts"]["scriptKey"] + } + className="nopan text-xs" />
+
+
+ + + { + handleChange("aiFallback", value); + }} + /> +
+
-
- )} -
+ )} +
+
diff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.py index a554b3ee..b685ce21 100644 --- a/skyvern/forge/sdk/workflow/service.py +++ b/skyvern/forge/sdk/workflow/service.py @@ -1701,6 +1701,7 @@ class WorkflowService: status=request.status, generate_script=request.generate_script, cache_key=request.cache_key, + ai_fallback=request.ai_fallback, ) # Keeping track of the new workflow id to delete it if an error occurs during the creation process new_workflow_id = workflow.workflow_id