Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
make cacheActions optional in DisableCache component; add disable cache toggle to Validation and V2Task blocks (#3722)
Jonathan Dobson0b05582cc791
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/DisableCache.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/DisableCache.tsxindex c46f53f7e..67067f995 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/DisableCache.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/DisableCache.tsx@@ -12,7 +12,7 @@ function DisableCache({onCacheActionsChange,onDisableCacheChange,}: {- cacheActions: boolean;+ cacheActions?: boolean;disableCache: boolean;editable: boolean;// --diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/Taskv2Node.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/Taskv2Node.tsxindex 79b623556..0238ad644 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/Taskv2Node.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/Taskv2Node.tsx@@ -26,6 +26,8 @@ import { useRerender } from "@/hooks/useRerender";import { BlockCodeEditor } from "@/routes/workflows/components/BlockCodeEditor";import { useBlockScriptStore } from "@/store/BlockScriptStore";+import { DisableCache } from "../DisableCache";+function Taskv2Node({ id, data, type }: NodeProps<Taskv2Node>) {const { editable, label } = data;const { blockLabel: urlBlockLabel } = useParams();@@ -49,6 +51,7 @@ function Taskv2Node({ id, data, type }: NodeProps<Taskv2Node>) {totpVerificationUrl: data.totpVerificationUrl,totpIdentifier: data.totpIdentifier,maxSteps: data.maxSteps,+ disableCache: data.disableCache,model: data.model,});@@ -167,6 +170,18 @@ function Taskv2Node({ id, data, type }: NodeProps<Taskv2Node>) {}}/></div>+ <Separator />+ <DisableCache+ disableCache={inputs.disableCache}+ editable={editable}+ onCacheActionsChange={(cacheActions) => {+ handleChange("cacheActions", cacheActions);+ }}+ onDisableCacheChange={(disableCache) => {+ handleChange("disableCache", disableCache);+ }}+ />+ <Separator /><div className="space-y-2"><div className="flex gap-2"><Label className="text-xs text-slate-300">diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.tsindex f701d9ca2..b3f477c53 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts@@ -11,6 +11,7 @@ export type Taskv2NodeData = NodeBaseData & {totpVerificationUrl: string | null;totpIdentifier: string | null;maxSteps: number | null;+ disableCache: boolean;maxScreenshotScrolls: number | null;};@@ -26,6 +27,7 @@ export const taskv2NodeDefaultData: Taskv2NodeData = {totpIdentifier: null,totpVerificationUrl: null,maxSteps: MAX_STEPS_DEFAULT,+ disableCache: false,model: null,maxScreenshotScrolls: null,};diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsxindex 6662e4b23..d0c92835d 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/ValidationNode.tsx@@ -39,6 +39,8 @@ import { statusIsRunningOrQueued } from "@/routes/tasks/types";import { useWorkflowRunQuery } from "@/routes/workflows/hooks/useWorkflowRunQuery";import { useRerender } from "@/hooks/useRerender";+import { DisableCache } from "../DisableCache";+function ValidationNode({ id, data, type }: NodeProps<ValidationNode>) {const { updateNodeData } = useReactFlow();const [facing, setFacing] = useState<"front" | "back">("front");@@ -58,6 +60,7 @@ function ValidationNode({ id, data, type }: NodeProps<ValidationNode>) {terminateCriterion: data.terminateCriterion,errorCodeMapping: data.errorCodeMapping,model: data.model,+ disableCache: data.disableCache,});const rerender = useRerender({ prefix: "accordian" });@@ -243,6 +246,16 @@ function ValidationNode({ id, data, type }: NodeProps<ValidationNode>) {/></div></div>+ <DisableCache+ disableCache={inputs.disableCache}+ editable={editable}+ onCacheActionsChange={(cacheActions) => {+ handleChange("cacheActions", cacheActions);+ }}+ onDisableCacheChange={(disableCache) => {+ handleChange("disableCache", disableCache);+ }}+ /></div></AccordionContent></AccordionItem>diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/types.tsindex 13a41fbac..d8ff2b935 100644--- a/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/types.ts+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/ValidationNode/types.ts@@ -6,6 +6,7 @@ export type ValidationNodeData = NodeBaseData & {terminateCriterion: string;errorCodeMapping: string;parameterKeys: Array<string>;+ disableCache: boolean;};export type ValidationNode = Node<ValidationNodeData, "validation">;@@ -19,6 +20,7 @@ export const validationNodeDefaultData: ValidationNodeData = {continueOnFailure: false,editable: true,parameterKeys: [],+ disableCache: false,model: null,};diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.tsindex 8fd9f0519..28a5ddd03 100644--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts@@ -264,6 +264,7 @@ function convertToNode(prompt: block.prompt,url: block.url ?? "",maxSteps: block.max_steps,+ disableCache: block.disable_cache ?? false,totpIdentifier: block.totp_identifier,totpVerificationUrl: block.totp_verification_url,maxScreenshotScrolls: null,@@ -281,6 +282,7 @@ function convertToNode(completeCriterion: block.complete_criterion ?? "",terminateCriterion: block.terminate_criterion ?? "",parameterKeys: block.parameters.map((p) => p.key),+ disableCache: block.disable_cache ?? false,},};}diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.tsindex c91162049..0e692f373 100644--- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts+++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts@@ -318,6 +318,7 @@ export type Taskv2Block = WorkflowBlockBase & {totp_verification_url: string | null;totp_identifier: string | null;max_steps: number | null;+ disable_cache: boolean;};export type ForLoopBlock = WorkflowBlockBase & {@@ -391,6 +392,7 @@ export type ValidationBlock = WorkflowBlockBase & {terminate_criterion: string | null;error_code_mapping: Record<string, string> | null;parameters: Array<WorkflowParameter>;+ disable_cache?: boolean;};export type ActionBlock = WorkflowBlockBase & {