Skip to content

Automate browser based workflows with AI

Fix Loop block parameters (#1492)

Shuchang Zhenga241b09701ec
diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
index abc857513..915919ffc 100644
--- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
+++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts
@@ -368,14 +368,14 @@ function convertToNode(
const loopVariableReference =
block.loop_variable_reference !== null
? block.loop_variable_reference
- : block.loop_over.key;
+ : block.loop_over?.key ?? "";
return {
...identifiers,
...common,
type: "loop",
data: {
...commonData,
- loopValue: block.loop_over.key,
+ loopValue: block.loop_over?.key ?? "",
loopVariableReference: loopVariableReference,
},
};
diff --git a/skyvern/forge/sdk/workflow/models/yaml.py b/skyvern/forge/sdk/workflow/models/yaml.py
index c89ba5924..8e7af235b 100644
--- a/skyvern/forge/sdk/workflow/models/yaml.py
+++ b/skyvern/forge/sdk/workflow/models/yaml.py
@@ -142,8 +142,8 @@ class ForLoopBlockYAML(BlockYAML):
# to infer the type of the parameter_type attribute.
block_type: Literal[BlockType.FOR_LOOP] = BlockType.FOR_LOOP # type: ignore
- loop_over_parameter_key: str
loop_blocks: list["BLOCK_YAML_SUBCLASSES"]
+ loop_over_parameter_key: str = ""
loop_variable_reference: str | None = None