Spaces:
Paused
Paused
File size: 648 Bytes
2e91995 1804a7a 579abad 1804a7a 2e91995 1804a7a 2e91995 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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}
|