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

n8n-nodes-erp-clinic

v1.5.2

Published

n8n community node — visual customer segmentation builder for clinic ERPs. Generates SQL queries from visual rules (appointments, services, budgets, plans).

Readme

n8n-nodes-erp-clinic

n8n Community Node — Visual customer segmentation builder for clinic ERPs.
Build rules visually and get a ready-to-run SQL query as output.


Installation

Via n8n UI (self-hosted)

  1. Go to Settings → Community Nodes
  2. Click Install
  3. Enter n8n-nodes-erp-clinic
  4. Confirm and restart

Via CLI

npm install n8n-nodes-erp-clinic
# restart n8n

How it works

Search for "ERP Clinic — Customer Segmentation" in the node panel.

  1. Set the root operator: ALL (AND) or ANY (OR)
  2. Click Add Condition and configure each rule
  3. The node outputs { "sql": "SELECT ..." } — pipe it directly into a Postgres or MySQL node

Available conditions

📅 Agenda (Appointments)

| Field | Operators | Value | |---|---|---| | Has future appointment | — | Yes / No | | Has any appointment | — | Yes / No | | Appointment status | is, is not, is any of | scheduled / confirmed / completed / canceled / no_show | | Appointment service SKU | equals, is any of | SKU string(s) | | Days since last appointment | = ≠ > ≥ < ≤ | number | | No-show count | = ≠ > ≥ < ≤ | number |

💉 Serviço (Services)

| Field | Operators | Value | |---|---|---| | Has purchased any service | — | Yes / No | | Service SKU | equals, is any of | SKU string(s) | | Days since last service | = ≠ > ≥ < ≤ | number | | Total services purchased | = ≠ > ≥ < ≤ | number | | Total amount spent (R$) | = ≠ > ≥ < ≤ | number |

Only considers orders with status = 'paid'

📋 Orçamento (Budgets)

| Field | Operators | Value | |---|---|---| | Has open budget | — | Yes / No | | Budget status | is, is not, is any of | open / converted / expired | | Budget total amount (R$) | = ≠ > ≥ < ≤ | number | | Days without conversion | = ≠ > ≥ < ≤ | number | | Is recent budget (≤ 7 days) | — | Yes / No | | Budget service SKU | equals, is any of | SKU string(s) |

🏷️ Plano (Plans)

| Field | Operators | Value | |---|---|---| | Has any plan | — | Yes / No | | Has active plan | — | Yes / No | | Plan status | is, is not, is any of | active / canceled / expired | | Plan SKU | equals, is any of | SKU string(s) | | Days until plan expires | = ≠ > ≥ < ≤ | number |


Example output

Setup: Customers who bought Botox AND have no future appointment

Match: ALL conditions (AND)
├─ Serviço  │ Service SKU         │ equals    │ botox_001
└─ Agenda   │ Has future appoint. │ —         │ No

Generated SQL:

SELECT
  c.id,
  c.name,
  c.created_at
FROM customers c
WHERE
  (
    EXISTS (
      SELECT 1 FROM orders o
      JOIN order_items oi ON oi.order_id = o.id
      JOIN services s ON s.id = oi.service_id
      WHERE o.customer_id = c.id
        AND o.status = 'paid'
        AND s.sku = 'botox_001'
    )
  )
  AND (
    NOT EXISTS (SELECT 1 FROM appointments a WHERE a.customer_id = c.id AND a.start_at > NOW())
  )
ORDER BY c.name;

Expected database schema

customers         id, name, created_at
appointments      id, customer_id, service_id, start_at, status
services          id, sku, name
orders            id, customer_id, status, created_at, total_amount
order_items       id, order_id, service_id, quantity, unit_price
budgets           id, customer_id, status, created_at, converted_at, total_amount
budget_items      id, budget_id, service_id, quantity, unit_price
customer_plans    id, customer_id, plan_id, status, start_at, end_at
plans             id, sku, name

License

MIT