Skip to content

aakash726/nextflow-ai

Repository files navigation

NextFlow AI

Production-grade DAG-based AI workflow orchestration platform built with Next.js App Router, strict TypeScript, TailwindCSS, and ShadCN-style component primitives.

Highlights

  • DAG validation with Zod: cycle detection, required-input checks, strict handle type compatibility.
  • Deterministic level-based scheduler:
    • same dependency level runs in parallel
    • dependent levels run sequentially
  • Strict orchestration/execution split:
    • orchestration in lib/engine/*
    • worker task handlers in lib/tasks/*
  • Trigger-style task mapping per node:
    • LLM -> Gemini (@google/generative-ai)
    • Upload Image/Video -> Uploadcare -> Cloudinary persistence
    • Crop / Extract Frame -> FFmpeg worker abstraction
  • React Flow workflow studio:
    • collapsible node palette
    • drag-and-drop node creation
    • animated typed edges
    • MiniMap + zoom/pan
    • inline node outputs
    • reactive inputs (connected handles override + disable manual entry)
  • Run history panel with node-level logs and statuses for full/partial/single runs.

Tech Stack

  • Next.js 14 (App Router)
  • TypeScript (strict mode)
  • React Flow
  • TailwindCSS
  • ShadCN-style UI components
  • MongoDB + Mongoose
  • Zod

Project Structure

  • app/ -> pages + route handlers
  • components/ -> UI and workflow canvas components
  • lib/nodes/ -> node contracts, registry, demo graph
  • lib/engine/ -> validation, scheduler, run/workflow stores
  • lib/tasks/ -> task dispatch and worker handlers
  • lib/services/ -> Gemini, Uploadcare/Cloudinary, FFmpeg adapters
  • lib/db/ -> Mongo connection and models
  • trigger/ -> task exports for worker runtime boundary

Setup

  1. Install dependencies:
npm install
  1. Configure env:
cp .env.example .env.local
  1. Start MongoDB locally or provide hosted Mongo URI.

  2. Start app:

npm run dev

Environment Variables

  • MONGODB_URI
  • MONGODB_DB_NAME
  • GEMINI_API_KEY
  • UPLOADCARE_PUBLIC_KEY
  • CLOUDINARY_CLOUD_NAME
  • CLOUDINARY_API_KEY
  • CLOUDINARY_API_SECRET

Demo Workflow

The app bootstraps a prebuilt Product Marketing Kit Generator workflow with:

  • Branch A: image upload -> crop -> LLM description with text prompts
  • Branch B: video upload -> frame extraction
  • Convergence: final LLM consumes branch outputs for social marketing copy

Deployment (Vercel)

  1. Push repository to GitHub.
  2. Import into Vercel.
  3. Add environment variables in Vercel dashboard.
  4. Deploy.

Notes

  • Upload and FFmpeg handlers currently expose production integration points and can be routed to dedicated Trigger.dev worker infrastructure.
  • Scheduler and worker handlers are intentionally decoupled for horizontal scaling.

About

A DAG-based visual AI workflow builder with async execution, multimodal processing (LLM, image, video), parallel pipelines, and real-time run tracking

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors