Ahsan Ishaq.
AI Automation Engineer

Ahsan Ishaq

I build AI agents and automations that do real work for businesses.

Chatbots that answer customers day and night. Workflows that qualify leads, book appointments and send the right alert to the right person. I build them in n8n with Claude and OpenAI, and I run them on servers I set up myself.

Open to roles: remote worldwide, on-site in Lahore, or abroad with visa sponsorship
Portrait of Ahsan Ishaq
Lahore, Pakistan · working remotely
8+years building software
3AI automation products designed and built
75n8n workflows built
7+years building Android apps
What I do

Four things I build

Everything below is work I've designed and built myself.

AI chatbots and agents

Assistants that talk to customers on a website or WhatsApp, ask the right questions, capture the lead and book the appointment.

Claude API · OpenAI API · WhatsApp Cloud API · Twilio

Workflow automation

n8n workflows that connect the tools a business already uses: email, calendar, Slack, CRMs and any API. Logging, alerts and error handling come built in.

n8n · webhooks · REST APIs · Google Calendar · Slack

AI that answers from your documents

Knowledge bases (RAG) where the AI searches real documents first, and a check stops it from answering when it can't find good evidence.

pgvector · embeddings · hybrid search · reranking

Backend and hosting

PostgreSQL databases, REST APIs and Docker servers, set up and looked after, so the automation keeps running after launch day.

PostgreSQL · Docker · Linux · Cloudflare

Work

Three AI products I designed and built

Each one is a full system: the AI logic, the database, the integrations and the server. Here's what they do and how they work.

CareLayer

Live

AI receptionist for dental and health clinics

n8n · Claude API · PostgreSQL + pgvector · Google Calendar · WhatsApp Cloud API

It sits on the clinic's website, answers patients at any hour in English and Arabic, and books them straight into the clinic's Google Calendar. Staff get an alert the moment a new patient comes in.

The problem

Clinics pay for ads, but a lot of patients message after hours and nobody replies. By morning they've booked somewhere else.

An AI can reply instantly, but in healthcare it must never make things up. It can't promise a slot, a price or an insurance deal it doesn't actually know.

What I built

  • An 80-node n8n workflow behind the website chat. It sends each message to Claude, works out whether this is a real patient, and moves them to booking.
  • The same logic built for WhatsApp through Meta's Cloud API, with duplicate messages filtered out before anything runs.
  • Instant alerts to the clinic on Slack, email and staff phones, one alert per patient.
  • A 29-node REST API behind a staff mobile app for leads and outcomes.
← scroll the diagram →
MESSAGE CLAUDE 1. HOLD SLOT 2. CALENDAR ALERT STAFF website or WhatsApp is this a real patient? row in Postgres Google event Slack · email · phone push, one alert per patient lead slot held slot taken booked
The slot is held in Postgres before anything touches Google Calendar. If two patients ask for 4pm at the same moment, only one can hold it, so nobody gets double-booked. Unused holds are released every 5 minutes.

Answers that come from real sources

Patients also ask about UAE health rules, so CareLayer has a knowledge base on pgvector: 13 current regulator documents, 1,191 pages, 473 chunks. Before the bot answers from it, a step I call the Grounding Gate checks how strong the evidence is.

← scroll the diagram →
QUESTION REWRITE SEARCH RERANK GATE ANSWER NO GUESS from the patient clearer query pgvector hybrid when it helps evidence strong? with its source defer, log the gap yes no
Rerank only runs when search returns enough results to be worth the extra call. When the evidence is weak, the bot defers instead of guessing, and the gap is logged so the knowledge base can be improved.

Decisions I made

  • Hold first, calendar second. A Postgres row can only be claimed once, so two chats can never grab the same slot.
  • A lock around calendar sync. Google can send several change notices at once. A Postgres lock makes sure only one run edits a booking, and an expired sync token (HTTP 410) triggers a full resync automatically.
  • Call Claude's API directly instead of n8n's built-in AI node, so I control the exact request that goes out.
  • Only re-embed what changed. Unchanged documents are skipped, and old versions are kept, so it's always clear what the bot knew and when.
  • Test ideas in a lab copy first. New retrieval methods, like a retriever that rewrites the question and tries again or Anthropic's contextual retrieval, run in separate workflows before they reach the live one.

Hard problems I solved

  • Keeping the AI honest. Prompt rules tell the bot not to quote prices or vouch for an insurer. The rules that can't be allowed to fail also live in code: it can't confirm an appointment the database doesn't hold, name a time it never offered or cite a document it didn't retrieve.
  • Booking that works in real conversations. Code audits and full multi-message chats in English and Arabic turned up 17+ booking defects, and I fixed them all. 6 were silent, the kind that never show up as a crash. 21 unit tests and 11 live conversations confirmed the fixes.
  • Retries only where they're safe. 8 calendar steps retry because repeating them changes nothing. Google's event insert doesn't, because a retry after a timeout could create a second event.
  • Limits on cost and abuse. Each clinic is capped at 500 model calls and $5 of LLM spend a day. Personal data is masked before it reaches the model, and bot challenges and origin locks keep the widget from being abused.
  • Market research at scale. I built an n8n workflow and a Python script that scan clinic websites in batches and record what's on them: chat tools, booking links and ad tracking. I used it to study 105 UAE dental clinics: none showed an AI-branded responder, 32% carried ad pixels and 64% had no privacy policy link. Read the public report.

InboxLayer

Multi-tenant SaaS

Email reply automation for cold-email agencies

n8n · GPT-4o-mini · PostgreSQL · Instantly API · DNS-over-HTTPS

Agencies that send cold email through Instantly get a flood of replies. InboxLayer sorts every reply, follows up with the hot leads automatically and keeps an eye on the health of every sending domain.

What I built

  • Reply Intel (46 nodes) sorts every reply into a category and sends it down the right path.
  • HotLead Closer (49 nodes) picks up a hot reply, checks whether anyone has answered, sends a booking email and follows up if the lead goes quiet. Every step is logged.
  • Domain Sentinel (27 nodes) checks each sending domain's MX, SPF, DKIM and DMARC records, its expiry date and two spam blacklists (SpamCop and Barracuda), then gives it a health score.
  • Unsubscribe Shield (32 nodes) pushes every unsubscribe into Instantly's blocklist, and alerts the team if that fails.
  • 7 API workflows with API-key auth for client info, stats, domain health and the compliance log.

Decisions I made

  • Rules first, AI second. Simple rules sort the obvious replies, and GPT-4o-mini only sees the ones the rules can't decide. It's cheaper and faster, and easy cases never depend on a model.
  • Multi-tenant from day one. Every request checks the client's API key and account status before any work happens, so one system can serve many agencies safely.
  • A claim step on every lead, so the same reply is never handled twice.

60Second

WhatsApp automation

WhatsApp lead qualification for real-estate agencies

n8n · Twilio WhatsApp API · Property Finder webhook · LLM

Designed for small Dubai real-estate agencies: reply to every new property lead on WhatsApp within seconds and ask the questions an agent would ask first, so agents only spend time on serious buyers.

What I built

  • A 26-node workflow on Twilio's WhatsApp API that catches every new lead and starts the conversation.
  • Leads from Property Finder come in through a webhook and join the same pipeline.
  • Separate logs for failed sends, so no lead goes missing without someone knowing.

Decisions I made

  • Check before calling the AI. Simple rules decide whether a message needs the AI at all, so tokens are only spent where they help.
  • A backup plan when the AI is down. The lead still gets a short reply, the owner gets notified and the failure is logged. No lead is left waiting in silence.
Open source

Code you can read

The product code stays private. These two public repos come from the same work, and their checks run on every push.

Error Debugger Skill for n8n

A Claude Code skill that diagnoses n8n errors with a 9-step checklist, backed by 3 field notes reproduced on version 2.41.5 and 7 unit tests.

Reliability Patterns for n8n

4 n8n workflows with SQL for crash alerts that leave out personal data, job heartbeats and expired slot holds, covered by 28 automated checks in CI.

Infrastructure

Self-hosted, end to end

All of this runs on a DigitalOcean server I set up and manage myself. It's lean on purpose: 2 vCPUs and 2 GB of RAM, with no managed platform in between.

Docker

Nine containers, mostly in three Docker Compose projects: n8n with its task runner, PostgreSQL, PgBouncer, Nginx Proxy Manager, an image-rendering service and the web servers.

Database

One PostgreSQL 15 database with pgvector, holding the data for all three products in 200+ tables (n8n's own included), with PgBouncer for connection pooling.

Network and security

Cloudflare in front, SSL through Nginx Proxy Manager, and server access over Tailscale.

Monitoring

Error-handler workflows post to Slack, and a heartbeat alert fires if a scheduled job stops. 40+ encrypted database backups are each checked with pg_restore. A daily health check watches the website's sitemap, robots.txt and redirects, and only alerts when something changes.

Experience

8+ years building software

2025 – Present · Remote

Founder and AI Automation Engineer · Ahsomatic

Ahsomatic is my AI automation studio. I design and build its products on my own infrastructure: CareLayer, InboxLayer and 60Second, 75 n8n workflows in total (24 active), including an 80-node LLM workflow and a RAG knowledge base over 13 current UAE health-regulator documents on PostgreSQL with pgvector.

Jun 2021 – Jul 2025 · Lahore

Senior Android Developer · Magnatec Systems

Contributed 426 commits (Dec 2023 to Jul 2025) in a 3-developer team to SMACC V3, a Java Android point-of-sale app for retail, restaurant, gold and fuel-station billing with 5K+ downloads on Google Play. Integrated NearPay and Intersoft card-payment terminals and Newland and Milestone receipt printers, extended its Saudi ZATCA e-invoicing (global discounts and municipality fees in the invoice XML, environment switching, error handling), implemented municipality taxes, and fixed QA-reported defects across the release cycles.

2017 – 2021 · Pakistan / Remote

Android Developer · AsApp Studio, Ninesol Technologies and other studios

Shipped 10+ Android apps for chat, e-commerce, education and utilities, with OCR, speech-to-text, custom keyboard and accessibility features.

Why the Android years matter here. They taught me to plan for the things that break real systems: a task running twice, a job stopping halfway, data that changes while you're using it. A phone rotating in the middle of a network call and two patients booking the same 4pm slot are the same kind of problem, and I've been solving that kind of problem for years.

How I work

Four habits you'll see in my work

I test the failure, not just the happy path

Wrong ID, bad credential, empty result. I force each failure on purpose and check what the user actually sees.

Important rules live in code

Anything that must never happen, like confirming a booking that doesn't exist, is checked outside the AI model too.

Numbers come from real data

The server and workflow figures on this page were counted on my live server and n8n instance on 4 November 2026, not estimated.

Cost matters from day one

Rules before AI calls. Rerank only when it helps. One well-run server instead of five paid services.

Skills

Tools I use

n8n Claude API OpenAI API PostgreSQL pgvector / RAG Docker Compose JavaScript Python SQL Linux (Ubuntu) Nginx Proxy Manager Cloudflare WhatsApp Cloud API Twilio Google Calendar API Firebase Cloud Messaging Slack API Claude Code Kotlin Java Android SDK Git GitHub Actions

The highlighted ones are what I use every day.

Contact

Need someone who can build it and keep it running?

I'm looking for AI automation and AI engineering roles, full-time or contract: remote anywhere, on-site in Lahore, or abroad with visa sponsorship. Email is the quickest way to reach me.