from fastapi import FastAPI, Request from fastapi.middleware.cors import CORSMiddleware from executor.workflow import execute import pyrebase app = FastAPI() # Enable CORS for all origins app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get("/") async def index(): return {"message": "Welcome to the Flowify Workflow Executor API"} @app.post("/execute") async def execute_workflow(request: Request): workflow = await request.json() print(workflow) data = execute(workflow) return data