diff --git a/skyvern-frontend/src/routes/workflows/components/WorkflowVisualComparisonDrawer.tsx b/skyvern-frontend/src/routes/workflows/components/WorkflowVisualComparisonDrawer.tsx index 673648f3..797b51f8 100644 --- a/skyvern-frontend/src/routes/workflows/components/WorkflowVisualComparisonDrawer.tsx +++ b/skyvern-frontend/src/routes/workflows/components/WorkflowVisualComparisonDrawer.tsx @@ -128,6 +128,7 @@ function getWorkflowElements(version: WorkflowVersion) { scriptCacheKey: version.cache_key, aiFallback: version.ai_fallback ?? true, runSequentially: version.run_sequentially ?? false, + sequentialKey: version.sequential_key ?? null, }; return getElements( diff --git a/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx b/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx index 393bd007..b001550d 100644 --- a/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx +++ b/skyvern-frontend/src/routes/workflows/debugger/Debugger.tsx @@ -65,6 +65,7 @@ function Debugger() { scriptCacheKey: workflow.cache_key, aiFallback: workflow.ai_fallback ?? true, runSequentially: workflow.run_sequentially ?? false, + sequentialKey: workflow.sequential_key ?? null, }; const elements = getElements( diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx index 2ac522f4..b7aae90f 100644 --- a/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowEditor.tsx @@ -66,6 +66,7 @@ function WorkflowEditor() { scriptCacheKey: workflow.cache_key, aiFallback: workflow.ai_fallback ?? true, runSequentially: workflow.run_sequentially ?? false, + sequentialKey: workflow.sequential_key ?? null, }; const elements = getElements( diff --git a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx index c2f04a56..1d26f313 100644 --- a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx @@ -687,6 +687,7 @@ function Workspace({ scriptCacheKey: selectedVersion.cache_key, aiFallback: selectedVersion.ai_fallback ?? true, runSequentially: selectedVersion.run_sequentially ?? false, + sequentialKey: selectedVersion.sequential_key ?? null, }; const elements = getElements( diff --git a/skyvern-frontend/src/routes/workflows/editor/helpContent.ts b/skyvern-frontend/src/routes/workflows/editor/helpContent.ts index f4bf0267..37377740 100644 --- a/skyvern-frontend/src/routes/workflows/editor/helpContent.ts +++ b/skyvern-frontend/src/routes/workflows/editor/helpContent.ts @@ -183,4 +183,5 @@ export const placeholders = { scripts: { scriptKey: "my-{{param1}}-{{param2}}-key", }, + sequentialKey: "my-{{param1}}-{{param2}}-sequential", }; 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 235c0b89..f3d067c2 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx @@ -76,6 +76,7 @@ function StartNode({ id, data }: NodeProps) { scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null, aiFallback: data.withWorkflowSettings ? data.aiFallback : true, runSequentially: data.withWorkflowSettings ? data.runSequentially : false, + sequentialKey: data.withWorkflowSettings ? data.sequentialKey : null, }); const [facing, setFacing] = useState<"front" | "back">("front"); @@ -253,18 +254,40 @@ function StartNode({ id, data }: NodeProps) { {/* )} */} -
-
- - - { - handleChange("runSequentially", value); - }} - /> +
+
+
+ + + { + handleChange("runSequentially", value); + }} + /> +
+ {inputs.runSequentially && ( +
+
+
+ + +
+ { + const v = value.length ? value : null; + handleChange("sequentialKey", v); + }} + value={inputs.sequentialKey ?? ""} + placeholder={placeholders["sequentialKey"]} + className="nopan text-xs" + /> +
+
+ )}
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 19115af3..713f964f 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/types.ts @@ -16,6 +16,7 @@ export type WorkflowStartNodeData = { scriptCacheKey: string | null; aiFallback: boolean; runSequentially: boolean; + sequentialKey: string | null; label: "__start_block__"; showCode: boolean; }; diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowComparisonPanel.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowComparisonPanel.tsx index ab3274f6..2f2bc4ba 100644 --- a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowComparisonPanel.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowComparisonPanel.tsx @@ -154,6 +154,7 @@ function getWorkflowElements(version: WorkflowVersion) { scriptCacheKey: version.cache_key, aiFallback: version.ai_fallback ?? true, runSequentially: version.run_sequentially ?? false, + sequentialKey: version.sequential_key ?? null, }; // Deep clone the blocks to ensure complete isolation from main editor diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts index 6f66cd07..23a52aea 100644 --- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts +++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts @@ -709,6 +709,7 @@ function getElements( label: "__start_block__", showCode: false, runSequentially: settings.runSequentially, + sequentialKey: settings.sequentialKey, }), ); @@ -1420,6 +1421,7 @@ function getWorkflowSettings(nodes: Array): WorkflowSettings { scriptCacheKey: null, aiFallback: true, runSequentially: false, + sequentialKey: null, }; const startNodes = nodes.filter(isStartNode); const startNodeWithWorkflowSettings = startNodes.find( @@ -1441,6 +1443,7 @@ function getWorkflowSettings(nodes: Array): WorkflowSettings { scriptCacheKey: data.scriptCacheKey, aiFallback: data.aiFallback, runSequentially: data.runSequentially, + sequentialKey: data.sequentialKey, }; } return defaultSettings; @@ -2134,6 +2137,7 @@ function convert(workflow: WorkflowApiResponse): WorkflowCreateYAMLRequest { cache_key: workflow.cache_key, ai_fallback: workflow.ai_fallback ?? undefined, run_sequentially: workflow.run_sequentially ?? undefined, + sequential_key: workflow.sequential_key ?? undefined, }; } diff --git a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts index 790fb0d3..f9db5f36 100644 --- a/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts +++ b/skyvern-frontend/src/routes/workflows/types/workflowTypes.ts @@ -531,6 +531,7 @@ export type WorkflowApiResponse = { cache_key: string | null; ai_fallback: boolean | null; run_sequentially: boolean | null; + sequential_key: string | null; }; export type WorkflowSettings = { @@ -544,6 +545,7 @@ export type WorkflowSettings = { scriptCacheKey: string | null; aiFallback: boolean | null; runSequentially: boolean; + sequentialKey: string | null; }; 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 ee02c8b2..171ebb7d 100644 --- a/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts +++ b/skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts @@ -18,6 +18,7 @@ export type WorkflowCreateYAMLRequest = { cache_key?: string | null; ai_fallback?: boolean; run_sequentially?: boolean; + sequential_key?: string | null; }; export type WorkflowDefinitionYAML = { diff --git a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts index c1064df4..c5a19514 100644 --- a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts +++ b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts @@ -123,6 +123,7 @@ const useWorkflowSave = () => { }, is_saved_task: saveData.workflow.is_saved_task, run_sequentially: saveData.settings.runSequentially, + sequential_key: saveData.settings.sequentialKey, }; const yaml = convertToYAML(requestBody);