Getting started
TongFlow runs as a Next.js dev server on your own machine. You’ll have your first workflow running in about five minutes.
What you need
- Node.js 20 or later, with pnpm
- A Modal account and tokens — sign up at modal.com. The free tier (USD 30 / month) includes meaningful H100 time and covers most of TongFlow’s GPU work.
- At least one LLM API key — pick one: OpenRouter, Gemini, OpenAI, or DeepSeek. OpenRouter has a free routing tier; the others charge per request.
Optional: a Discord account to ping us in #tongflow if anything is unclear.
1. Clone
git clone https://github.com/tong-io/tongflow
cd tongflow2. Configure environment variables
Copy the example and edit it:
cp .env.example .envThe variables you must fill in:
| Variable | Purpose |
|---|---|
MODAL_TOKEN_ID | Modal worker auth |
MODAL_TOKEN_SECRET | Modal worker auth |
At least one of: OPENROUTER_API_KEY / GEMINI_API_KEY (or GOOGLE_API_KEY) / OPENAI_API_KEY / DEEPSEEK_API_KEY | The “Generate text” node and other LLM-routed transforms |
Optional:
OPENROUTER_FREE_MODEL— pin a specific free OpenRouter routeOPENAI_CHAT_MODEL— defaults togpt-4o-miniwhen unsetNEXT_PUBLIC_FILE_BASE_URL— base URL for file storage if you front the app with a CDN
3. Authorize Modal once
This writes tokens to ~/.modal.toml and is only needed before the first run:
pnpm modal:setup4. Run
Requires Node.js 20 or later.
pnpm install
pnpm devOpen http://localhost:3000. You’ll land on /workspace.
Data persists locally: SQLite at data/tongflow.db, uploads at data/uploads/.
5. Your first workflow
Once /workspace loads:
- The page opens in Create mode (Sparkles icon in the mode switch — see Workflow modes).
- The Smart Island at the bottom shows seven Add icons: 3D / Document / Image / Text / Video / Audio / Link.
- Click the Text icon (
Typeletterform) to drop a text node. Type a prompt like “a watercolor portrait of a cat in a library”. - Drag from the text node’s output handle to empty canvas → choose Image generation → an image node appears wired in.
- Switch to Execute mode (toggle the Sparkles → Play icon) and click the Play button on the Smart Island.
- The task runs through your Modal account; results appear on the image node.
That’s the whole loop. From here you can chain another transform (image → video, image → 3D, image upscale), branch into a Combine node (e.g. lip sync), or save the workflow.
Where things live
- Workflows — saved in
data/tongflow.db. Open them with the Workflow button (top-left, three-button left sidebar). - Materials / Portfolio — uploaded files appear in the Portfolio dialog (top-left FolderOpen icon, not on the Smart Island).
- Tasks — execution history is in the Task panel (top-left Zap icon).
Next
- Interface overview
- Smart Island — what the floating dock actually controls
- Node types — full catalog
