Code export & self-hosting
The Bot code tab shows your entire bot as a single readable file, and one click downloads a ZIP of a complete project. The export is standalone — it contains your flow, the engine and the provider webhook, and never talks to FlowBot again.
What's in the ZIP
| File | Contents |
|---|---|
server.js | Everything: your flow as a JSON object at the top, the deterministic engine, and the webhook wiring for the provider your bot was configured with (Meta, Twilio, Green API or Whapi). |
package.json | One dependency (Express). Requires Node 20+. |
.env.example | Template for your provider credentials. |
README.md | Quick start + provider-specific connection steps. |
Run it
npm install
cp .env.example .env # fill in your provider credentials
npm run start:env # reads .env; listens on $PORT (default 3000)
For your safety, your secret token is not written into server.js — downloadable code can't leak it. Put it in .env and start with npm run start:env (plain npm start does not read .env). Non-secret IDs like your phone number ID are kept as defaults, and the port comes from the PORT environment variable. Point your provider's webhook at your server's public URL (the README shows the exact path) and the bot is live.
Deploying
- Railway / Render / Fly: push the project to a repo, create a service, set the env vars — done. The server binds
:3000(or the platform'sPORT). - VPS: run under
systemdorpm2, put nginx/Caddy in front for HTTPS (providers require an https webhook). - Exported bots keep sessions in memory — a restart resets in-progress conversations. Add your own store if you need more.
Editing the generated code
It's plain JavaScript with no framework beyond Express. The conversation lives in the FLOW object (nodes = blocks, edges = wires) — you can tweak copy directly, or add anything Node.js can do around the engine: database writes, notifications, custom integrations. For bigger flow changes it's usually faster to edit visually in FlowBot and download a fresh ZIP.
Why this matters
The export is your exit route: no lock-in, no subscription, host in your own country or VPC for compliance, and hand the code to any developer. It's a normal codebase from the moment it's on your disk.