Spaces:
Paused

miracle / scratch /check_workflows.py
dushyantsingh0
fix: resolve typescript build errors in internal portal navigation
38aa417
Raw History Blame Contribute Delete
858 Bytes
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())