Using classifaily in n8n

Add AI classification to any n8n workflow using the HTTP Request node. Classify text from any source and branch your automation on the returned label.

What you need

  • A classifaily API key from your dashboard
  • n8n - self-hosted or cloud

Store your API key

In n8n, go to Settings > Credentials and create a new Header Auth credential. Set the name to Authorization and the value to Bearer cai_live_your_key_here. This keeps your key out of individual nodes and reusable across workflows.

Configure the HTTP Request node

Add an HTTP Request node to your workflow and configure it as follows:

  • Method: POST
  • URL: https://api.classifaily.com/v1/classify
  • Authentication: Select the Header Auth credential you created above
  • Body Content Type: JSON
  • Body:
{
  "input": "{{ $json.message }}",
  "categories": ["sales_inquiry", "support_request", "spam", "partnership", "other"]
}

Replace {{ $json.message }} with the expression that maps to the text field from your trigger node.

After configuring, click Execute Node to test. The response will appear in the output panel:

{
  "result": {
    "label": "support_request",
    "confidence": 0.91
  }
}

Branch with the Switch node

Add a Switch node after the HTTP Request node. Set the value to {{ $json.result.label }} and add a rule for each label:

  • Value equals sales_inquiry - connect to CRM node
  • Value equals support_request - connect to helpdesk node
  • Value equals spam - connect to a No-op or end the branch
  • Fallback - connect to a Slack notification for manual review

Add a confidence check

Insert an IF node between the HTTP Request and Switch nodes to filter low-confidence results:

  • Condition: {{ $json.result.confidence }} greater than 0.75
  • True branch - continue to Switch node
  • False branch - route to manual review Slack channel

Full workflow example: contact form routing

  1. Webhook node - receives form submissions
  2. HTTP Request node - POST to classifaily with the form message and categories ["sales", "support", "partnership", "spam"]
  3. IF node - confidence greater than 0.75
  4. Switch node - branches on result.label
  5. Per-branch actions: HubSpot, Zendesk, Gmail forward, Slack

This workflow replaces manual triage and runs 24/7 for fractions of a cent per submission.

Want the full n8n tutorial?

The spam detection blog post walks through a complete n8n implementation.

Read the guide