Workflow templates

Extract email sender details into JSON and sheet rows without a parsing rule

Sai reads the inbound emails, extracts sender name, email, company, domain, subject, intent and any phone or budget mentioned, and appends one row per email with a JSON copy in the last column. In the recorded run it scanned 119 messages, classified 111, and logged the 23 that qualified.

92
% success · 
320
 runs
Gmail
Gmail
google meet
google meet
Google Sheets
Google Sheets
The template
Copy prompt
Take new emails in my [Gmail label: Inbound] and extract each one into structured fields — sender name, email, company, domain, subject, intent, and any phone or budget mentioned. If there is no such label and I have described a category instead, do not rely on a subject-line or sender keyword search to find them. Scan recent inbox messages and classify each one against the category. Report how many you scanned, how many you classified, and how many qualified. For each field, extract only what is stated in the email. Leave a field empty rather than inferring it. In particular: - Company: take it from the signature or the sending domain, not from the person's name - Domain: the sending domain, excluding free providers like gmail.com and outlook.com - Budget and phone: only when explicitly written; do not convert ranges or currencies - Intent: classify into a short fixed set and use the same labels every run Skip anything already logged. Deduplicate on the Gmail message ID, not on subject or sender — threads and repeat senders produce false matches on those. Append one row per email to [this Google Sheet] and keep a JSON copy in the last column, with the same keys and the same order in every row so the column can be parsed downstream. Use null for missing values rather than an empty string or omitting the key. Tell me where the rows went — the tab name and the row range — and what the log count was before and after. List anything you excluded and why, grouped by reason, so I can check the classification. If this is useful, I can run it for you every [hour].

See it run

The recording is a real session. The sheet on the right is what it produced.

Extract email sender details into JSON and sheet rows without a parsing rule
mp4

The run

Sai opens each profile, pulls the signal, and writes the row, live, in a real browser.

Extract email sender details into JSON and sheet rows without a parsing rule

The result

Eight columns, sorted by score, with a source link behind every claim.

Details

What you need

Gmail access and a target Google Sheet. Either a Gmail label, or a description of the category in plain language.

What you get back

One row per email with sender name, email, company, domain, subject, intent, and any phone or budget stated — plus a JSON copy in the last column with consistent keys. The tab name, row range, and before/after log count are reported, along with what was excluded and why.

How long it takes

Make it recurring

Hourly for active inbound. Daily is sufficient where same-hour response is not required.

What is email data extraction?

Email data extraction is the process of turning the contents of an inbound email — the sender, the organisation, the request, any figures or dates in the body — into named fields that another system can read.

An email arrives as two parts: a set of headers, and a body. Headers are standardised. RFC 5322 defines the From field as the author of the message and Reply-To as the address the author nominates for responses; these can differ, and where they do, the reply address is the one that matters operationally. Headers also carry the message identifier, the date, and the subject.

The body is not standardised. A sender's name in the signature block, the company they work for, the size of the request, the deadline they mention — these appear in prose, in whatever form the sender chose. No parser reads them from a defined position.

This split is what makes email extraction different from parsing a form submission. Half the information is in a fixed schema and half is in free text, and the half that usually determines what happens next is the unstructured half.

Why inbound email resists automation

A contact form produces the same fields every time, because the form defined them. An inbound email produces whatever the sender wrote.

Two enquiries about the same thing can arrive as a three-line note with a signature block and as an eight-paragraph message with the budget stated mid-sentence. Both contain the same operational facts. Neither presents them in the same place.

The common workarounds each give something up. A forwarding rule moves the email but does not read it. A regular expression captures a phone number reliably and a company name unreliably. Zapier's Email Parser requires a template drawn on a sample email, which works for machine-generated mail with a fixed layout and does not survive a human writing freely.

The practical result is that inbound email is usually re-keyed by hand into a CRM or a spreadsheet, and the fields that get entered are the ones the person had time for.

Who this applies to

Sales teams handling inbound enquiries. The lead exists in an inbox rather than in the CRM until someone types it in, and the details that qualify it — company, headcount, stated budget, timeline — are in the body.

Support and operations desks. Requests arriving by email need a category, a requester, and an account reference before they can be routed.

Recruiters receiving direct applications. Candidate name, role of interest, and current employer arrive as prose plus an attachment.

Anyone maintaining a spreadsheet from an inbox. The transcription step is the whole job.

Method comparison

Method Reads header fields Reads unstructured body Setup required Survives format changes
Manual re-keying Yes Yes None Yes
Mail filters and forwarding rules Yes No Low Yes
Template parser (Zapier Email Parser, Mailparser) Yes Partly Template per sender format No
Regular expressions Yes Partly Code, per field No
Gmail API script Yes No OAuth, code, hosting Yes
This task Yes Yes Field list, written in plain language Yes

Manual re-keying reads everything correctly. It is the only method in the table that does, and it is listed first for that reason. Its constraint is throughput, not accuracy.

What the task does

Sai opens Gmail as you, reads the messages you specify, and returns JSON with the fields you named.

The field list is written in plain language rather than configured. Asking for sender name, company, email address, request type, stated budget and deadline returns those six keys. Emails where a field is absent return it as null rather than omitting the key, so the output shape stays constant across a batch.

Header fields come from the message headers. Body fields are read from the prose. There is no template to draw and no sample email to train on.

Which identifier to key on

JSON extracted from email is usually written into something else, which means duplicates matter. The Gmail API exposes two identifiers and they are not interchangeable.

id is documented as the immutable ID of the message — one specific email. threadId is the ID of the thread the message belongs to — the conversation, shared by every reply in it.

Keying a record on the thread means a reply updates the existing row. Keying on the message means each reply creates a new one. Which is correct depends on whether the unit of work is the conversation or the individual message, but choosing without knowing the difference produces either silent overwrites or duplicated leads.

Choosing the fields

The output is only as useful as the field list, and the common failure is asking for too much.

Fields that are reliably present in the email get filled. Fields that are usually absent return null across most of the batch, adding keys without adding information.

A short list — who sent it, from where, what they want, and any figure or date they stated — covers most routing and qualification decisions. Fields can be added once the first batch shows what the mail actually contains.

What connects to this

For scheduled outbound rather than inbound processing, scheduling email in Gmail handles the sending side.

Where extracted records feed a sheet that then needs additional company data, lead list enrichment continues from that point.

For inboxes where the question is what needs a response rather than what the mail contains, email management covers triage.

Turn an unlabelled inbox into rows

Free your hands from the computer.

Run this Task