Skip to content
Automation Squad
GAIPSMade to order

Lead capture & routing

Gmail enquiry → AI-extracted Pipedrive person + lead, Slack alert to the owner

Enquiry emails turn into Pipedrive leads with the details already filled in.

Enquiries that arrive by email, including the notifications your website form sends, are read by a model and logged in Pipedrive as a person and a lead. Name, company, phone and the ask are pulled from the message, not typed. Auto-replies and newsletters are filtered out first. The owner gets a Slack message with the summary and a link, and the Gmail thread is labelled so nothing is logged twice.

How it works

  1. G

    Trigger

    New email matching a Gmail label or search, polled every minute

    Gmail

  2. if

    Step 1

    Drop anything that is not an enquiry

    Messages with Auto-Submitted or List-Unsubscribe headers, bulk precedence, or a sender on your ignore list are labelled and skipped before any model call is made.

  3. AI

    Step 2

    Extract the enquiry from the message

    The model reads subject and body and returns JSON: name, company, email, phone, the ask and a one-line summary; for a website-form notification it uses the visitor's email in the body, not the sender.

  4. P

    Step 3

    Find or create the person

    Pipedrive is searched for the extracted email; a match returns the existing person, otherwise one is created with name, email, phone and organisation, and a returning person is flagged for the owner.

  5. P

    Step 4

    Create the lead with a note

    Next, a lead titled '{company}: {ask}' is attached to the person and the owner, with the model's summary and the original email text saved as a note on it.

  6. G

    Step 5

    Label the thread

    Gmail then labels the thread CRM/Logged, which removes it from the trigger's search and shows in the inbox that it has been handled.

  7. S

    Step 6

    Alert the owner

    Slack sends the owner a direct message with the summary, the extracted fields, the new-or-returning flag and a link to the Pipedrive lead.

  8. if

    Step 7

    Catch failures for human review

    If the model returns nothing usable or Pipedrive rejects the call, the thread is labelled CRM/Needs review and a Slack message asks someone to log it by hand, with the error attached.

What changes once it runs

  • Within a couple of minutes of the email arriving, Pipedrive holds a lead with the person and a note.
  • Contact details come out of the email body, so website-form notifications are logged with the visitor's address, not the form's.
  • Newsletters, out-of-office replies and known senders never reach the CRM.
  • The owner is told in Slack with a summary and a link, and the Gmail thread carries a label saying it has been logged.
  • Anything the model cannot parse is labelled for review instead of silently dropped.

What you get

  • Workflow export for n8n, including the error workflow that handles review cases.
  • The extraction prompt as an editable file, with the JSON schema the model must return.
  • Setup guide for Gmail OAuth, the label and search, the Pipedrive token, the OpenAI key and the Slack app.
  • Mapping sheet from extracted fields to Pipedrive person, organisation and lead fields.
  • Walkthrough recording of three test emails: a real enquiry, a form notification and an auto-reply.
  • Make scenario built to the same shape, with its own error handler.

Before you start

  • A Gmail or Google Workspace mailbox that receives the enquiries, and a label or search that catches them (the guide covers both).
  • Self-hosted n8n needs a Google Cloud project with the Gmail API enabled and an OAuth client; n8n Cloud signs in to Google without one.
  • Pipedrive on any plan, with an API token from your account settings; the Leads Inbox is included on every plan.
  • An OpenAI API key with billing enabled.
  • One Slack workspace where you can install an app.
  • n8n Cloud or self-hosted n8n; the trigger polls, so no public URL is needed for this one.

Built for

Questions before you buy

Can it use Claude or another model instead of OpenAI?
Yes. The extraction step is a single node with the prompt and schema attached; pointing it at Anthropic, Gemini or a local model through n8n's model sub-nodes is a one-node swap. The rest of the workflow never sees which model answered.
What if the model gets a field wrong?
Nothing is hidden. The note on the lead keeps the original email text, so the owner sees the source next to the extraction. The prompt tells the model to return null for anything it is unsure of rather than guess, and a result with no email and no phone goes to the review label instead of Pipedrive.
How does it avoid logging the same email twice?
Two things. The trigger's search excludes the CRM/Logged label, which is applied the moment the lead is created, and a reply on a thread that already carries the label is spotted by checking the thread and skipped. If you would rather have replies added as notes on the lead, the guide shows the one change to make.
Why is there no Zapier version?
Zapier is left out because the header filtering, the JSON extraction and the review branch need more steps than a Zap handles cleanly. The Make scenario follows the same shape and has its own error handler.
Will it run on n8n Cloud's cheapest plan?
It does. This one polls Gmail rather than receiving a webhook, so it runs on the entry plan or on a self-hosted instance with no public URL at all.

Nearby on the shelf

Whole catalog