Skip to content
AbhayanthkPublic

About

Visual DAG engine for AI and media pipelines: parallel levels on durable Trigger.dev workers, live results, refresh-safe runs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

◆ Nextflow

A visual, realtime DAG engine for AI & media pipelines.

Drag nodes onto a canvas. Wire them. Press run. A cloud DAG scheduler executes your graph and streams results back live.


Next.js React TypeScript Trigger.dev v4 Prisma 7 Neon Tailwind v4 Clerk


What is this?

Nextflow is a node-based programming environment in the browser — think Figma meets Airflow. You build a directed graph of processing steps, Nextflow compiles it into a DAG, and Trigger.dev executes every level in parallel on durable cloud workers while your canvas updates in realtime.

[Upload Video] ──► [Extract Frame] ──► [Crop Image]
                                               │
[Text Input] ──────────────────► [LLM Gemini] ◄┘
                                       │
                                   (output)

Highlights

Feature
Canvas React Flow 12 editor — snap, multi-select, lasso, file drop-to-node
Typed edges Each handle carries a type (text / image / video); mismatched wires are blocked
Cycle guard DFS-based cycle detection runs on every edge draw
DAG scheduler BFS levels, each level runs as a batchTriggerAndWait — orchestrator suspends free
Realtime Trigger.dev v4 streams push typed events directly to the browser, no proxy
Refresh-resilient Every state transition persists to Postgres — reload mid-run, canvas restores
Versioning Every save creates a WorkflowVersion; roll back or fork at any time
Partial runs Select specific nodes; ancestors are served from cached outputs
Auto-save Debounced background save with version diffing
Keyboard-driven Full shortcut grid (? to open), copy/paste subgraphs
Dark + light theme Persisted in localStorage, toggled from the toolbar
AI primitives Gemini 2.x for text/vision; Stability Core for image generation
Media processing FFmpeg crops images and extracts video frames in the cloud

Documentation

Page What's inside
Architecture System diagram, layered view, v1→v2 evolution
DAG Engine How the scheduler works, batching, partial runs, cost model
Nodes All 6 node types — handles, design spec, connection rules
Realtime Streams Trigger.dev streams, token auth, transport deep-dive
Transloadit & Media Upload pipeline, FFmpeg processing, worker uploads
Data Model Prisma schema, ER diagram, status enums
Getting Started Env vars, install, dev server, deploy

Quick look

System diagram
flowchart LR
  subgraph Browser
    UI[Workflow Editor\nReact Flow 12]
    Hooks[useRealtimeStream]
    Uppy[Uppy Dashboard]
  end

  subgraph API["Next.js 16 App Router"]
    R1[POST /api/run-workflow]
    R2[CRUD /api/workflows]
    R3[POST /api/upload/transloadit-params]
    R5[GET /api/auth/realtime]
  end

  subgraph Trigger["Trigger.dev v4"]
    O[workflow.run\norchestrator]
    N[node.execute\nper-node worker]
    S(((workflow-events stream)))
  end

  subgraph Ext["External"]
    T[Transloadit]
    G[Gemini API]
    St[Stability AI]
    P[(Neon Postgres)]
  end

  UI --> R2 --> P
  UI --> R1 --> O
  Uppy --> R3 --> T
  O --> N --> G & St & T
  N --> O --> P
  O --> S --> Hooks --> UI
Loading
Run lifecycle (sequence)
sequenceDiagram
  actor U as User
  participant UI as Canvas
  participant API as /api/run-workflow
  participant DB as Postgres
  participant TR as Trigger.dev
  participant ORC as workflow.run
  participant N as node.execute
  participant S as workflow-events stream

  U->>UI: Click Run
  UI->>API: POST { workflowVersionId, scope }
  API->>DB: createRun → runId
  API->>TR: tasks.trigger("workflow.run", payload)
  TR-->>API: handle.id
  API->>DB: markRunAsRunning
  API-->>UI: { runId, triggerRunId }

  UI->>TR: createPublicToken + useRealtimeStream

  TR->>ORC: invoke
  loop Each DAG level
    ORC->>S: node_start ×N
    ORC->>DB: RUNNING ×N
    ORC->>N: batchTriggerAndWait (parent suspends FREE)
    N-->>ORC: outputs
    ORC->>DB: SUCCESS / FAILED
    ORC->>S: node_complete / node_failed
  end
  ORC->>DB: markRunAsCompleted
  ORC->>S: workflow_done

  S-->>UI: live events → canvas update
Loading

Tech stack

Layer Technology
Framework Next.js 16.2 (App Router)
UI React 19.2 + React Flow 12
Styling Tailwind v4 + CSS Modules
State Zustand 5
Validation Zod 4
Auth Clerk + Svix webhooks
Database Neon Postgres · Prisma 7
Workers Trigger.dev v4 (node runtime + aptGet ffmpeg)
Uploads Uppy 5 + Transloadit
AI Google Gemini 2.x · Stability Core
Realtime @trigger.dev/react-hooks · useRealtimeStream

Project layout (top-level)

app/            Next.js 16 routes and API handlers
components/     React components: nodes, canvas, toolbars, sidebars
hooks/          Custom hooks: execution, uploads, auto-save, shortcuts
lib/            Shared utilities: connection rules, DB repositories, auth
src/trigger/    Trigger.dev tasks + DAG engine
  engine/         dag.ts, types.ts (pure functions)
  workflow.task.ts  orchestrator
  node.task.ts      per-node executor
  streams.ts        typed event stream definition
store/          Zustand stores
prisma/         schema.prisma + migrations
trigger.config.ts

See full layout →


Built with Next.js · Trigger.dev · Prisma · Neon · Transloadit

About

Visual DAG engine for AI and media pipelines: parallel levels on durable Trigger.dev workers, live results, refresh-safe runs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages