Skip to content

Automate browser based workflows with AI

denpendent run frontend (#3462)

LawyZheng31a9fe19bc0b
diff --git a/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx b/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx
index d7e7a1aa3..393bd0074 100644
--- a/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx
+++ b/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx
@@ -64,6 +64,7 @@ function Debugger() {
useScriptCache: workflow.generate_script,
scriptCacheKey: workflow.cache_key,
aiFallback: workflow.ai_fallback ?? true,
+ runSequentially: workflow.run_sequentially ?? false,
};
const elements = getElements(
diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
index 87678e1a2..2ac522f42 100644
--- a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx
@@ -65,6 +65,7 @@ function WorkflowEditor() {
useScriptCache: workflow.generate_script,
scriptCacheKey: workflow.cache_key,
aiFallback: workflow.ai_fallback ?? true,
+ runSequentially: workflow.run_sequentially ?? false,
};
const elements = getElements(
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 f63a0a384..2e4826775 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx
@@ -75,6 +75,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
+ runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
});
const [facing, setFacing] = useState<"front" | "back">("front");
@@ -254,6 +255,19 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
</div>
)}
</div>
+ <div className="space-y-2">
+ <div className="flex items-center gap-2">
+ <Label>Run Sequentially</Label>
+ <HelpTooltip content="Run the workflow in a sequential order" />
+ <Switch
+ className="ml-auto"
+ checked={inputs.runSequentially}
+ onCheckedChange={(value) => {
+ handleChange("runSequentially", value);
+ }}
+ />
+ </div>
+ </div>
<div className="space-y-2">
<div className="flex items-center gap-2">
<Label>Save &amp; Reuse Session</Label>
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 dc4b17ee8..19115af34 100644
--- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts
@@ -15,6 +15,7 @@ export type WorkflowStartNodeData = {
useScriptCache: boolean;
scriptCacheKey: string | null;
aiFallback: boolean;
+ runSequentially: boolean;
label: "__start_block__";
showCode: boolean;
};
diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
index 2ca36e87e..1d5d62148 100644
--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
@@ -708,6 +708,7 @@ function getElements(
aiFallback: settings.aiFallback ?? true,
label: "__start_block__",
showCode: false,
+ runSequentially: settings.runSequentially,
}),
);
@@ -1418,6 +1419,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
useScriptCache: false,
scriptCacheKey: null,
aiFallback: true,
+ runSequentially: false,
};
const startNodes = nodes.filter(isStartNode);
const startNodeWithWorkflowSettings = startNodes.find(
@@ -1438,6 +1440,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
useScriptCache: data.useScriptCache,
scriptCacheKey: data.scriptCacheKey,
aiFallback: data.aiFallback,
+ runSequentially: data.runSequentially,
};
}
return defaultSettings;
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
index 3f5e1aea7..790fb0d31 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
@@ -530,6 +530,7 @@ export type WorkflowApiResponse = {
generate_script: boolean;
cache_key: string | null;
ai_fallback: boolean | null;
+ run_sequentially: boolean | null;
};
export type WorkflowSettings = {
@@ -542,6 +543,7 @@ export type WorkflowSettings = {
useScriptCache: boolean;
scriptCacheKey: string | null;
aiFallback: boolean | null;
+ runSequentially: boolean;
};
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;
diff --git a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
index 72e0db9f1..ee02c8b20 100644
--- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
+++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts
@@ -17,6 +17,7 @@ export type WorkflowCreateYAMLRequest = {
generate_script?: boolean;
cache_key?: string | null;
ai_fallback?: boolean;
+ run_sequentially?: boolean;
};
export type WorkflowDefinitionYAML = {
diff --git a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
index 991a5af23..c1064df4e 100644
--- a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
+++ b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts
@@ -122,6 +122,7 @@ const useWorkflowSave = () => {
blocks: saveData.blocks,
},
is_saved_task: saveData.workflow.is_saved_task,
+ run_sequentially: saveData.settings.runSequentially,
};
const yaml = convertToYAML(requestBody);