Lead qualifier that scores inbound enquiries and drafts the reply

Built this for inbound enquiry handling and thought it might be useful to others.

Flow: Webhook → Code node (builds the prompt) → HTTP Request (Claude via
OpenRouter) → Code node (parses) → Google Sheet + Slack alert.

An enquiry comes in and about nine seconds later you get a score out of 100, a
short reasoning, and a reply drafted well enough to send as-is. Only leads
scoring 70+ trigger a Slack ping, so the low-value ones get logged silently
instead of interrupting anyone.

Two things that made it reliable enough to actually leave running:

  1. Strict JSON schema on the request (response_format with strict: true), so the
    model cannot return a shape the workflow can’t handle. This was the single
    biggest fix - before that, roughly one response in twenty came back wrapped
    in prose and broke the parse node.

  2. The parse node checks for an error field and validates the response shape
    before touching it, with a regex fallback if a provider ever wraps the JSON
    in a code fence.

Prompt lives in one Code node, so retargeting it to a different business is a
single paragraph rewrite rather than a rebuild.

Short clip of it running attached. https://drive.google.com/file/d/1qMrK0DeAf9IPNJ-eSxvszv5WQE9aYqbE/view?usp=sharing

Happy to answer questions on any part of it. I also build these for people if
anyone needs one - I work fully async, everything in writing.