Loading repository data…
Loading repository data…
KushagraB424 / repository
A production-grade, highly-scalable visual node-based AI workflow orchestrator.
Distributed Visual AI Workflow Orchestrator
NextFlow is a production-grade, highly-scalable visual node-based AI workflow orchestrator.
It empowers you to build complex, multi-step AI and compute pipelines (Directed Acyclic Graphs or DAGs) using an intuitive, beautifully designed drag-and-drop canvas. NextFlow abstracts away the complexity of connecting LLMs, vector databases, document parsers, and media processing (FFmpeg), giving you a visual approach to logic design.
Instead of writing brittle scripts that time out or fail unpredictably, NextFlow leverages a distributed event-driven backend. Once your pipeline is built, NextFlow compiles your DAG and orchestrates the execution entirely in the background via dedicated cloud workers.
NextFlow visual node editor in action.
Building a distributed node-editor required tackling incredibly complex state management and infrastructure challenges:
@xyflow/react)pgvector extension to store and query high-dimensional embeddings for the RAG pipeline.gemini-2.5-flash for fast, cost-effective multimodal reasoning and gemini-embedding-2 for generating dense vector representations of text.nextflow-app/
├── prisma/ # Prisma schema and migrations (incl. pgvector)
├── public/ # Static assets and placeholders
├── src/
│ ├── app/ # Next.js App Router (Pages, API Routes)
│ │ ├── api/ # REST Endpoints (DAG trigger, graph saving, webhooks)
│ │ ├── workflow/ # Dynamic workflow canvas routes
│ │ └── page.tsx # User workspace / Dashboard
│ ├── components/ # Reusable UI Architecture
│ │ ├── canvas/ # React Flow custom nodes, Canvas UI, Execution Inspector
│ │ ├── sidebar/ # Left (Node Palette) & Right (Run History) Sidebars
│ │ └── toolbar/ # Workspace controls and triggers
│ ├── lib/ # Singletons (Prisma client, Clerk auth helpers)
│ ├── stores/ # Zustand State Management (workflow-store, run-store)
│ ├── trigger/ # Trigger.dev v3 Cloud Workers
│ │ ├── orchestrator.ts # Master Task: Traverses DAG and routes execution
│ │ └── tasks.ts # Worker definitions (Gemini, FFmpeg, PDF-Parse, pgvector)
│ ├── types/ # TypeScript interfaces and robust payload typing
│ └── utils/ # DAG utilities (topological sort, cycle detection)
├── trigger.config.ts # Trigger.dev deployment configuration
└── next.config.ts # Next.js bundler optimizations (ServerExternalPackages)
Check it out live: https://nextflow-gamma-sable.vercel.app
(Note: Ensure you are logged in to save your workflows and run background tasks.)
If you'd like to spin this up on your local machine:
Populate your .env.local with the following keys:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY & CLERK_SECRET_KEYDATABASE_URL (Supabase Transaction Pooler) & DIRECT_URLTRIGGER_SECRET_KEY (Trigger.dev v3 Dev Key)GEMINI_API_KEY (Google Gemini)npm install
npm run dev
(Runs the Next.js app on localhost:3000)
In a separate terminal tab, boot up the Trigger.dev dev worker:
npx trigger.dev@latest dev
(Listens for the tasks triggered by your localhost app)