Skip to content

That's just a taste — their profile full of gems!

Visit profile
User avatar
Kenneth Mendoza
October 6880

AI SDR Agent, Ready for Production

Most AI agent builds look good right up until they touch a real pipeline.

That’s the gap I care about most.

I’m not impressed when an agent can research a lead and draft a nice opener once. I care when it can do it 400 times a week, push the right records into HubSpot, avoid double-running on retries, tell me exactly where it broke, and stop instantly when I need it to.

So I spent time finishing the part that actually makes an AI SDR agent usable: scoring + routing and the reliability layer.

The scoring setup is simple on purpose.

After the agent researches the lead, I score the company from 0–100 against the campaign ICP. The model returns structured output, and I validate that response in code before anything touches the CRM.

That validation step matters more than people think.

If the model sends bad JSON, wrapped JSON, or weird markdown fences, I don’t want garbage landing in HubSpot. Especially with Llama-style responses, that little formatting gotcha is enough to quietly corrupt downstream logic if you don’t catch it early.

Once the score is clean, I route it with a Switch:

75+ → create a deal in Qualified, send a Slack hot-lead alert, create a same-day call task.
40–74 → send it to nurture/research, create a follow-up task due in 3 days.
Below 40 → auto-disqualify and write the reason back to the contact.

That one layer removes a lot of human inconsistency.

No more eight SDRs making eight different judgment calls. No more good leads drifting into the wrong stage because somebody was busy or interpreted the ICP differently. Every lead gets the same standard.

Then came the part I actually enjoy most: making it hard to break.

I added dedupe first, before any expensive work happens.

If a webhook retries, the network stutters, or the same lead shows up twice in a CSV, I don’t want to pay for the same run again. So I check Supabase up front. If the lead already exists, I skip the run, log it as a duplicate, and return a clean response.

That’s a small pattern, but it saves real money fast.

I also log every run in Supabase so I can see what happened per lead: status, tool usage, estimated cost, duration, and whether it was processed, skipped, or failed.

That’s the difference between “I think the agent is working” and “I know exactly what this system is costing me.”

Then I built the error workflow properly.

Not just a try/catch vibe. A real n8n Error Trigger workflow linked in settings, writing failed executions into a dead-letter table and sending Slack alerts with the exact workflow, node, execution ID, and error message.

So if a node dies, I know where and why immediately.

I even forced a failure by breaking a database step just to make sure the alert path worked end to end. That’s where the useful real-world stuff showed up:

  • n8n error workflows only fire on production executions, not manual test runs.
  • Slack will happily hit you with not_in_channel if your bot isn’t actually in the channel.

That kind of friction is normal. I’d rather catch it while building than during a client handoff.

I also added retry logic on every external call and a kill switch backed by one database row.

That kill switch is one of my favorite parts because it’s so clean. Flip one value in Supabase and the whole system stops. No redeploy, no digging through branches, no scrambling inside n8n while leads are still flowing in.

That’s what production-ready looks like to me.

Not more AI. More control.

The final workflow now does what I want a real operator to trust:

  • researches leads
  • scores them against a consistent ICP
  • routes them automatically
  • updates HubSpot
  • alerts the team in Slack
  • logs cost and run data
  • catches failures
  • avoids duplicate spend
  • and shuts down instantly when needed

That’s the bar.

If I’m building an agent for sales ops, I want it to behave less like a magic trick and more like infrastructure.

And honestly, this is the part most people skip. They’ll show the agent writing a clever opener, but they won’t show dedupe, dead-letter handling, retries, validation, or kill switches.

That’s exactly where the real work starts.

I’m always biased toward elegant integrations over complicated ones, and this build is a good example of that. Nothing here is flashy. It’s just the right layers in the right places: n8n for orchestration, HubSpot as system of record, Supabase for control and logging, Slack for visibility.

Clean stack. Real safeguards. Much better system.

If you’re building AI workflows right now, my advice is simple:

Don’t stop when the happy path works.
Build the parts that make failure boring.

That’s when the automation becomes usable.

#automation#slack#hubspot#salesops#aiagent#n8n#supabase
Like
Dislike

69

23

Add a comment...