from uuid import uuid4 def build_task(target, action, params=None): return { "task_id": str(uuid4()), "target": target, "type": "infra", "action": action, "params": params or {}, }