A rule-based message router for your nself backend. Route inbound messages, email, webhook, Telegram, SMS, or custom, through a configurable YAML pipeline of conditions and actions. Supports 17 action types including send, transform, store, notify, and AI classification.
nself-mux is part of the ɳClaw bundle. AI-powered classification and summarization actions require nself-ai to be installed. Set your key with nself license set nself_pro_... before installing.
nself license set nself_pro_...
nself plugin install mux
nself build
nself startDefine routing rules in mux-rules.yaml and set PLUGIN_MUX_RULES_PATH in your .env:
rules:
- name: forward-support-email
when:
channel: email
to: support@example.com
actions:
- type: forward
to: team@example.com
- type: store
table: support_tickets
- name: notify-on-payment
when:
channel: webhook
source: stripe
event: payment_intent.succeeded
actions:
- type: notify
plugin: nself-notify
user_id: "{{ payload.metadata.user_id }}"
title: "Payment received"
body: "Thank you for your payment of ${{ payload.amount_received / 100 }}"
- name: classify-and-route
when:
channel: email
actions:
- type: ai_classify # requires Pro tier (nself-ai)
categories: [support, sales, billing, spam]
- type: forward
to: "{{ classification }}@example.com"PLUGIN_MUX_RULES_PATH=/etc/nself/mux-rules.yaml| Channel | How messages arrive |
|---|---|
email | Inbound SMTP via /mux/inbound/email webhook |
webhook | Any HTTP POST to /mux/inbound/webhook/:source |
telegram | Telegram bot webhook (register via BotFather) |
sms | Twilio SMS webhook |
custom | POST to /mux/inbound/custom from your own code |
| Action type | Tier | Description |
|---|---|---|
forward | Pro | Forward message to an email address |
reply | Pro | Send a reply to the message sender |
store | Pro | Insert message into a PostgreSQL table |
webhook | Pro | POST payload to an HTTP endpoint |
notify | Pro | Trigger a push notification via nself-notify |
label | Pro | Apply a label to a Gmail message |
archive | Pro | Archive a Gmail message |
transform | Pro | Apply a Jinja2 template to reshape the payload |
filter | Pro | Drop the message (stop processing) if a condition matches |
delay | Pro | Pause processing for N seconds before the next action |
log | Pro | Write a structured log entry (useful for debugging rules) |
set_var | Pro | Set a variable available to subsequent actions |
conditional | Pro | Branch to different action sets based on a condition |
ai_classify | Pro | Classify message into categories using nself-ai |
ai_summarize | Pro | Generate a summary of the message content using nself-ai |
ai_extract | Pro | Extract structured fields from unstructured text using nself-ai |
ai_reply | Pro | Draft and send an AI-generated reply using nself-ai |
| Endpoint | Method | Description |
|---|---|---|
/mux/inbound/email | POST | Receive inbound email (webhook from mail server) |
/mux/inbound/webhook/:source | POST | Receive webhook from any named source |
/mux/inbound/custom | POST | Submit a message from your application code |
/mux/rules | GET | List loaded rules and their match counts |
/mux/runs | GET | View recent rule execution history |
/health | GET | Check plugin health |
nself plugin remove muxnself-claw depends on nself-mux for its email pipeline. Remove nself-claw before removing nself-mux, or use --force.
notify action)Port: 3711 | Bundle: ɳClaw ($0.99/mo) or ɳSelf+ ($3.99/mo) | Last Updated: April 2026 | Plugin Version 1.0.12