mirror of
https://github.com/johndoe6345789/AutoMetabuilder.git
synced 2026-04-24 22:04:58 +00:00
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)}
|