Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Files & Cloud Storage

Files & Cloud Storage

Generate Google Drive invoice PDFs from plain text with OpenAI and PDFCrowd

When another workflow calls it, it manages files with OpenAI / ChatGPT using Google Drive, Google Sheets.

What it does

# Generate invoice PDFs from plain text with AI Send this any messy description of a job, booking or order and it returns a finished invoice PDF in Google Drive. An AI step reads the text, pulls out the client details and line items, does the subtotal and tax maths, and the result is rendered into a styled A4 invoice. Built as a sub-workflow, so a chat assistant or form can call it. ### How it works 1. A parent workflow calls this one with a free text description of the invoice. 2. An AI agent normalises the text into fixed fields: invoice number, client details, line items, quantity, unit price, subtotal, tax and total. It never invents values, and a parser retries on malformed JSON. 3. Your own company tax number and today's date are added to those fields. 4. A Code node builds a styled HTML invoice from the data. 5. A PDF service renders that HTML to an A4 page with proper margins. 6. The PDF is uploaded to a Google Drive folder, named after the invoice number. 7. The two working tabs in the sheet are cleared for the next run, and the Drive link is returned to the caller. ### Setup 1. Add your OpenAI API key and connect your Google Drive and Google Sheets accounts. 2. Sign up with PDFCrowd, base64 encode your username and API key as username:key, and paste it into Convert HTML to PDF. 3. Replace YOUR_DRIVE_FOLDER_ID with the folder for invoices, and YOUR_GOOGLE_SHEET_ID with your working sheet. 4. Open Build the invoice fields and Build the invoice HTML to add your company name, tax number, address and logo. ### Customization Edit the output parser fields to capture different line items, or change the tax rate in the HTML.

The steps

  1. Start with invoice details
  2. Read the invoice details
  3. Chat model
  4. Output Parser - Invoice fields
  5. Chat model - Parser auto-fix
  6. Upload the PDF to Drive
  7. Return the file link
  8. Build the invoice HTML
  9. Clear the input tab
  10. Clear the output tab
  11. Build the invoice fields
  12. Convert HTML to PDF

Similar automations