Skip to content

Commit 6eaaf61

Browse files
author
Alan Christie
committed
feat: Add ability to get workflow name and description
1 parent 95c9e06 commit 6eaaf61

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

workflow/decoder.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ def get_step_names(definition: dict[str, Any]) -> list[str]:
4444
"""
4545
names: list[str] = [step["name"] for step in definition.get("steps", [])]
4646
return names
47+
48+
49+
def get_workflow_name(definition: dict[str, Any]) -> str:
50+
"""Given a Workflow definition this function returns its name."""
51+
return str(definition.get("name", ""))
52+
53+
54+
def get_workflow_description(definition: dict[str, Any]) -> str | None:
55+
"""Given a Workflow definition this function returns its description (if it has one)."""
56+
return definition.get("description")

0 commit comments

Comments
 (0)