diff --git a/skyvern-frontend/src/api/types.ts b/skyvern-frontend/src/api/types.ts index 452675af..f7196054 100644 --- a/skyvern-frontend/src/api/types.ts +++ b/skyvern-frontend/src/api/types.ts @@ -486,3 +486,5 @@ export type RunEngine = (typeof RunEngine)[keyof typeof RunEngine]; export type PylonEmailHash = { hash: string; }; + +export const BROWSER_DOWNLOAD_TIMEOUT_SECONDS = 600 as const; diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx index bfc81a1b..c7370c1b 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/FileDownloadNode.tsx @@ -40,6 +40,7 @@ import { useParams } from "react-router-dom"; import { statusIsRunningOrQueued } from "@/routes/tasks/types"; import { useWorkflowRunQuery } from "@/routes/workflows/hooks/useWorkflowRunQuery"; import { useRerender } from "@/hooks/useRerender"; +import { BROWSER_DOWNLOAD_TIMEOUT_SECONDS } from "@/api/types"; const urlTooltip = "The URL Skyvern is navigating to. Leave this field blank to pick up from where the last block left off."; @@ -74,6 +75,7 @@ function FileDownloadNode({ id, data }: NodeProps) { totpIdentifier: data.totpIdentifier, engine: data.engine, model: data.model, + downloadTimeout: data.downloadTimeout, }); const rerender = useRerender({ prefix: "accordian" }); const nodes = useNodes(); @@ -84,6 +86,7 @@ function FileDownloadNode({ id, data }: NodeProps) { if (!editable) { return; } + setInputs({ ...inputs, [key]: value }); updateNodeData(id, { [key]: value }); } @@ -164,6 +167,32 @@ function FileDownloadNode({ id, data }: NodeProps) { className="nopan text-xs" /> +
+
+ + + + { + const value = + event.target.value === "" + ? null + : Number(event.target.value); + + if (value) { + handleChange("downloadTimeout", value); + } + }} + /> +
+
Once the file is downloaded, this block will complete.
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/types.ts index 098bad49..9f04e975 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/types.ts +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/FileDownloadNode/types.ts @@ -15,6 +15,7 @@ export type FileDownloadNodeData = NodeBaseData & { totpIdentifier: string | null; engine: RunEngine | null; cacheActions: boolean; + downloadTimeout: number | null; }; export type FileDownloadNode = Node; @@ -36,6 +37,7 @@ export const fileDownloadNodeDefaultData: FileDownloadNodeData = { cacheActions: false, engine: RunEngine.SkyvernV1, model: null, + downloadTimeout: null, } as const; export function isFileDownloadNode(node: Node): node is FileDownloadNode { diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts index 29bc8737..c1967aed 100644 --- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts +++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts @@ -402,6 +402,7 @@ function convertToNode( cacheActions: block.cache_actions, maxStepsOverride: block.max_steps_per_run ?? null, engine: block.engine ?? RunEngine.SkyvernV1, + downloadTimeout: block.download_timeout ?? null, // seconds }, }; } @@ -1213,6 +1214,7 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML { totp_verification_url: node.data.totpVerificationUrl, cache_actions: node.data.cacheActions, engine: node.data.engine, + download_timeout: node.data.downloadTimeout, // seconds }; } case "sendEmail": { @@ -1991,6 +1993,7 @@ function convertBlocksToBlockYAML( totp_verification_url: block.totp_verification_url, cache_actions: block.cache_actions, engine: block.engine, + download_timeout: null, // seconds }; return blockYaml; } diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts index 7192e9ff..f1c79b3c 100644 --- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts +++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts @@ -478,6 +478,7 @@ export type FileDownloadBlock = WorkflowBlockBase & { totp_identifier?: string | null; cache_actions: boolean; engine: RunEngine | null; + download_timeout: number | null; // seconds }; export type PDFParserBlock = WorkflowBlockBase & { diff --git a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts index 43bb0c04..1b0180ee 100644 --- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts +++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts @@ -269,6 +269,7 @@ export type FileDownloadBlockYAML = BlockYAMLBase & { totp_identifier?: string | null; cache_actions: boolean; engine: RunEngine | null; + download_timeout?: number | null; }; export type CodeBlockYAML = BlockYAMLBase & {