improvements for folders and parameters (#3918)

Co-authored-by: Jonathan Dobson <jon.m.dobson@gmail.com>
This commit is contained in:
Celal Zamanoglu
2025-11-06 20:09:26 +03:00
committed by GitHub
parent d104135025
commit dea70f2782
10 changed files with 106 additions and 13 deletions

View File

@@ -1436,6 +1436,23 @@ class AgentDB:
if version:
workflow.version = version
session.add(workflow)
# Update folder's modified_at if folder_id is provided
if folder_id:
# Validate folder exists and belongs to the same organization
folder_stmt = (
select(FolderModel)
.where(FolderModel.folder_id == folder_id)
.where(FolderModel.organization_id == organization_id)
.where(FolderModel.deleted_at.is_(None))
)
folder_model = await session.scalar(folder_stmt)
if not folder_model:
raise ValueError(
f"Folder {folder_id} not found or does not belong to organization {organization_id}"
)
folder_model.modified_at = datetime.utcnow()
await session.commit()
await session.refresh(workflow)
return convert_to_workflow(workflow, self.debug_enabled)