Skip to content

Commit e935f0e

Browse files
author
Alan Christie
committed
feat: Decoder now supports get_step_names()
1 parent c120675 commit e935f0e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

workflow/decoder.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ def validate_schema(workflow: dict[str, Any]) -> str | None:
3636

3737
# OK if we get here
3838
return None
39+
40+
41+
def get_step_names(definition: dict[str, Any]) -> set[str]:
42+
"""Given a Workflow definition this function returns the unique list of its
43+
step names, in the order they are defined.
44+
"""
45+
names: set[str] = {step["name"] for step in definition.get("steps", [])}
46+
return names

0 commit comments

Comments
 (0)