Spaces:
Paused

File size: 858 Bytes
38aa417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import asyncio
import sys
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

from sqlalchemy import select
from core.database import async_session_factory
from models.ai_workflow import AIWorkflow

async def check_workflows():
    async with async_session_factory() as session:
        stmt = select(AIWorkflow).order_by(AIWorkflow.created_at.desc()).limit(10)
        result = await session.execute(stmt)
        workflows = result.scalars().all()
        if not workflows:
            print("No workflows found.")
            return
        for w in workflows:
            step_names = [s.get("name") for s in w.steps] if w.steps else []
            print(f"ID: {w.id}, WS: {w.workspace_id}, Type: {w.workflow_type}, Steps: {step_names}")

if __name__ == "__main__":
    asyncio.run(check_workflows())