Load a workflow definition from a YAML string.
(cls, content: str)
| 87 | |
| 88 | @classmethod |
| 89 | def from_string(cls, content: str) -> WorkflowDefinition: |
| 90 | """Load a workflow definition from a YAML string.""" |
| 91 | data = yaml.safe_load(content) |
| 92 | if not isinstance(data, dict): |
| 93 | msg = f"Workflow YAML must be a mapping, got {type(data).__name__}." |
| 94 | raise ValueError(msg) |
| 95 | return cls(data) |
| 96 | |
| 97 | |
| 98 | # -- Workflow Validation -------------------------------------------------- |
no outgoing calls