AutomationFlowsAI & RAG › Score Client Toxicity From Form Submissions with Gpt-4o Mini and N8n Forms

Score Client Toxicity From Form Submissions with Gpt-4o Mini and N8n Forms

ByisaWOW @isawow on n8n.io

This workflow collects a client’s message via an n8n Form, analyzes it with OpenAI (GPT-4o Mini) to score toxicity and identify warning signs, then generates a styled HTML report showing the score, verdict, flags, and protection tips on the form completion page. Receives a…

Event trigger★★★★☆ complexityAI-powered9 nodesForm TriggerOpenAI ChatChain LlmForm
AI & RAG Trigger: Event Nodes: 9 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #17936 — we link there as the canonical source.

This workflow follows the Chainllm → Form Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "kvtoRGoYT0eIxuOT",
  "name": "Toxic Client Detector",
  "tags": [],
  "nodes": [
    {
      "id": "1bf779c0-ff6b-4690-80d5-ddf465772ca4",
      "name": "Sticky Note - Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -48
      ],
      "parameters": {
        "width": 460,
        "height": 992,
        "content": "# Toxic Client Detector\n\nSpot problem clients before you accept the project. Paste any client's first message or project brief into a simple form and get a toxicity score (0-100), a clear verdict, and a full breakdown of warning signs plus protection tips if you still want to take the job.\n\n### How it works\n1. A Form Trigger collects the client's message or project brief as plain text.\n2. A Basic LLM Chain (GPT-4o Mini) scans the text for ten common warning signs: unrealistic deadlines, budget underestimation, blame shifting, scope creep, micromanagement, payment risk, disrespect, vague requirements, pressure tactics, and IP red flags. It also notes positive signs and returns strict, structured JSON.\n3. A Code node turns the JSON into a styled HTML report with red, yellow, and green flag sections.\n4. The Form Ending node shows the score, verdict, flags, and protection tips directly on the form completion page.\n\nVerdict levels: SAFE (0-30), CAUTION (31-55), DANGER (56-75), RUN AWAY (76-100).\n\n### Setup\n1. Open the GPT-4o Mini node and connect your OpenAI credential (replace the YOUR_OPENAI_CREDENTIAL_ID placeholder).\n2. Activate the workflow, then open the Production Form URL from the Form Trigger node.\n3. Paste a client message, submit, and read the report on the same page.\n\n### Customization\n- Edit the prompt in the Score Toxicity node to add or remove warning signs, or adjust the verdict thresholds.\n- Swap GPT-4o Mini for any other chat model.\n- Adjust colors and layout in the Build Result Page node."
      },
      "typeVersion": 1
    },
    {
      "id": "4f4441ab-0db3-4fde-86ed-fd95b07eb9bb",
      "name": "Sticky Note - Collect Message",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 380,
        "content": "## Collect Message\nThe form takes the client's first message or project brief as plain text. No file upload needed."
      },
      "typeVersion": 1
    },
    {
      "id": "add67d9e-26ed-48e9-b96c-b20e7d9738d7",
      "name": "Sticky Note - AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        48
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 668,
        "content": "## AI Analysis\nGPT-4o Mini checks the text against ten warning-sign categories, notes green flags, and returns strict JSON with a 0-100 toxicity score."
      },
      "typeVersion": 1
    },
    {
      "id": "51bfd159-e6ed-4ac0-ab6d-87d9ae3d750f",
      "name": "Sticky Note - Result Page",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 364,
        "content": "## Result Page\nA Code node builds a styled HTML report with red, yellow, and green flags, shown on the form completion page."
      },
      "typeVersion": 1
    },
    {
      "id": "a00571ee-d6d0-44d8-988f-3743dbdc369e",
      "name": "1. Form - Paste Client Message",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        624,
        288
      ],
      "parameters": {
        "options": {},
        "formTitle": "Toxic Client Detector",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Client Message or Project Brief",
              "placeholder": "Paste the client's message here...\n\nExample: Hi, I need a simple website built by tomorrow. It's just a few pages, shouldn't take more than 2-3 hours. My last developer was terrible and never delivered. Budget is $50 but there's potential for more work later. Let me know ASAP.",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Paste the client's first message or project brief below to find out if this client is safe to work with, before it's too late."
      },
      "typeVersion": 2.2
    },
    {
      "id": "8a69d3ec-aaaa-409f-99a7-90b692ec633a",
      "name": "GPT-4o Mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        464
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {
          "maxTokens": 2000,
          "temperature": 0.2
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1a58b2ad-2ba0-4979-ad34-d0e6945492ea",
      "name": "2. Score Toxicity with AI",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        960,
        288
      ],
      "parameters": {
        "text": "You are an expert freelance consultant who helps freelancers avoid difficult clients.\n\nAnalyze this client message or project brief for warning signs of a toxic or problematic client relationship.\n\nCLIENT MESSAGE:\n---\n{{ $json['Client Message or Project Brief'] }}\n---\n\nLook for these red flags:\n- Unrealistic deadlines (ASAP, tonight, by tomorrow, urgent without reason)\n- Budget underestimation (\"simple task\", \"quick job\", \"just a few hours\", very low budget for complex work)\n- Blame shifting (complaining about previous freelancers or developers)\n- Scope creep signals (\"and also\", \"while you're at it\", \"unlimited revisions\", \"few small changes\")\n- Micromanagement (claims to know the technology, wants to dictate how work is done)\n- Payment risk (no budget mentioned, \"we'll discuss later\", offering \"exposure\" or \"portfolio opportunity\")\n- Disrespect signals (\"anyone can do this\", \"it's easy\", \"my nephew can do this\")\n- Vague or missing requirements (no clear deliverables, outcomes, or specifications)\n- Pressure tactics (\"we have many projects for you\", \"this could lead to big things\", \"bonus if done fast\")\n- Ownership or IP red flags (\"we own everything\", \"no questions asked NDA\")\n\nAlso note any GREEN FLAGS (positive signs like clear requirements, realistic budget, professional tone, etc.)\n\nReturn ONLY raw JSON. No markdown. No backticks. No text before or after. Use this exact structure:\n{\n  \"toxicity_score\": <number 0-100, higher means more toxic>,\n  \"verdict\": \"<exactly one of: SAFE, CAUTION, DANGER, RUN AWAY>\",\n  \"verdict_reason\": \"<2 sentences explaining the overall assessment>\",\n  \"red_flags\": [\n    { \"flag\": \"<short flag title>\", \"reason\": \"<what in the message triggered this>\" },\n    { \"flag\": \"<short flag title>\", \"reason\": \"<what in the message triggered this>\" }\n  ],\n  \"yellow_flags\": [\n    { \"flag\": \"<short flag title>\", \"reason\": \"<what in the message triggered this>\" }\n  ],\n  \"green_flags\": [\n    { \"flag\": \"<short flag title>\", \"reason\": \"<what in the message triggered this>\" }\n  ],\n  \"protection_tips\": [\n    \"<actionable tip if freelancer still wants to take this project>\",\n    \"<actionable tip>\",\n    \"<actionable tip>\"\n  ]\n}\n\nIf there are no red flags, return an empty array for red_flags. Same for yellow_flags and green_flags.\nVerdict guide: SAFE = score 0-30, CAUTION = 31-55, DANGER = 56-75, RUN AWAY = 76-100",
        "promptType": "define"
      },
      "typeVersion": 1.4
    },
    {
      "id": "de308ff6-6909-4ad0-8058-cc19ddec1256",
      "name": "3. Code - Build Result Page",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        288
      ],
      "parameters": {
        "jsCode": "const raw = $input.first().json.text || '';\n\nlet data;\ntry {\n  const cleaned = raw.replace(/```json\\n?/g, '').replace(/```/g, '').trim();\n  data = JSON.parse(cleaned);\n} catch (e) {\n  return [{ json: { html: '<div style=\"font-family:sans-serif;padding:40px;text-align:center;\"><h2 style=\"color:#ef4444;\">Parsing Error</h2><p>Could not parse AI response. Please try again.</p></div>' } }];\n}\n\nconst score = Number(data.toxicity_score) || 0;\n\nconst verdictMap = {\n  'SAFE':      { bg: '#22c55e', label: 'SAFE TO WORK WITH' },\n  'CAUTION':   { bg: '#f59e0b', label: 'PROCEED WITH CAUTION' },\n  'DANGER':    { bg: '#f97316', label: 'HIGH RISK CLIENT' },\n  'RUN AWAY':  { bg: '#ef4444', label: 'RUN AWAY' }\n};\nconst vc = verdictMap[data.verdict] || { bg: '#6b7280', label: data.verdict || 'UNKNOWN' };\n\nconst scoreColor = score <= 30 ? '#22c55e' : score <= 55 ? '#f59e0b' : score <= 75 ? '#f97316' : '#ef4444';\n\nconst li = function(arr, color) {\n  return (arr || []).map(function(item) {\n    const flag = item.flag || item;\n    const reason = item.reason || '';\n    return '<li style=\"margin-bottom:8px;line-height:1.5;color:#374151;\">'\n      + '<span style=\"font-weight:600;\">' + flag + '</span>'\n      + (reason ? '<br><span style=\"font-size:11px;color:#9ca3af;\">' + reason + '</span>' : '')\n      + '</li>';\n  }).join('');\n};\n\nconst simpleLi = function(arr) {\n  return (arr || []).map(function(i) {\n    return '<li style=\"margin-bottom:6px;line-height:1.5;color:#374151;\">' + i + '</li>';\n  }).join('');\n};\n\nconst redSection = (data.red_flags && data.red_flags.length > 0)\n  ? '<div style=\"background:#fef2f2;border:1px solid #fecaca;border-radius:14px;padding:20px;margin-bottom:14px;\">'\n    + '<h3 style=\"margin:0 0 12px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:#dc2626;font-weight:700;\">Red Flags - Serious Concerns</h3>'\n    + '<ul style=\"margin:0;padding-left:18px;\">' + li(data.red_flags) + '</ul>'\n    + '</div>'\n  : '';\n\nconst yellowSection = (data.yellow_flags && data.yellow_flags.length > 0)\n  ? '<div style=\"background:#fffbeb;border:1px solid #fde68a;border-radius:14px;padding:20px;margin-bottom:14px;\">'\n    + '<h3 style=\"margin:0 0 12px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:#b45309;font-weight:700;\">Yellow Flags - Watch These</h3>'\n    + '<ul style=\"margin:0;padding-left:18px;\">' + li(data.yellow_flags) + '</ul>'\n    + '</div>'\n  : '';\n\nconst greenSection = (data.green_flags && data.green_flags.length > 0)\n  ? '<div style=\"background:#f0fdf4;border:1px solid #bbf7d0;border-radius:14px;padding:20px;margin-bottom:14px;\">'\n    + '<h3 style=\"margin:0 0 12px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:#15803d;font-weight:700;\">Green Flags - Positive Signs</h3>'\n    + '<ul style=\"margin:0;padding-left:18px;\">' + li(data.green_flags) + '</ul>'\n    + '</div>'\n  : '';\n\nconst tipsSection = (data.protection_tips && data.protection_tips.length > 0)\n  ? '<div style=\"background:#f0f9ff;border:1px solid #bae6fd;border-radius:14px;padding:20px;margin-bottom:20px;\">'\n    + '<h3 style=\"margin:0 0 12px;font-size:13px;text-transform:uppercase;letter-spacing:1px;color:#0369a1;font-weight:700;\">If You Still Take This Project</h3>'\n    + '<ul style=\"margin:0;padding-left:18px;\">' + simpleLi(data.protection_tips) + '</ul>'\n    + '</div>'\n  : '';\n\nconst html =\n  '<div style=\"font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;max-width:700px;margin:0 auto;padding:20px;\">'\n\n  + '<div style=\"background:linear-gradient(135deg,#1a1a2e 0%,#16213e 100%);border-radius:20px;padding:36px;text-align:center;margin-bottom:20px;box-shadow:0 8px 32px rgba(0,0,0,0.3);\">'\n    + '<div style=\"font-size:13px;font-weight:600;color:rgba(255,255,255,0.5);text-transform:uppercase;letter-spacing:2px;margin-bottom:8px;\">TOXICITY SCORE</div>'\n    + '<div style=\"font-size:88px;font-weight:900;color:' + scoreColor + ';line-height:1;text-shadow:0 0 30px ' + scoreColor + '40;\">' + score + '</div>'\n    + '<div style=\"font-size:15px;color:rgba(255,255,255,0.4);margin:2px 0 20px;\">out of 100</div>'\n    + '<div style=\"display:inline-flex;align-items:center;gap:8px;background:' + vc.bg + ';color:#fff;padding:10px 28px;border-radius:99px;font-size:15px;font-weight:800;letter-spacing:0.5px;\">'\n      + vc.label\n    + '</div>'\n    + '<p style=\"margin:16px auto 0;font-size:13px;color:rgba(255,255,255,0.7);max-width:500px;line-height:1.6;\">' + (data.verdict_reason || '') + '</p>'\n  + '</div>'\n\n  + redSection\n  + yellowSection\n  + greenSection\n  + tipsSection\n\n  + '<div style=\"text-align:center;color:#d1d5db;font-size:11px;padding-top:16px;border-top:1px solid #f3f4f6;\">'\n    + 'Powered by n8n + OpenAI \u00b7 Always use your own judgment'\n  + '</div>'\n\n  + '</div>';\n\nreturn [{ json: { html } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "a5fc101d-fb30-47b5-a70a-9db0b8564f08",
      "name": "4. Form - Show Report",
      "type": "n8n-nodes-base.form",
      "position": [
        1520,
        288
      ],
      "parameters": {
        "operation": "completion",
        "respondWith": "showText",
        "responseText": "={{ $json.html }}"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "cd325bf3-76c1-43a3-ba78-3625779091b8",
  "nodeGroups": [],
  "connections": {
    "GPT-4o Mini": {
      "ai_languageModel": [
        [
          {
            "node": "2. Score Toxicity with AI",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "2. Score Toxicity with AI": {
      "main": [
        [
          {
            "node": "3. Code - Build Result Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Code - Build Result Page": {
      "main": [
        [
          {
            "node": "4. Form - Show Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Form - Paste Client Message": {
      "main": [
        [
          {
            "node": "2. Score Toxicity with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow collects a client’s message via an n8n Form, analyzes it with OpenAI (GPT-4o Mini) to score toxicity and identify warning signs, then generates a styled HTML report showing the score, verdict, flags, and protection tips on the form completion page. Receives a…

Source: https://n8n.io/workflows/17936/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Episode 11: AI shorts factory app. Uses httpRequest, googleSheets, lmChatOpenAi, lmChatOllama. Event-driven trigger; 96 nodes.

HTTP Request, Google Sheets, OpenAI Chat +15
AI & RAG

Host Your Own AI Deep Research Agent with n8n, Apify and OpenAI. Uses outputParserStructured, lmChatOpenAi, formTrigger, chainLlm. Event-driven trigger; 87 nodes.

Output Parser Structured, OpenAI Chat, Form Trigger +7
AI & RAG

This template attempts to replicate OpenAI's DeepResearch feature which, at time of writing, is only available to their pro subscribers.

Output Parser Structured, OpenAI Chat, Form Trigger +8
AI & RAG

My workflow 53. Uses formTrigger, httpRequest, lmChatOpenAi, form. Event-driven trigger; 74 nodes.

Form Trigger, HTTP Request, OpenAI Chat +15
AI & RAG

This workflow serves as a comprehensive "Workflow Nodes SEO & Documentation Generator". It uses AI to analyze, rename, and document n8n workflows, offering a streamlined way to optimize workflow reada

Form Trigger, n8n, Output Parser Autofixing +11