mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-05-06 03:29:37 +00:00
4776082c34
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
14 lines
395 B
Python
14 lines
395 B
Python
"""Workflow plugin: format string with variables."""
|
|
|
|
|
|
def run(_runtime, inputs):
|
|
"""Format string with variables."""
|
|
template = inputs.get("template", "")
|
|
variables = inputs.get("variables", {})
|
|
|
|
try:
|
|
result = template.format(**variables)
|
|
return {"result": result}
|
|
except (KeyError, ValueError) as e:
|
|
return {"result": template, "error": str(e)}
|