---
title: "Webhook requests sorted into four routes by Claude"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/69bf5286-111f-43d4-8acf-b3e7df70c727"
updated: "2026-11-12"
---

# Webhook requests sorted into four routes by Claude

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow with a webhook: post any request and Claude Haiku 4.5 labels it support, technical, sales or general, with a priority and a one-line summary. The caller gets that label back in the same call.

Webhook requests sorted into four routes by Claude is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow sorts incoming requests with Claude. It listens for a POST at the path `ai-router` and sends the request’s body to Anthropic’s Messages API. There `claude-haiku-4-5` answers with a route (support, technical, sales or general), a priority and a one-sentence summary. A Code node reads that answer, and a Switch node splits the request across four outputs. The caller gets the same three fields back as JSON. Five nodes do the work, and no sticky notes explain them.

### Who it suits

Developers and small teams who collect mixed requests through one form or endpoint and want a first label before a person reads each one. Skip it if the Switch’s outputs must do something out of the box. As imported, they are empty, and only the reply shows the route.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Software | Support leads | Post each contact form entry and read the route in the reply | A lead sees a bug report come back as technical with high priority. |
| Agencies | Account managers | Sort enquiries from a site’s form before they reach the inbox | An agency sees a quote request labeled sales. |
| Ecommerce | Shop owners | Label messages from a store’s contact page | A shop sees a late-order question labeled support. |
| Internal tools | Developers | Put the routing step behind a company’s own forms and apps | An intranet form gets a route and a summary for each ticket. |

You need a little n8n: import a file, give it one Anthropic key and send a test request with curl or any tool that posts JSON.

### Where to use it

Any n8n that can reach Anthropic’s API will run it. The Switch node is the place to add whatever should happen next.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps
- A form or an app: let it post its JSON to the webhook’s address
- Slack, email or a help desk: attach a node to the output you want, one for each route

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. One Anthropic key is all it needs.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| Anthropic | An API key for the Messages API. The call uses \`claude-haiku-4-5\` |
| A sender | curl, a form or any app that can post JSON to a web address |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Give your n8n server a variable named `ANTHROPIC_API_KEY` with your key. The `x-api-key` header in `Claude Classifier` reads it. Where you cannot set server variables, type your key over that header’s expression.
3. Open `Incoming Webhook` and copy its test address. Its path is `ai-router`.
4. Save, press Execute workflow and post a JSON body to the test address.
5. Check the reply, then attach your own nodes to the outputs of `Route Switch`.
6. Press Publish and post to the production address.

### How to use it

Post any JSON, such as a message and a name, to the webhook’s address. The reply comes back in the same call with `route`, `priority` and `summary`. Inside the run, `Route Switch` sends the request down the output named after the route, and general or anything unmatched goes to the fourth.

What to change for a different result

| To change | Where |
| --- | --- |
| The route names | The system message in \`Claude Classifier\` and the three rules in \`Route Switch\`, which must match |
| The model | \`model\` in \`Claude Classifier\`, \`claude-haiku-4-5\` in the file |
| The length of the answer | \`max\_tokens\` in \`Claude Classifier\`, 100 in the file |
| The reply | The JSON in \`Return Route Result\` |
| The leftovers | The fourth output of \`Route Switch\`, which takes general and anything unmatched |

### Example

A site’s contact form posts a message saying the export button shows an error since yesterday’s update, with the sender’s name.

Claude answers with a small JSON object: a route such as technical, a priority such as high and one sentence about the failing export. The caller gets `received: true` with those three fields. The request waits at the technical output of `Route Switch` with its original payload, ready for a node of yours.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one runs from the webhook to Claude, then reads the answer and sorts it. The reply node hangs on a second line from the webhook, below the first. Send three different messages, then open `Parse Classification` to see what Claude returned for each.

**For experts.** The Claude call is a plain HTTP request with the key in a header and the body written as JSON text.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Claude Classifier\` | Posts to \`https://api.anthropic.com/v1/messages\` with \`anthropic-version\` 2023-06-01 | The request’s text goes in through \`JSON.stringify\`, twice |
| \`Parse Classification\` | Takes the first \`{...}\` from Claude’s text and parses it | A failed parse becomes route \`general\`, priority \`medium\`, summary \`Unable to classify\` |
| \`Route Switch\` | Three rules on \`route\`, ignoring case | The fourth output takes everything else |
| \`Return Route Result\` | Answers the webhook with JSON | It reads \`Parse Classification\` by name, so it needs to run after that branch |

### Good to know

The router labels and answers, but nobody receives the request yet. Two expressions also needed repair.

- Nothing happens next: the four outputs of \`Route Switch\` have no node attached, so a request stops there until you add yours
- Repairs: in the original copy the fallback sat outside \`options\`, where n8n ignores it, so a general request had no output. The Claude request pasted the payload’s JSON between quote marks, which breaks the body, and the reply’s \`summary\` could break the same way. Mindket’s copy moves the fallback and wraps both in \`JSON.stringify\`
- Order: the reply reads Claude’s answer, so keep \`Return Route Result\` below \`Claude Classifier\`. n8n’s current execution order runs branches from the top of the canvas down
- Model: Anthropic’s deprecations page, read on 12 November 2026, lists \`claude-haiku-4-5-20251001\` as active, with no shutdown date announced
- Billing: Anthropic bills one Messages call a request, with at most 100 tokens in the answer
- Open webhook: once published, anyone who knows the address can post to it and spend your key. Add authentication in \`Incoming Webhook\` before you share it
- Your data: the whole request body goes to Anthropic
- Credentials: the JSON holds none and reads your key from a server variable

## README

```markdown
# Webhook requests sorted into four routes by Claude

An n8n workflow with a webhook. You post any request to it, and Claude Haiku 4.5 labels the request support, technical,
sales or general, with a priority and a one-sentence summary. The caller gets that label back in the same call, and a
Switch node splits the request across four outputs for nodes of your own.

## What is inside

- `workflow.json`: the workflow as n8n exports it, five nodes and no sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- `Route Switch` had `fallbackOutput` set to `extra` outside its `options`, where n8n ignores it, so a request labeled
  general had no output. The setting now sits in `options`, and the node shows a fourth output.
- `Claude Classifier` put `JSON.stringify($json.body || $json)` between quote marks inside its JSON body. The payload's
  own quote marks ended the string early, so any real request broke the body. The text now goes through a second
  `JSON.stringify`, which adds the outer quotes and escapes the inner ones.
- `Return Route Result` put Claude's `summary` between quote marks the same way. It now uses `JSON.stringify`, so a
  quote mark in the summary no longer breaks the reply.
- The webhook's `webhookId` and the file's template ids are gone. Nothing else changed: the model, the API version and
  the wiring are the file's own. We checked the two body repairs by filling the templates in a script, and have not run
  them in a live n8n.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- An Anthropic API key for the Messages API, with access to `claude-haiku-4-5`.
- A way to send a POST with a JSON body, such as curl or a form.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Give your n8n server an environment variable named `ANTHROPIC_API_KEY` with your key. The `x-api-key` header in
   `Claude Classifier` reads it as `$env.ANTHROPIC_API_KEY`. Where you cannot set server variables, type your key over
   that expression instead. n8n can also block variable access in expressions: its security settings page lists
   `N8N_BLOCK_ENV_ACCESS_IN_NODE`, which is false by default.
3. Open `Incoming Webhook` and copy its test address. The path is `ai-router`.
4. Save, press Execute workflow and post a JSON body to the test address, such as a message and a name.
5. Read the reply, then attach your own nodes to the outputs of `Route Switch`.
6. Press Publish and post to the production address.

## How a run goes

1. `Incoming Webhook` (Webhook 2) listens for a POST at `ai-router` and holds the answer until `Return Route Result`
   replies.
2. `Claude Classifier` posts to `https://api.anthropic.com/v1/messages` with `anthropic-version` 2023-06-01,
   `claude-haiku-4-5` and `max_tokens` 100. Its system message tells Claude to answer only with a JSON object that
   holds the route, the priority and a summary, and to pick the route from support, sales, technical and general.
3. `Parse Classification` reads the first text block, takes the first `{...}` from it and parses it. When that fails it
   uses route `general`, priority `medium` and summary `Unable to classify`. It keeps the webhook's item as
   `originalPayload`.
4. `Route Switch` (Switch 3) compares `route` with support, technical and sales, ignoring case. The fourth output
   takes everything else.
5. `Return Route Result` (Respond to Webhook) answers with JSON: `received`, `route`, `priority` and `summary`.

The webhook feeds two lines: `Claude Classifier` above and `Return Route Result` below. The file's execution order is
`v1`, which runs the upper line to its end before the lower one, so the reply can read what `Parse Classification`
found. Keep the reply node below the classifier on the canvas.

## Change the look

- Routes: the list in the system message of `Claude Classifier`, and the three rules in `Route Switch`. Keep them in
  step. A new route needs a new rule and a new output.
- Model: `model` in the JSON body of `Claude Classifier`.
- Length: `max_tokens` there. 100 is enough for a route, a priority and one sentence.
- Reply: the JSON in `Return Route Result`.
- What happens next: attach nodes to the outputs of `Route Switch`, such as a Slack message for support or a CRM row for
  sales. Each one receives the route, the priority, the summary and `originalPayload`.

## Good to know

- The four outputs of `Route Switch` have nothing attached. The workflow labels and replies, and the request stops at
  the Switch until you add your own nodes.
- Anthropic's deprecations page, read on 12 November 2026, lists `claude-haiku-4-5-20251001` as active, with no
  shutdown date announced.
- Each request is one Messages API call, with at most 100 tokens in the answer.
- Once the workflow is published, anyone who knows the address can post to it and spend your key. Add authentication
  in `Incoming Webhook` before you share it.
- The whole request body goes to Anthropic. Keep out anything you do not want a model to read.
- The file holds no credential and no key. It reads yours from a server variable.
```

## What is in it

3 files, 12 KB, downloaded as a zip.

```text
NOTICE.md  594 B
README.md  5 KB
workflow.json  6 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 5 steps, starting when its webhook is called
- AI: No step calls an AI model
- Sign-ins: No sign-in
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 5 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/69bf5286-111f-43d4-8acf-b3e7df70c727)
- [Its page on Mindket](https://mindket.com/p/69bf5286-111f-43d4-8acf-b3e7df70c727)
