npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cravern/bpmn-flow-designer

v1.0.22

Published

A React component for designing and editing BPMN workflows with AI-powered generation

Downloads

2,314

Readme

BPMN Flow Designer

A powerful React component for designing and editing BPMN (Business Process Model and Notation) workflows with AI-powered diagram generation capabilities.

Features

  • 🎨 Visual BPMN Editor: Drag-and-drop interface for creating BPMN diagrams
  • 🤖 AI-Powered Generation: Generate BPMN diagrams from natural language descriptions using Google's Gemini API
  • 📥 XML Import/Export: Import existing BPMN XML and export your designs
  • 🎯 Component Palette: Built-in components (Start Event, Tasks, Gateways, End Events)
  • 💅 Styled UI: Modern, responsive interface with Tailwind CSS
  • 🔧 Fully Typed: Complete TypeScript support with type definitions

Installation

npm install bpmn-flow-designer

Prerequisites

You need to have the following peer dependencies installed:

npm install react react-dom tailwindcss

You'll also need to load BPMN-JS library. Add this to your HTML <head>:

<!-- BPMN-JS Styles -->
<link
  rel="stylesheet"
  href="https://unpkg.com/[email protected]/dist/assets/diagram-js.css"
/>
<link
  rel="stylesheet"
  href="https://unpkg.com/[email protected]/dist/assets/bpmn-font/css/bpmn.css"
/>

<!-- BPMN-JS Library -->
<script src="https://unpkg.com/[email protected]/dist/bpmn-modeler.development.js"></script>

Usage

Basic Example

import React from "react";
import { BpmnDesigner } from "bpmn-flow-designer";
import "bpmn-flow-designer/dist/style.css";

function App() {
  return (
    <BpmnDesigner
      title="My Workflow"
      onSave={(xml) => {
        console.log("BPMN XML:", xml);
      }}
    />
  );
}

export default App;

With Custom Initial XML

import { BpmnDesigner } from "bpmn-flow-designer";

const customXml = `<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL">
  <!-- Your custom BPMN XML here -->
</bpmn:definitions>`;

export default function App() {
  return (
    <BpmnDesigner
      initialXml={customXml}
      title="Custom Workflow"
      onSave={(xml) => console.log(xml)}
    />
  );
}

Props

BpmnDesignerProps

interface BpmnDesignerProps {
  /**
   * Initial BPMN XML to load into the editor
   * @default Default start event only
   */
  initialXml?: string;

  /**
   * Callback function triggered when the user exports/saves the diagram
   * @param xml - The exported BPMN XML string
   */
  onSave?: (xml: string) => void;

  /**
   * Title displayed in the header
   * @default "Flow Designer"
   */
  title?: string;
}

AI Generation Features

The component includes AI-powered BPMN generation using Google's Gemini API. To enable this feature:

  1. Set up a Gemini API key
  2. Create a .env file in your project:
VITE_GEMINI_API_KEY=your_api_key_here
  1. The AI Architect section will allow you to describe workflows in natural language and automatically generate BPMN diagrams

Styling

The component uses Tailwind CSS for styling. Make sure your project has Tailwind CSS configured. The package exports all necessary styles via the CSS file:

import "bpmn-flow-designer/dist/style.css";

Ensure Tailwind CSS is installed and configured in your project:

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

Exporting Diagrams

Users can export their BPMN diagrams by:

  1. Clicking the "Download BPMN" button in the header
  2. Using the onSave callback to capture the XML

The exported file is a standard BPMN 2.0 XML file that can be imported into other BPMN tools.

Components Available

The palette includes the following BPMN components:

  • Start Event - Initiates the process flow
  • Task - Represents a work item or activity
  • Gateway - Decision points (Exclusive Gateway)
  • End Event - Terminates the process flow

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For issues and feature requests, please open an issue on the GitHub repository.

Run Locally

Prerequisites: Node.js

  1. Install dependencies: npm install
  2. Set the GEMINI_API_KEY in .env.local to your Gemini API key
  3. Run the app: npm run dev