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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-plugin-subflow-exporter

v1.0.0

Published

Adds menu items to export all subflows as JSON

Readme

Subflow Exporter (Node-RED Editor Plugin)

Export exactly what you need — selected flows (tabs) and/or subflows — in one JSON file, straight from the editor. Adds a “Subflow exporter” sidebar with checkboxes, quick select actions, and an Export button.


What problem it solves

  • No bulk export in UI. Node-RED lets you export nodes/flows one by one. That’s slow and error-prone for large workspaces.
  • Subflow completeness. Copying only a subflow definition (or only its instances) is not enough; you also need all inner nodes and often related config nodes.
  • Selective migration. You often want to move just some flows/subflows (e.g., a feature pack) without dumping the entire workspace.

This plugin:

  • Lists all Flows (tabs) and all Subflows with checkboxes.
  • Optionally includes referenced subflows and config nodes.
  • Exports a clean, import-ready JSON you can drop into another Node-RED via Menu → Import.

How it works (high-level)

  1. The sidebar uses the editor API to GET /flows. It supports both API v1 (array) and API v2 ({rev, flows:[…]}).

  2. It builds the export from your selections:

    • Flow (tab): adds the tab + all nodes with z == tab.id.
    • Subflow: adds the subflow definition + all inner nodes with z == subflow.id.
  3. Options:

    • Auto-include referenced subflows: if selected items contain instances like type: "subflow:<id>", the plugin also includes those subflow definitions and their inner nodes.
    • Include all config nodes: adds all config nodes (nodes with no z, excluding tab/subflow), to avoid “missing config” on import.
  4. Packages the result into a single JSON and triggers a browser download.


Where to find it in the UI

  • Open the Node-RED editor → right sidebar → “Subflow exporter” tab.

  • Controls:

    • Export selected (button)

    • Refresh (reloads workspace list)

    • Options: Auto-include referenced subflows, Include all config nodes

    • Two lists with checkboxes:

      • Flows (tab) — with Select all / None
      • Subflows — with Select all / None

Installation

npm install node-red-plugin-subflow-exporter

Requirements

  • Node-RED with editor plugins supported.
  • Browser session already authenticated if adminAuth is enabled.
  • No runtime nodes are installed — this is editor-only.

Usage

  1. Open Subflow exporter in the sidebar.

  2. Click Refresh to load workspace metadata.

  3. Tick what you need:

    • Flows (tabs)
    • Subflows
  4. Pick options:

    • Auto-include referenced subflows (recommended)
    • Include all config nodes (recommended when moving to a new instance)
  5. Click Export selected → a file like selected-flows-YYYYMMDD-HHMMSS.json downloads.

  6. In the target Node-RED: Menu → Import → paste/upload JSON → Import.


Data format

  • A flat JSON array of Node-RED nodes:

    • Selected tab and/or subflow objects,
    • All their inner nodes (matching z),
    • Optional config nodes (no z),
    • Optional referenced subflows (definition + inner nodes).
  • Ready for standard Import in Node-RED.


Notes & limitations

  • Not a workspace backup. It exports only what you tick. For full backups, use your flows.json and credentials strategy.
  • Credentials are not exported; manage them separately (env vars, secure storage, or re-enter on target).
  • Config nodes: if you skip them and the target lacks the same configs, import may warn about missing references.
  • Custom nodes: the target instance must have required node modules installed.

Troubleshooting

  • “Nothing selected.” Tick at least one Flow or Subflow.
  • “Load failed: …” Check that your editor session can reach GET /flows (reverse proxy, auth, CORS).
  • “Unexpected /flows response shape.” You’re hitting a non-standard response; confirm Node-RED version and any proxies that might rewrite JSON.
  • Import warnings about missing nodes/config: install the same contrib nodes on the target and/or enable Include all config nodes before exporting.

License

MIT.