Ali FarhanMARKETING LAB
LAB / 01/MARKETING OPERATIONS/LOCAL RULES ENGINE

INQUIRY TRIAGE,
END TO END.

One synthetic message becomes a classified record, an approved-info draft or a human handoff, a lead, and a follow-up task — in that order. Run the edge cases yourself. The pipeline is deterministic: the same input follows the same rule path and produces the same decision every time.

Independent demonstration · synthetic messages · drafts are never sent · no inbox, CRM or n8n connected
Live workbench

Send in a synthetic message.

Choose a prepared case or edit the fields. Nothing leaves this browser tab; there is no server endpoint behind the Run button.

Input / synthetic message local only

Rule precedence: validation → duplicate → opt-out → complaint → refund/billing → order privacy → approved FAQ → human handoff.

No run yet Run a case to see the trace.

The result panel will show the matched rule, the routing outcome, the masked lead record and the scheduled follow-up.

0Processed
0Drafts ready
0Human handoffs
0Opt-outs / dupes
0Messages sent
Session ledger

What the pipeline kept.

In-memory session records only. Contact values are masked; no raw email or phone is written to the export.
MessageClassificationOutcomeLeadFollow-upContact
No records in this session yet.

The JSON export contains the full audit trail, summary counters, masked leads and queued follow-ups. It contains no message-sending event because none exists.

Follow-up queue

Tasks created by the routing step. Queued for a person — not scheduled with a messaging provider.

queued, never sent
TaskLeadChannelDueActionStatus
No follow-ups queued in this session.
How it decides

Guardrails before convenience.

The pipeline is intentionally conservative. A human reviews every draft; the demo never claims to have contacted anyone.

01 / VALIDATE

Bad input goes nowhere

Message length, contact format and channel are checked first. A failed record produces errors, not a lead.

  • Message required, 8–1,200 characters.
  • Email or phone must be well formed.
  • No classification of invalid input.
02 / CLASSIFY

Specific before general

Compliance and service exceptions are checked before commercial intent, so “stop” is never treated as a product question.

  1. Opt-out / suppression
  2. Complaint or service failure
  3. Refund / billing
  4. Order privacy
  5. Approved FAQ intent
  6. Unknown → human
03 / ROUTE

No invented answers

Only three fixed FAQ answers can produce a draft. Complaints, refunds, order data and unknown intent go to a person.

  • Draft status: ready for approval.
  • Human queue has priority levels.
  • Follow-up is queued, never sent.
Approved information used by the demo
  • Sizing & fitDirects the contact to the approved size chart and asks them to confirm item and preferred fit; no fit guarantee.
  • Shipping & deliveryTiming and charges are confirmed at checkout; no delivery date is promised beforehand.
  • Price & availabilityPrice and stock are confirmed by the team; no item is held or reserved until then.

Source: lab/lib/pipeline.js · deterministic keyword and precedence rules · no LLM call. Automated tests cover each branch.