Automation · Case study
Booking Emails → Pipedrive Automation
n8n workflow that turns booking inquiry emails into clean Pipedrive deals, using AI only where it is needed.
The challenge
A German accommodation business received booking inquiries by email in several formats, and staff copied each one into Pipedrive by hand.
What I built
Built an n8n workflow triggered by Gmail that parses fixed-format form emails with rules, sends only free-text messages to AI, handles CSV attachments and German characters, checks for duplicates, and creates persons, organizations and deals with booking details.
Results
- About 2 minutes from inquiry email to a Pipedrive deal
- Saves at least a minute of manual entry per inquiry
- No more copying inquiries into the CRM by hand
- Lower AI cost: rules handle the predictable emails
- CSV attachments and German characters handled correctly
- Duplicate checks keep Pipedrive clean
Tech stack
- n8n
- Gmail API
- Pipedrive API
- OpenAI API
Code sketch
A simplified illustration of the core logic, not production code.
// Rules first, AI only when needed
const parseInquiry = async (email) => {
// Website form emails follow a fixed pattern: no AI needed
if (isFormSubmission(email)) {
return parseWithRules(email.body);
}
// Free-text messages: let AI extract the fields
return await extractWithAI(email.body, {
fields: ['name', 'company', 'checkIn', 'checkOut', 'guests', 'city']
});
};
const inquiry = await parseInquiry(email);
const person = await pipedrive.findOrCreatePerson(inquiry);
await pipedrive.createDeal({ person, ...inquiry });