Quick Overview
This workflow monitors Gmail for unread RFQ emails, optionally extracts text from attached PDFs, and uses OpenAI to pull structured quote details and check completeness before creating a Gmail draft reply with either a quote skeleton or a targeted missing-information request.
How it works
- Triggers every minute when an unread Gmail message matches the RFQ subject search query.
- Normalizes key email metadata (sender, subject, thread ID, timestamp) and the email body text for downstream use.
- If a PDF attachment is present, extracts the PDF text and appends it to the email body to form a single RFQ text payload.
- Uses OpenAI to extract structured RFQ fields (company, contact, line items, dates, address, packaging, incoterms, and special requirements) while leaving unstated fields as null.
- Checks the extracted data against a configurable required-field list and produces a missing-items summary and a complete/incomplete flag.
- Creates a Gmail draft reply in the same thread that either includes a quote skeleton with line items (for complete RFQs) or requests only the missing details (for incomplete RFQs).
Setup
- Connect your Gmail account and ensure it can read unread emails and create drafts in your mailbox.
- Add an OpenAI credential and select the model you want to use for the extraction step.
- Update the Gmail trigger search query to match how RFQs arrive in your inbox and confirm attachment downloading is enabled.
- Edit the required fields list in the completeness check code to match what your team needs before an RFQ is quotable.
- Review and customize the two Gmail draft message templates (quote skeleton and missing-info request) to match your company wording and quoting process.