Files
matrix-ai-agent/pipelines/steps/template.py
Christian Gick bd8d96335e feat: add pipeline engine with approval flow and file triggers
Sequential step executor (script, claude_prompt, approval, api_call,
template, skyvern placeholder), reaction-based approvals, file upload
trigger matching, portal API state sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 17:06:07 +02:00

19 lines
633 B
Python

"""Template step — format and post a message to the target room."""
import logging
logger = logging.getLogger(__name__)
async def execute_template(config: dict, send_text=None, target_room: str = "", **_kwargs) -> str:
"""Render a template message and post it to the target room."""
template = config.get("template", config.get("message", ""))
if not template:
raise ValueError("template step requires 'template' or 'message' field")
# Template is already rendered by the engine before reaching here
if send_text and target_room:
await send_text(target_room, template)
return template