mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-30 00:34:58 +00:00
12 lines
345 B
Python
12 lines
345 B
Python
"""Workflow plugin: switch/case control flow."""
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Switch on value and return matching case."""
|
|
value = inputs.get("value")
|
|
cases = inputs.get("cases", {})
|
|
default = inputs.get("default")
|
|
|
|
result = cases.get(str(value), default)
|
|
return {"result": result, "matched": str(value) in cases}
|