Skip to content

Automate browser based workflows with AI

rename variable (#2865)

Shuchang Zheng393387acb0ca
diff --git a/skyvern-frontend/src/api/types.ts b/skyvern-frontend/src/api/types.ts
index 0f1490d6b..f70168251 100644
--- a/skyvern-frontend/src/api/types.ts
+++ b/skyvern-frontend/src/api/types.ts
@@ -143,7 +143,7 @@ export type CreateTaskRequest = {
totp_identifier?: string | null;
application?: string | null;
include_action_history_in_verification?: boolean | null;
- max_screenshot_scrolling_times?: number | null;
+ max_screenshot_scrolls?: number | null;
};
export type User = {
@@ -298,7 +298,7 @@ export type WorkflowRunStatusApiResponse = {
task_v2: TaskV2 | null;
workflow_title: string | null;
browser_session_id: string | null;
- max_screenshot_scrolling_times: number | null;
+ max_screenshot_scrolls: number | null;
};
export type TaskGenerationApiResponse = {
diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
index 8ed87eb05..19c851987 100644
--- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
@@ -40,7 +40,7 @@ import {
} from "./taskFormTypes";
import { ProxySelector } from "@/components/ProxySelector";
import { Switch } from "@/components/ui/switch";
-import { MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT } from "@/routes/workflows/editor/nodes/Taskv2Node/types";
+import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "@/routes/workflows/editor/nodes/Taskv2Node/types";
type Props = {
initialValues: CreateNewTaskFormValues;
};
@@ -91,7 +91,7 @@ function createTaskRequestObject(
extra_http_headers: extraHttpHeaders,
totp_identifier: transform(formValues.totpIdentifier),
error_code_mapping: errorCodeMapping,
- max_screenshot_scrolling_times: formValues.maxScreenshotScrollingTimes,
+ max_screenshot_scrolls: formValues.maxScreenshotScrolls,
include_action_history_in_verification:
formValues.includeActionHistoryInVerification,
};
@@ -126,8 +126,7 @@ function CreateNewTaskForm({ initialValues }: Props) {
...initialValues,
maxStepsOverride: initialValues.maxStepsOverride ?? null,
proxyLocation: initialValues.proxyLocation ?? ProxyLocation.Residential,
- maxScreenshotScrollingTimes:
- initialValues.maxScreenshotScrollingTimes ?? null,
+ maxScreenshotScrolls: initialValues.maxScreenshotScrolls ?? null,
},
});
const { errors } = useFormState({ control: form.control });
@@ -573,17 +572,15 @@ function CreateNewTaskForm({ initialValues }: Props) {
/>
<FormField
control={form.control}
- name="maxScreenshotScrollingTimes"
+ name="maxScreenshotScrolls"
render={({ field }) => (
<FormItem>
<div className="flex gap-16">
<FormLabel>
<div className="w-72">
- <h1 className="text-lg">
- Max Scrolling Screenshots
- </h1>
+ <h1 className="text-lg">Max Screenshot Scrolls</h1>
<h2 className="text-base text-slate-400">
- {`The maximum number of times to scroll down the page to take merged screenshots after action. Default is ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
+ {`The maximum number of scrolls for the post action screenshot. Default is ${MAX_SCREENSHOT_SCROLLS_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
</h2>
</div>
</FormLabel>
@@ -594,7 +591,7 @@ function CreateNewTaskForm({ initialValues }: Props) {
type="number"
min={0}
value={field.value ?? ""}
- placeholder={`Default: ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}`}
+ placeholder={`Default: ${MAX_SCREENSHOT_SCROLLS_DEFAULT}`}
onChange={(event) => {
const value =
event.target.value === ""
diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx
index 4736aa569..c5fc6e998 100644
--- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx
@@ -62,7 +62,7 @@ function CreateNewTaskFormPage() {
webhookCallbackUrl: null,
proxyLocation: null,
includeActionHistoryInVerification: null,
- maxScreenshotScrollingTimes: null,
+ maxScreenshotScrolls: null,
extraHttpHeaders: null,
}}
/>
@@ -133,7 +133,7 @@ function CreateNewTaskFormPage() {
includeActionHistoryInVerification:
data.workflow_definition.blocks[0]
.include_action_history_in_verification,
- maxScreenshotScrollingTimes: data.max_screenshot_scrolling_times,
+ maxScreenshotScrolls: data.max_screenshot_scrolls,
extraHttpHeaders: data.extra_http_headers
? JSON.stringify(data.extra_http_headers)
: null,
diff --git a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
index 8e93e6050..6c63feb45 100644
--- a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
@@ -45,7 +45,7 @@ import {
} from "../data/sampleTaskData";
import { ExampleCasePill } from "./ExampleCasePill";
import {
- MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT,
+ MAX_SCREENSHOT_SCROLLS_DEFAULT,
MAX_STEPS_DEFAULT,
} from "@/routes/workflows/editor/nodes/Taskv2Node/types";
@@ -158,8 +158,9 @@ function PromptBox() {
const [publishWorkflow, setPublishWorkflow] = useState(false);
const [totpIdentifier, setTotpIdentifier] = useState("");
const [maxStepsOverride, setMaxStepsOverride] = useState<string | null>(null);
- const [maxScreenshotScrollingTimes, setMaxScreenshotScrollingTimes] =
- useState<string | null>(null);
+ const [maxScreenshotScrolls, setMaxScreenshotScrolls] = useState<
+ string | null
+ >(null);
const [showAdvancedSettings, setShowAdvancedSettings] = useState(false);
const [dataSchema, setDataSchema] = useState<string | null>(null);
const [extraHttpHeaders, setExtraHttpHeaders] = useState<string | null>(null);
@@ -176,7 +177,7 @@ function PromptBox() {
browser_session_id: browserSessionId,
totp_identifier: totpIdentifier,
publish_workflow: publishWorkflow,
- max_screenshot_scrolling_times: maxScreenshotScrollingTimes,
+ max_screenshot_scrolls: maxScreenshotScrolls,
extracted_information_schema: dataSchema
? (() => {
try {
@@ -498,16 +499,16 @@ function PromptBox() {
</div>
<div className="flex gap-16">
<div className="w-48 shrink-0">
- <div className="text-sm">Max Scrolling Screenshots</div>
+ <div className="text-sm">Max Screenshot Scrolls</div>
<div className="text-xs text-slate-400">
- {`The maximum number of times to scroll down the page to take merged screenshots after action. Default is ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
+ {`The maximum number of scrolls for the post action screenshot. Default is ${MAX_SCREENSHOT_SCROLLS_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
</div>
</div>
<Input
- value={maxScreenshotScrollingTimes ?? ""}
- placeholder={`Default: ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}`}
+ value={maxScreenshotScrolls ?? ""}
+ placeholder={`Default: ${MAX_SCREENSHOT_SCROLLS_DEFAULT}`}
onChange={(event) => {
- setMaxScreenshotScrollingTimes(event.target.value);
+ setMaxScreenshotScrolls(event.target.value);
}}
/>
</div>
diff --git a/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx b/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx
index 4aef9d769..e9b011537 100644
--- a/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx
@@ -44,8 +44,7 @@ function RetryTask() {
proxyLocation: task.request.proxy_location ?? null,
includeActionHistoryInVerification:
task.request.include_action_history_in_verification ?? false,
- maxScreenshotScrollingTimes:
- task.request.max_screenshot_scrolling_times ?? null,
+ maxScreenshotScrolls: task.request.max_screenshot_scrolls ?? null,
extraHttpHeaders: task.request.extra_http_headers
? JSON.stringify(task.request.extra_http_headers)
: null,
diff --git a/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts b/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts
index e65631ed8..fa52bf53e 100644
--- a/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts
+++ b/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts
@@ -16,7 +16,7 @@ const createNewTaskFormSchemaBase = z.object({
errorCodeMapping: z.string().or(z.null()),
proxyLocation: z.nativeEnum(ProxyLocation).or(z.null()),
includeActionHistoryInVerification: z.boolean().or(z.null()).default(false),
- maxScreenshotScrollingTimes: z.number().or(z.null()).default(null),
+ maxScreenshotScrolls: z.number().or(z.null()).default(null),
});
const savedTaskFormSchemaBase = createNewTaskFormSchemaBase.extend({
diff --git a/skyvern-frontend/src/routes/tasks/detail/TaskParameters.tsx b/skyvern-frontend/src/routes/tasks/detail/TaskParameters.tsx
index f627a11d7..b13c5a85e 100644
--- a/skyvern-frontend/src/routes/tasks/detail/TaskParameters.tsx
+++ b/skyvern-frontend/src/routes/tasks/detail/TaskParameters.tsx
@@ -7,7 +7,7 @@ import { Skeleton } from "@/components/ui/skeleton";
import { Switch } from "@/components/ui/switch";
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { CodeEditor } from "@/routes/workflows/components/CodeEditor";
-import { MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT } from "@/routes/workflows/editor/nodes/Taskv2Node/types";
+import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "@/routes/workflows/editor/nodes/Taskv2Node/types";
import { useQuery } from "@tanstack/react-query";
import { useParams } from "react-router-dom";
@@ -147,14 +147,14 @@ function TaskParameters() {
</div>
<div className="flex gap-16">
<div className="w-72">
- <h1 className="text-lg">Max Scrolling Screenshots</h1>
+ <h1 className="text-lg">Max Screenshot Scrolls</h1>
<h2 className="text-base text-slate-400">
The maximum number of times to scroll the page
</h2>
</div>
<Input
- placeholder={`Default: ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}`}
- value={task.request.max_screenshot_scrolling_times ?? ""}
+ placeholder={`Default: ${MAX_SCREENSHOT_SCROLLS_DEFAULT}`}
+ value={task.request.max_screenshot_scrolls ?? ""}
readOnly
/>
</div>
diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
index 854774d96..11f1c50c6 100644
--- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
+++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
@@ -29,14 +29,14 @@ import { WorkflowParameter } from "./types/workflowTypes";
import { WorkflowParameterInput } from "./WorkflowParameterInput";
import { AxiosError } from "axios";
import { getLabelForWorkflowParameterType } from "./editor/workflowEditorUtils";
-import { MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT } from "./editor/nodes/Taskv2Node/types";
+import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "./editor/nodes/Taskv2Node/types";
type Props = {
workflowParameters: Array<WorkflowParameter>;
initialValues: Record<string, unknown>;
initialSettings: {
proxyLocation: ProxyLocation;
webhookCallbackUrl: string;
- maxScreenshotScrollingTimes: number | null;
+ maxScreenshotScrolls: number | null;
extraHttpHeaders: Record<string, string> | null;
};
};
@@ -77,7 +77,7 @@ type RunWorkflowRequestBody = {
proxy_location: ProxyLocation | null;
webhook_callback_url?: string | null;
browser_session_id: string | null;
- max_screenshot_scrolling_times?: number | null;
+ max_screenshot_scrolls?: number | null;
extra_http_headers?: Record<string, string> | null;
};
@@ -89,7 +89,7 @@ function getRunWorkflowRequestBody(
webhookCallbackUrl,
proxyLocation,
browserSessionId,
- maxScreenshotScrollingTimes,
+ maxScreenshotScrolls,
extraHttpHeaders,
...parameters
} = values;
@@ -107,8 +107,8 @@ function getRunWorkflowRequestBody(
browser_session_id: bsi,
};
- if (maxScreenshotScrollingTimes) {
- body.max_screenshot_scrolling_times = maxScreenshotScrollingTimes;
+ if (maxScreenshotScrolls) {
+ body.max_screenshot_scrolls = maxScreenshotScrolls;
}
if (webhookCallbackUrl) {
@@ -131,7 +131,7 @@ type RunWorkflowFormType = Record<string, unknown> & {
webhookCallbackUrl: string;
proxyLocation: ProxyLocation;
browserSessionId: string | null;
- maxScreenshotScrollingTimes: number | null;
+ maxScreenshotScrolls: number | null;
extraHttpHeaders: string | null;
};
@@ -154,7 +154,7 @@ function RunWorkflowForm({
webhookCallbackUrl: initialSettings.webhookCallbackUrl,
proxyLocation: initialSettings.proxyLocation,
browserSessionId: browserSessionIdDefault,
- maxScreenshotScrollingTimes: initialSettings.maxScreenshotScrollingTimes,
+ maxScreenshotScrolls: initialSettings.maxScreenshotScrolls,
extraHttpHeaders: initialSettings.extraHttpHeaders
? JSON.stringify(initialSettings.extraHttpHeaders)
: null,
@@ -208,7 +208,7 @@ function RunWorkflowForm({
webhookCallbackUrl,
proxyLocation,
browserSessionId,
- maxScreenshotScrollingTimes,
+ maxScreenshotScrolls,
extraHttpHeaders,
...parameters
} = values;
@@ -222,7 +222,7 @@ function RunWorkflowForm({
webhookCallbackUrl,
proxyLocation,
browserSessionId,
- maxScreenshotScrollingTimes,
+ maxScreenshotScrolls,
extraHttpHeaders,
});
}
@@ -462,9 +462,9 @@ function RunWorkflowForm({
}}
/>
<FormField
- key="maxScreenshotScrollingTimes"
+ key="maxScreenshotScrolls"
control={form.control}
- name="maxScreenshotScrollingTimes"
+ name="maxScreenshotScrolls"
render={({ field }) => {
return (
<FormItem>
@@ -472,10 +472,10 @@ function RunWorkflowForm({
<FormLabel>
<div className="w-72">
<div className="flex items-center gap-2 text-lg">
- Max Scrolling Screenshots
+ Max Screenshot Scrolls
</div>
<h2 className="text-sm text-slate-400">
- {`The maximum number of times to scroll down the page to take merged screenshots after action. Default is ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
+ {`The maximum number of scrolls for the post action screenshot. Default is ${MAX_SCREENSHOT_SCROLLS_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
</h2>
</div>
</FormLabel>
@@ -486,7 +486,7 @@ function RunWorkflowForm({
type="number"
min={0}
value={field.value ?? ""}
- placeholder={`Default: ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}`}
+ placeholder={`Default: ${MAX_SCREENSHOT_SCROLLS_DEFAULT}`}
onChange={(event) => {
const value =
event.target.value === ""
diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx
index deb39eee5..a9013894f 100644
--- a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx
+++ b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx
@@ -100,8 +100,7 @@ function WorkflowRun() {
const parameters = workflowRun?.parameters ?? {};
const proxyLocation =
workflowRun?.proxy_location ?? ProxyLocation.Residential;
- const maxScreenshotScrollingTimes =
- workflowRun?.max_screenshot_scrolling_times ?? null;
+ const maxScreenshotScrolls = workflowRun?.max_screenshot_scrolls ?? null;
const title = workflowIsLoading ? (
<Skeleton className="h-9 w-48" />
@@ -246,7 +245,7 @@ function WorkflowRun() {
data: parameters,
proxyLocation,
webhookCallbackUrl: workflowRun?.webhook_callback_url ?? "",
- maxScreenshotScrollingTimes,
+ maxScreenshotScrolls,
}}
>
<PlayIcon className="mr-2 h-4 w-4" />
diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
index 8c29e7bd1..ad3a51603 100644
--- a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
+++ b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
@@ -30,8 +30,7 @@ function WorkflowRunParameters() {
const proxyLocation = location.state
? (location.state.proxyLocation as ProxyLocation)
: null;
- const maxScreenshotScrollingTimes =
- location.state?.maxScreenshotScrollingTimes ?? null;
+ const maxScreenshotScrolls = location.state?.maxScreenshotScrolls ?? null;
const webhookCallbackUrl = location.state
? (location.state.webhookCallbackUrl as string)
@@ -115,10 +114,8 @@ function WorkflowRunParameters() {
ProxyLocation.Residential,
webhookCallbackUrl:
webhookCallbackUrl ?? workflow.webhook_callback_url ?? "",
- maxScreenshotScrollingTimes:
- maxScreenshotScrollingTimes ??
- workflow.max_screenshot_scrolling_times ??
- null,
+ maxScreenshotScrolls:
+ maxScreenshotScrolls ?? workflow.max_screenshot_scrolls ?? null,
extraHttpHeaders:
extraHttpHeaders ?? workflow.extra_http_headers ?? null,
}}
diff --git a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
index d5486c518..d1da54465 100644
--- a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx
@@ -322,8 +322,7 @@ function FlowRenderer({
webhook_callback_url: data.settings.webhookCallbackUrl,
persist_browser_session: data.settings.persistBrowserSession,
model: data.settings.model,
- max_screenshot_scrolling_times:
- data.settings.maxScreenshotScrollingTimes,
+ max_screenshot_scrolls: data.settings.maxScreenshotScrolls,
totp_verification_url: workflow.totp_verification_url,
extra_http_headers: extraHttpHeaders,
workflow_definition: {
diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
index 7cbf84de3..f8b496600 100644
--- a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
@@ -60,7 +60,7 @@ function WorkflowEditor() {
proxyLocation: workflow.proxy_location,
webhookCallbackUrl: workflow.webhook_callback_url,
model: workflow.model,
- maxScreenshotScrollingTimes: workflow.max_screenshot_scrolling_times,
+ maxScreenshotScrolls: workflow.max_screenshot_scrolls,
extraHttpHeaders: workflow.extra_http_headers
? JSON.stringify(workflow.extra_http_headers)
: null,
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
index 18a2b8443..61bb961b9 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
@@ -20,7 +20,7 @@ import { Separator } from "@/components/ui/separator";
import { ModelsResponse } from "@/api/types";
import { ModelSelector } from "@/components/ModelSelector";
import { WorkflowModel } from "@/routes/workflows/types/workflowTypes";
-import { MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT } from "../Taskv2Node/types";
+import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "../Taskv2Node/types";
import { KeyValueInput } from "@/components/KeyValueInput";
function StartNode({ id, data }: NodeProps<StartNode>) {
@@ -53,8 +53,8 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
? data.persistBrowserSession
: false,
model: data.withWorkflowSettings ? data.model : workflowModel,
- maxScreenshotScrollingTimes: data.withWorkflowSettings
- ? data.maxScreenshotScrollingTimes
+ maxScreenshotScrolls: data.withWorkflowSettings
+ ? data.maxScreenshotScrolls
: null,
extraHttpHeaders: data.withWorkflowSettings ? data.extraHttpHeaders : null,
});
@@ -151,21 +151,21 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
</div>
<div className="space-y-2">
<div className="flex items-center gap-2">
- <Label>Max Scrolling Screenshots</Label>
+ <Label>Max Screenshot Scrolls</Label>
<HelpTooltip
- content={`The maximum number of times to scroll down the page to take merged screenshots after action. Default is ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
+ content={`The maximum number of scrolls for the post action screenshot. Default is ${MAX_SCREENSHOT_SCROLLS_DEFAULT}. If it's set to 0, it will take the current viewport screenshot.`}
/>
</div>
<Input
- value={inputs.maxScreenshotScrollingTimes ?? ""}
- placeholder={`Default: ${MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT}`}
+ value={inputs.maxScreenshotScrolls ?? ""}
+ placeholder={`Default: ${MAX_SCREENSHOT_SCROLLS_DEFAULT}`}
onChange={(event) => {
const value =
event.target.value === ""
? null
: Number(event.target.value);
- handleChange("maxScreenshotScrollingTimes", value);
+ handleChange("maxScreenshotScrolls", value);
}}
/>
</div>
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts
index 44e65d85e..8982a9ab9 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts
@@ -9,7 +9,7 @@ export type WorkflowStartNodeData = {
proxyLocation: ProxyLocation;
persistBrowserSession: boolean;
model: WorkflowModel | null;
- maxScreenshotScrollingTimes: number | null;
+ maxScreenshotScrolls: number | null;
extraHttpHeaders: string | null;
editable: boolean;
};
diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts
index f3cc549b1..6a638a655 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/Taskv2Node/types.ts
@@ -2,7 +2,7 @@ import { Node } from "@xyflow/react";
import { NodeBaseData } from "../types";
export const MAX_STEPS_DEFAULT = 25;
-export const MAX_SCREENSHOT_SCROLLING_TIMES_DEFAULT = 3;
+export const MAX_SCREENSHOT_SCROLLS_DEFAULT = 3;
export type Taskv2NodeData = NodeBaseData & {
prompt: string;
@@ -10,7 +10,7 @@ export type Taskv2NodeData = NodeBaseData & {
totpVerificationUrl: string | null;
totpIdentifier: string | null;
maxSteps: number | null;
- maxScreenshotScrollingTimes: number | null;
+ maxScreenshotScrolls: number | null;
};
export type Taskv2Node = Node<Taskv2NodeData, "taskv2">;
@@ -25,7 +25,7 @@ export const taskv2NodeDefaultData: Taskv2NodeData = {
totpVerificationUrl: null,
maxSteps: MAX_STEPS_DEFAULT,
model: null,
- maxScreenshotScrollingTimes: null,
+ maxScreenshotScrolls: null,
};
export function isTaskV2Node(node: Node): node is Taskv2Node {
diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
index 801efaf2d..4ff1b5693 100644
--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
@@ -251,7 +251,7 @@ function convertToNode(
maxSteps: block.max_steps,
totpIdentifier: block.totp_identifier,
totpVerificationUrl: block.totp_verification_url,
- maxScreenshotScrollingTimes: null,
+ maxScreenshotScrolls: null,
},
};
}
@@ -663,7 +663,7 @@ function getElements(
proxyLocation: settings.proxyLocation ?? ProxyLocation.Residential,
webhookCallbackUrl: settings.webhookCallbackUrl ?? "",
model: settings.model,
- maxScreenshotScrollingTimes: settings.maxScreenshotScrollingTimes,
+ maxScreenshotScrolls: settings.maxScreenshotScrolls,
extraHttpHeaders: settings.extraHttpHeaders,
editable,
}),
@@ -1325,7 +1325,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
proxyLocation: ProxyLocation.Residential,
webhookCallbackUrl: null,
model: null,
- maxScreenshotScrollingTimes: null,
+ maxScreenshotScrolls: null,
extraHttpHeaders: null,
};
const startNodes = nodes.filter(isStartNode);
@@ -1342,7 +1342,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
proxyLocation: data.proxyLocation,
webhookCallbackUrl: data.webhookCallbackUrl,
model: data.model,
- maxScreenshotScrollingTimes: data.maxScreenshotScrollingTimes,
+ maxScreenshotScrolls: data.maxScreenshotScrolls,
extraHttpHeaders: data.extraHttpHeaders,
};
}
@@ -1999,7 +1999,7 @@ function convert(workflow: WorkflowApiResponse): WorkflowCreateYAMLRequest {
persist_browser_session: workflow.persist_browser_session,
model: workflow.model,
totp_verification_url: workflow.totp_verification_url,
- max_screenshot_scrolling_times: workflow.max_screenshot_scrolling_times,
+ max_screenshot_scrolls: workflow.max_screenshot_scrolls,
extra_http_headers: workflow.extra_http_headers,
workflow_definition: {
parameters: convertParametersToParameterYAML(userParameters),
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
index 2cd2e39bf..98bb0ef20 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
@@ -471,7 +471,7 @@ export type WorkflowApiResponse = {
model: WorkflowModel | null;
totp_verification_url: string | null;
totp_identifier: string | null;
- max_screenshot_scrolling_times: number | null;
+ max_screenshot_scrolls: number | null;
created_at: string;
modified_at: string;
deleted_at: string | null;
@@ -482,7 +482,7 @@ export type WorkflowSettings = {
webhookCallbackUrl: string | null;
persistBrowserSession: boolean;
model: WorkflowModel | null;
- maxScreenshotScrollingTimes: number | null;
+ maxScreenshotScrolls: number | null;
extraHttpHeaders: string | null;
};
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
index ddd040380..dbcad99a1 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
@@ -12,7 +12,7 @@ export type WorkflowCreateYAMLRequest = {
totp_verification_url?: string | null;
workflow_definition: WorkflowDefinitionYAML;
is_saved_task?: boolean;
- max_screenshot_scrolling_times?: number | null;
+ max_screenshot_scrolls?: number | null;
extra_http_headers?: Record<string, string> | null;
};
diff --git a/skyvern/constants.py b/skyvern/constants.py
index d65970ed8..54f63131d 100644
--- a/skyvern/constants.py
+++ b/skyvern/constants.py
@@ -20,7 +20,7 @@ AUTO_COMPLETION_POTENTIAL_VALUES_COUNT = 3
DROPDOWN_MENU_MAX_DISTANCE = 100
BROWSER_DOWNLOADING_SUFFIX = ".crdownload"
MAX_UPLOAD_FILE_COUNT = 50
-DEFAULT_MAX_SCREENSHOT_SCROLLING_TIMES = 3
+DEFAULT_MAX_SCREENSHOT_SCROLLS = 3
# reserved fields for navigation payload
SPECIAL_FIELD_VERIFICATION_CODE = "verification_code"
diff --git a/skyvern/forge/agent.py b/skyvern/forge/agent.py
index 8abbc2243..55eed339c 100644
--- a/skyvern/forge/agent.py
+++ b/skyvern/forge/agent.py
@@ -19,7 +19,7 @@ from skyvern import analytics
from skyvern.config import settings
from skyvern.constants import (
BROWSER_DOWNLOADING_SUFFIX,
- DEFAULT_MAX_SCREENSHOT_SCROLLING_TIMES,
+ DEFAULT_MAX_SCREENSHOT_SCROLLS,
GET_DOWNLOADED_FILES_TIMEOUT,
SAVE_DOWNLOADED_FILES_TIMEOUT,
SCRAPE_TYPE_ORDER,
@@ -183,7 +183,7 @@ class ForgeAgent:
error_code_mapping=task_block.error_code_mapping,
include_action_history_in_verification=task_block.include_action_history_in_verification,
model=task_block.model,
- max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolls,
extra_http_headers=workflow_run.extra_http_headers,
)
LOG.info(
@@ -241,7 +241,7 @@ class ForgeAgent:
application=task_request.application,
include_action_history_in_verification=task_request.include_action_history_in_verification,
model=task_request.model,
- max_screenshot_scrolling_times=task_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=task_request.max_screenshot_scrolls,
extra_http_headers=task_request.extra_http_headers,
)
LOG.info(
@@ -1662,9 +1662,9 @@ class ForgeAgent:
raise BrowserStateMissingPage()
context = skyvern_context.ensure_context()
- scrolling_number = context.max_screenshot_scrolling_times
+ scrolling_number = context.max_screenshot_scrolls
if scrolling_number is None:
- scrolling_number = DEFAULT_MAX_SCREENSHOT_SCROLLING_TIMES
+ scrolling_number = DEFAULT_MAX_SCREENSHOT_SCROLLS
if engine in CUA_ENGINES:
scrolling_number = 0
diff --git a/skyvern/forge/sdk/core/skyvern_context.py b/skyvern/forge/sdk/core/skyvern_context.py
index 195a7d0b1..2d150d448 100644
--- a/skyvern/forge/sdk/core/skyvern_context.py
+++ b/skyvern/forge/sdk/core/skyvern_context.py
@@ -24,8 +24,8 @@ class SkyvernContext:
hashed_href_map: dict[str, str] = field(default_factory=dict)
refresh_working_page: bool = False
frame_index_map: dict[Frame, int] = field(default_factory=dict)
- max_screenshot_scrolling_times: int | None = None
dropped_css_svg_element_map: dict[str, bool] = field(default_factory=dict)
+ max_screenshot_scrolls: int | None = None
def __repr__(self) -> str:
return f"SkyvernContext(request_id={self.request_id}, organization_id={self.organization_id}, task_id={self.task_id}, workflow_id={self.workflow_id}, workflow_run_id={self.workflow_run_id}, task_v2_id={self.task_v2_id}, max_steps_override={self.max_steps_override}, run_id={self.run_id})"
diff --git a/skyvern/forge/sdk/db/utils.py b/skyvern/forge/sdk/db/utils.py
index a739c5dd6..1cb6f65c6 100644
--- a/skyvern/forge/sdk/db/utils.py
+++ b/skyvern/forge/sdk/db/utils.py
@@ -143,7 +143,7 @@ def convert_to_task(task_obj: TaskModel, debug_enabled: bool = False, workflow_p
queued_at=task_obj.queued_at,
started_at=task_obj.started_at,
finished_at=task_obj.finished_at,
- max_screenshot_scrolling_times=task_obj.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=task_obj.max_screenshot_scrolling_times,
)
return task
@@ -240,7 +240,7 @@ def convert_to_workflow(workflow_model: WorkflowModel, debug_enabled: bool = Fal
persist_browser_session=workflow_model.persist_browser_session,
model=workflow_model.model,
proxy_location=(ProxyLocation(workflow_model.proxy_location) if workflow_model.proxy_location else None),
- max_screenshot_scrolling_times=workflow_model.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_model.max_screenshot_scrolling_times,
version=workflow_model.version,
is_saved_task=workflow_model.is_saved_task,
description=workflow_model.description,
@@ -282,7 +282,7 @@ def convert_to_workflow_run(
created_at=workflow_run_model.created_at,
modified_at=workflow_run_model.modified_at,
workflow_title=workflow_title,
- max_screenshot_scrolling_times=workflow_run_model.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_run_model.max_screenshot_scrolling_times,
extra_http_headers=workflow_run_model.extra_http_headers,
)
diff --git a/skyvern/forge/sdk/executor/async_executor.py b/skyvern/forge/sdk/executor/async_executor.py
index e27662458..788222aad 100644
--- a/skyvern/forge/sdk/executor/async_executor.py
+++ b/skyvern/forge/sdk/executor/async_executor.py
@@ -108,7 +108,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
context.run_id = context.run_id or task.task_id
context.organization_id = organization_id
context.max_steps_override = max_steps_override
- context.max_screenshot_scrolling_times = task.max_screenshot_scrolling_times
+ context.max_screenshot_scrolls = task.max_screenshot_scrolls
if background_tasks:
await initialize_skyvern_state_file(task_id=task_id, organization_id=organization_id)
diff --git a/skyvern/forge/sdk/routes/agent_protocol.py b/skyvern/forge/sdk/routes/agent_protocol.py
index de9625f2d..594d02b8c 100644
--- a/skyvern/forge/sdk/routes/agent_protocol.py
+++ b/skyvern/forge/sdk/routes/agent_protocol.py
@@ -167,7 +167,7 @@ async def run_task(
totp_identifier=run_request.totp_identifier,
include_action_history_in_verification=run_request.include_action_history_in_verification,
model=run_request.model,
- max_screenshot_scrolling_times=run_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=run_request.max_screenshot_scrolls,
extra_http_headers=run_request.extra_http_headers,
)
task_v1_response = await task_v1_service.run_task(
@@ -206,7 +206,7 @@ async def run_task(
data_extraction_schema=task_v1_response.extracted_information_schema,
error_code_mapping=task_v1_response.error_code_mapping,
browser_session_id=run_request.browser_session_id,
- max_screenshot_scrolling_times=run_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=run_request.max_screenshot_scrolls,
),
)
if run_request.engine == RunEngine.skyvern_v2:
@@ -225,7 +225,7 @@ async def run_task(
error_code_mapping=run_request.error_code_mapping,
create_task_run=True,
model=run_request.model,
- max_screenshot_scrolling_times=run_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=run_request.max_screenshot_scrolls,
extra_http_headers=run_request.extra_http_headers,
)
except MissingBrowserAddressError as e:
@@ -269,7 +269,7 @@ async def run_task(
error_code_mapping=task_v2.error_code_mapping,
data_extraction_schema=task_v2.extracted_information_schema,
publish_workflow=run_request.publish_workflow,
- max_screenshot_scrolling_times=run_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=run_request.max_screenshot_scrolls,
),
)
LOG.error("Invalid agent engine", engine=run_request.engine, organization_id=current_org.organization_id)
@@ -325,7 +325,7 @@ async def run_workflow(
totp_identifier=workflow_run_request.totp_identifier,
totp_verification_url=workflow_run_request.totp_url,
browser_session_id=workflow_run_request.browser_session_id,
- max_screenshot_scrolling_times=workflow_run_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_run_request.max_screenshot_scrolls,
extra_http_headers=workflow_run_request.extra_http_headers,
)
@@ -1878,7 +1878,7 @@ async def run_task_v2(
create_task_run=True,
extracted_information_schema=data.extracted_information_schema,
error_code_mapping=data.error_code_mapping,
- max_screenshot_scrolling_times=data.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=data.max_screenshot_scrolls,
browser_session_id=data.browser_session_id,
extra_http_headers=data.extra_http_headers,
)
diff --git a/skyvern/forge/sdk/schemas/task_v2.py b/skyvern/forge/sdk/schemas/task_v2.py
index fcf21ac5a..5169504f0 100644
--- a/skyvern/forge/sdk/schemas/task_v2.py
+++ b/skyvern/forge/sdk/schemas/task_v2.py
@@ -48,7 +48,7 @@ class TaskV2(BaseModel):
queued_at: datetime | None = None
started_at: datetime | None = None
finished_at: datetime | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = Field(default=None, alias="max_screenshot_scrolling_times")
extra_http_headers: dict[str, str] | None = None
created_at: datetime
@@ -150,7 +150,7 @@ class TaskV2Request(BaseModel):
publish_workflow: bool = False
extracted_information_schema: dict | list | str | None = None
error_code_mapping: dict[str, str] | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
extra_http_headers: dict[str, str] | None = None
@field_validator("url", "webhook_callback_url", "totp_verification_url")
diff --git a/skyvern/forge/sdk/schemas/tasks.py b/skyvern/forge/sdk/schemas/tasks.py
index 7d09d0cd8..06fc920b4 100644
--- a/skyvern/forge/sdk/schemas/tasks.py
+++ b/skyvern/forge/sdk/schemas/tasks.py
@@ -99,9 +99,9 @@ class TaskBase(BaseModel):
description="Whether to include the action history when verifying the task is complete",
examples=[True, False],
)
- max_screenshot_scrolling_times: int | None = Field(
+ max_screenshot_scrolls: int | None = Field(
default=None,
- description="Scroll down n times to get the merged screenshot of the page after taking an action. When it's None or 0, it takes the current viewpoint screenshot.",
+ description="The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.",
examples=[10],
)
@@ -322,7 +322,7 @@ class Task(TaskBase):
errors=self.errors,
max_steps_per_run=self.max_steps_per_run,
workflow_run_id=self.workflow_run_id,
- max_screenshot_scrolling_times=self.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=self.max_screenshot_scrolls,
)
@@ -346,7 +346,7 @@ class TaskResponse(BaseModel):
queued_at: datetime | None = None
started_at: datetime | None = None
finished_at: datetime | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
class TaskOutput(BaseModel):
diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.py
index 4af2bf1b3..76354d9ab 100644
--- a/skyvern/forge/sdk/workflow/models/block.py
+++ b/skyvern/forge/sdk/workflow/models/block.py
@@ -2522,7 +2522,7 @@ class TaskV2Block(Block):
proxy_location=workflow_run.proxy_location,
totp_identifier=self.totp_identifier,
totp_verification_url=self.totp_verification_url,
- max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolls,
)
await app.DATABASE.update_task_v2(
task_v2.observer_cruise_id, status=TaskV2Status.queued, organization_id=organization_id
@@ -2557,7 +2557,7 @@ class TaskV2Block(Block):
workflow_run_id=workflow_run_id,
run_id=current_run_id,
browser_session_id=browser_session_id,
- max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_run.max_screenshot_scrolls,
)
)
result_dict = None
diff --git a/skyvern/forge/sdk/workflow/models/workflow.py b/skyvern/forge/sdk/workflow/models/workflow.py
index ff285b253..c1077c02a 100644
--- a/skyvern/forge/sdk/workflow/models/workflow.py
+++ b/skyvern/forge/sdk/workflow/models/workflow.py
@@ -22,7 +22,7 @@ class WorkflowRequestBody(BaseModel):
totp_verification_url: str | None = None
totp_identifier: str | None = None
browser_session_id: str | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
extra_http_headers: dict[str, str] | None = None
@field_validator("webhook_callback_url", "totp_verification_url")
@@ -78,7 +78,7 @@ class Workflow(BaseModel):
persist_browser_session: bool = False
model: dict[str, Any] | None = None
status: WorkflowStatus = WorkflowStatus.published
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
extra_http_headers: dict[str, str] | None = None
created_at: datetime
@@ -120,7 +120,7 @@ class WorkflowRun(BaseModel):
failure_reason: str | None = None
parent_workflow_run_id: str | None = None
workflow_title: str | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
queued_at: datetime | None = None
started_at: datetime | None = None
@@ -169,4 +169,4 @@ class WorkflowRunResponseBase(BaseModel):
task_v2: TaskV2 | None = None
workflow_title: str | None = None
browser_session_id: str | None = None
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
diff --git a/skyvern/forge/sdk/workflow/models/yaml.py b/skyvern/forge/sdk/workflow/models/yaml.py
index f3f892f03..1ece3ca31 100644
--- a/skyvern/forge/sdk/workflow/models/yaml.py
+++ b/skyvern/forge/sdk/workflow/models/yaml.py
@@ -440,6 +440,6 @@ class WorkflowCreateYAMLRequest(BaseModel):
model: dict[str, Any] | None = None
workflow_definition: WorkflowDefinitionYAML
is_saved_task: bool = False
- max_screenshot_scrolling_times: int | None = None
+ max_screenshot_scrolls: int | None = None
extra_http_headers: dict[str, str] | None = None
status: WorkflowStatus = WorkflowStatus.published
diff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.py
index 0f541f2d7..11222a7f4 100644
--- a/skyvern/forge/sdk/workflow/service.py
+++ b/skyvern/forge/sdk/workflow/service.py
@@ -176,7 +176,7 @@ class WorkflowService:
organization_id=workflow.organization_id,
proxy_location=workflow_request.proxy_location,
webhook_callback_url=workflow_request.webhook_callback_url,
- max_screenshot_scrolling_times=workflow_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=workflow_request.max_screenshot_scrolls,
)
context: skyvern_context.SkyvernContext | None = skyvern_context.current()
current_run_id = context.run_id if context and context.run_id else workflow_run.workflow_run_id
@@ -190,7 +190,7 @@ class WorkflowService:
run_id=current_run_id,
workflow_permanent_id=workflow_run.workflow_permanent_id,
max_steps_override=max_steps_override,
- max_screenshot_scrolling_times=workflow_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_request.max_screenshot_scrolls,
)
)
@@ -788,7 +788,7 @@ class WorkflowService:
totp_verification_url=workflow_request.totp_verification_url,
totp_identifier=workflow_request.totp_identifier,
parent_workflow_run_id=parent_workflow_run_id,
- max_screenshot_scrolling_times=workflow_request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=workflow_request.max_screenshot_scrolls,
extra_http_headers=workflow_request.extra_http_headers,
)
@@ -1204,7 +1204,7 @@ class WorkflowService:
total_steps=total_steps,
total_cost=total_cost,
workflow_title=workflow.title,
- max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_run.max_screenshot_scrolls,
)
async def clean_up_workflow(
@@ -1478,7 +1478,7 @@ class WorkflowService:
totp_identifier=request.totp_identifier,
persist_browser_session=request.persist_browser_session,
model=request.model,
- max_screenshot_scrolling_times=request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=request.max_screenshot_scrolls,
extra_http_headers=request.extra_http_headers,
workflow_permanent_id=workflow_permanent_id,
version=existing_version + 1,
@@ -1497,7 +1497,7 @@ class WorkflowService:
totp_identifier=request.totp_identifier,
persist_browser_session=request.persist_browser_session,
model=request.model,
- max_screenshot_scrolling_times=request.max_screenshot_scrolling_times,
+ max_screenshot_scrolling_times=request.max_screenshot_scrolls,
extra_http_headers=request.extra_http_headers,
is_saved_task=request.is_saved_task,
status=request.status,
@@ -2114,7 +2114,7 @@ class WorkflowService:
),
proxy_location=proxy_location,
status=status,
- max_screenshot_scrolling_times=max_screenshot_scrolling_times,
+ max_screenshot_scrolls=max_screenshot_scrolling_times,
extra_http_headers=extra_http_headers,
)
return await app.WORKFLOW_SERVICE.create_workflow_from_request(
diff --git a/skyvern/schemas/runs.py b/skyvern/schemas/runs.py
index 663de8187..667d2bbe4 100644
--- a/skyvern/schemas/runs.py
+++ b/skyvern/schemas/runs.py
@@ -289,9 +289,9 @@ class TaskRunRequest(BaseModel):
include_action_history_in_verification: bool | None = Field(
default=False, description="Whether to include action history when verifying that the task is complete"
)
- max_screenshot_scrolling_times: int | None = Field(
+ max_screenshot_scrolls: int | None = Field(
default=None,
- description="Scroll down n times to get the merged screenshot of the page after taking an action. When it's None or 0, it takes the current viewpoint screenshot.",
+ description="The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.",
)
@field_validator("url", "webhook_url", "totp_url")
@@ -340,9 +340,9 @@ class WorkflowRunRequest(BaseModel):
default=None,
description="ID of a Skyvern browser session to reuse, having it continue from the current screen state",
)
- max_screenshot_scrolling_times: int | None = Field(
+ max_screenshot_scrolls: int | None = Field(
default=None,
- description="Scroll down n times to get the merged screenshot of the page after taking an action. When it's None or 0, it takes the current viewpoint screenshot.",
+ description="The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.",
)
extra_http_headers: dict[str, str] | None = Field(
default=None,
@@ -392,9 +392,9 @@ class BaseRunResponse(BaseModel):
browser_session_id: str | None = Field(
default=None, description="ID of the Skyvern persistent browser session used for this run", examples=["pbs_123"]
)
- max_screenshot_scrolling_times: int | None = Field(
+ max_screenshot_scrolls: int | None = Field(
default=None,
- description="Scroll down n times to get the merged screenshot of the page after taking an action. When it's NONE or 0, it takes the current view point screenshot.",
+ description="The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot",
)
diff --git a/skyvern/services/run_service.py b/skyvern/services/run_service.py
index 66f8d257f..dfa4e9285 100644
--- a/skyvern/services/run_service.py
+++ b/skyvern/services/run_service.py
@@ -67,7 +67,7 @@ async def get_run_response(run_id: str, organization_id: str | None = None) -> R
max_steps=task_v1_response.max_steps_per_run,
data_extraction_schema=task_v1_response.request.extracted_information_schema,
error_code_mapping=task_v1_response.request.error_code_mapping,
- max_screenshot_scrolling_times=task_v1_response.request.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=task_v1_response.request.max_screenshot_scrolls,
),
)
elif run.task_run_type == RunType.task_v2:
diff --git a/skyvern/services/task_v2_service.py b/skyvern/services/task_v2_service.py
index b450754ea..7326ad5a3 100644
--- a/skyvern/services/task_v2_service.py
+++ b/skyvern/services/task_v2_service.py
@@ -187,7 +187,7 @@ async def initialize_task_v2(
if context:
context.task_v2_id = task_v2.observer_cruise_id
context.run_id = context.run_id or task_v2.observer_cruise_id
- context.max_screenshot_scrolling_times = max_screenshot_scrolling_times
+ context.max_screenshot_scrolls = max_screenshot_scrolling_times
thought = await app.DATABASE.create_thought(
task_v2_id=task_v2.observer_cruise_id,
@@ -231,7 +231,7 @@ async def initialize_task_v2(
workflow_run = await app.WORKFLOW_SERVICE.setup_workflow_run(
request_id=None,
workflow_request=WorkflowRequestBody(
- max_screenshot_scrolling_times=max_screenshot_scrolling_times,
+ max_screenshot_scrolls=max_screenshot_scrolling_times,
browser_session_id=browser_session_id,
extra_http_headers=extra_http_headers,
),
@@ -470,7 +470,7 @@ async def run_task_v2_helper(
task_v2_id=task_v2_id,
run_id=current_run_id,
browser_session_id=browser_session_id,
- max_screenshot_scrolling_times=task_v2.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=task_v2.max_screenshot_scrolls,
)
)
@@ -788,7 +788,7 @@ async def run_task_v2_helper(
proxy_location=task_v2.proxy_location or ProxyLocation.RESIDENTIAL,
workflow_definition=workflow_definition_yaml,
status=workflow.status,
- max_screenshot_scrolling_times=task_v2.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=task_v2.max_screenshot_scrolls,
)
LOG.info("Creating workflow from request", workflow_create_request=workflow_create_request)
workflow = await app.WORKFLOW_SERVICE.create_workflow_from_request(
diff --git a/skyvern/services/workflow_service.py b/skyvern/services/workflow_service.py
index 47fd5ec0a..e7200e68c 100644
--- a/skyvern/services/workflow_service.py
+++ b/skyvern/services/workflow_service.py
@@ -97,7 +97,7 @@ async def get_workflow_run_response(
webhook_url=workflow_run.webhook_callback_url or None,
totp_url=workflow_run.totp_verification_url or None,
totp_identifier=workflow_run.totp_identifier,
- max_screenshot_scrolling_times=workflow_run.max_screenshot_scrolling_times,
+ max_screenshot_scrolls=workflow_run.max_screenshot_scrolls,
# TODO: add browser session id
),
)