# api/workflow_api.py from typing import Dict, Any, List, Optional from fastapi import APIRouter, HTTPException, Depends, Query from pydantic import BaseModel, Field from services.workflow_service import WorkflowService from core.exceptions import TianfengTaskError from api.models import ( ApiResponse, WorkflowInput, WorkflowUpdateInput, WorkflowExecuteInput, WorkflowImportInput ) from core.workflow import WorkflowDefinition from config.api_config import ApiResponseCode, ApiResponseMessage # 创建路由器 router = APIRouter(prefix="/workflow", tags=["工作流管理"]) # 创建服务实例 workflow_service = WorkflowService()