Flowlib

Quickstart

Install Flowlib and run your first workflow in under 5 minutes.

Install

Run the CLI inside an existing Express, NestJS, or Next.js project:

npx flowlib-cli init

The wizard will:

  1. Detect your framework and database driver
  2. Install @flowlib/core, @flowlib/ui, and the framework adapter
  3. Generate flowlib.config.ts and an encryption key
  4. Create database schema files and run the initial migration

Skip prompts with flags: npx flowlib-cli init --framework express --database sqlite

Start the server

The CLI installs everything, but you still need to mount the router. Here's the minimal Express setup — the config is imported from the generated flowlib.config.ts:

index.ts
import express from 'express';
import { createFlowlibRouter } from '@flowlib/express';
import { flowlibConfig } from './flowlib.config';

const app = express();
app.use(express.json());
app.use('/flowlib', await createFlowlibRouter(flowlibConfig));

app.listen(3000, () => console.log('http://localhost:3000/flowlib'));

For NestJS or Next.js mounting patterns, see Installation.

Add the visual editor

The flow editor, execution viewer, and credential manager all live in the <Flowlib> React component. It takes a single config prop — the same object you passed to the backend, so import the generated flowlib.config.ts on both sides.

With Express or NestJS, the UI is a separate React app. Install @flowlib/ui there:

pnpm add @flowlib/ui
App.tsx
import { Flowlib } from '@flowlib/ui';
import '@flowlib/ui/styles';
import { flowlibConfig } from '../flowlib.config';

function App() {
  return <Flowlib config={flowlibConfig} />;
}

With Next.js, mount it in a catch-all client page (dynamic import with ssr: false — the editor uses browser APIs):

app/flowlib/[[...slug]]/page.tsx
'use client';

import dynamic from 'next/dynamic';
import '@flowlib/ui/styles';
import config from '../../flowlib.config';

const Flowlib = dynamic(() => import('@flowlib/ui').then((m) => ({ default: m.Flowlib })), {
  ssr: false,
});

export default function FlowlibPage() {
  return <Flowlib config={config} />;
}

Plugins go inside config.plugins (e.g. auth(), rbac()). The @flowlib/user-auth plugin auto-gates the UI with a sign-in screen — no wrapper component needed. See Installation for per-framework details.

Open the dashboard

Start your server and frontend, then visit your editor (e.g. http://localhost:5173 for a Vite app, or http://localhost:3000/flowlib for Next.js). You should see the Flowlib dashboard where you can create and run flows.

What's next?

  • Triggers — Start flows manually, on a schedule, or from webhooks
  • Execution Model — How flows execute under the hood
  • Plugins — Authentication, RBAC, webhooks, and more
  • Reference — Configuration, CLI, and API docs

On this page