foreach container arg to get the path treatment too!

This commit is contained in:
lda
2026-05-21 14:31:52 +07:00 Verified
parent 3be1593276
commit 23ffddf9b3
8 changed files with 54 additions and 8 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ class ForeachNode(BaseModel):
id: str
type: Literal["foreach"]
over: str
over: GraphSourcePath
as_: str = Field(alias="as")
mode: Literal["serial", "parallel"] = "serial"
on_item_error: Literal["fail", "collect", "skip"] = "fail"
+2 -2
View File
@@ -26,14 +26,14 @@ def step_foreach(
progress = progress_map.setdefault(step.id, {"index": 0})
iterable = safe_resolve_path(
step.over,
str(step.over),
state=run.state,
workflow_input=run.workflow_input,
context=frame_context_values(frame),
)
if not isinstance(iterable, list):
raise WorkflowExecutionError(
f"foreach source {step.over!r} must resolve to a list"
f"foreach source {str(step.over)!r} must resolve to a list"
)
loop_index = progress["index"]