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-ai-switch

v0.1.0

Published

AI Switch node for intelligent content-based routing in n8n workflows

Readme

n8n-nodes-ai-switch

This is an n8n node that provides intelligent routing for your n8n workflows based on content analysis. The AI Switch analyzes incoming messages or data using keyword matching or AI-powered content classification, then routes the flow to the appropriate output.

Installation

Follow these steps to install the node in your n8n instance:

Local Installation (Recommended)

  1. Clone this repository:
git clone https://github.com/deepsuthar496/n8n-nodes-ai-switch.git
  1. Navigate to the project directory:
cd n8n-nodes-ai-switch
  1. Install dependencies:
npm install
  1. Build the node:
npm run build --ignore-scripts
  1. Copy the built files to your n8n custom nodes directory:
# Windows (PowerShell)
robocopy "dist" "C:\Users\YOUR_USERNAME\.n8n\custom\node_modules\n8n-nodes-ai-switch\dist" /E
Copy-Item -Path "dist/package.json" -Destination "C:\Users\YOUR_USERNAME\.n8n\custom\node_modules\n8n-nodes-ai-switch\" -Force
Copy-Item -Path "index.js" -Destination "C:\Users\YOUR_USERNAME\.n8n\custom\node_modules\n8n-nodes-ai-switch\" -Force

# Mac/Linux
mkdir -p ~/.n8n/custom/node_modules/n8n-nodes-ai-switch/
cp -r dist ~/.n8n/custom/node_modules/n8n-nodes-ai-switch/
cp dist/package.json ~/.n8n/custom/node_modules/n8n-nodes-ai-switch/
cp index.js ~/.n8n/custom/node_modules/n8n-nodes-ai-switch/
  1. Restart your n8n instance to load the new node.

Operations

The AI Switch offers several powerful routing capabilities:

  • Keyword-Based Routing: Route based on keyword matching in the content
  • AI-Powered Classification: Use AI language models to intelligently classify content
  • Fallback Routing: Default route if no match is found
  • Multiple Output Paths: Dynamic routing based on your defined routes
  • Debug Mode: Detailed logging to understand routing decisions

Compatibility

This node has been developed and tested with n8n versions 1.0.0 and later.

  • Supports AI Agent outputs
  • Works with Chat Message triggers
  • Compatible with n8n's Language Models and external LLMs

Usage

  1. Add the AI Switch node to your workflow between your input node and the branching paths
  2. Connect both inputs:
    • Main Input: Connect your trigger or data source
    • LM Input: Connect your AI language model
  3. Configure Analysis Field:
    • Specify which field contains the content to analyze (e.g., message, content, text)
    • Leave empty to auto-detect common field names
  4. Define Routes:
    • Add routes with clear names and descriptions
    • For each route, provide a detailed description of when content should follow that path
  5. Enable Debug Mode during testing to see detailed routing decisions

Example Workflow

A common use case is routing customer inquiries:

  1. When a chat message is received
  2. AI Switch analyzes the content
  3. Routes to different departments based on the message content:
    • Technical support
    • Billing inquiries
    • General information

License

MIT