import json from json_repair import repair_json class IntegrationManager: def __init__(self, memory_manager): self.memory = memory_manager def deploy_internal(self, store_id, blueprint_json, name="New Automation"): try: if isinstance(blueprint_json, str): payload = repair_json(blueprint_json, return_objects=True) else: payload = blueprint_json if 'nodes' not in payload: payload = {"nodes": payload, "edges": []} except: return {"status": "error"} wf_id = self.memory.save_workflow(store_id, name, payload) return {"status": "success", "workflow_id": wf_id}