AI Invoice Generator
Send a client's details and a formatted, print-ready invoice lands in their inbox — generated and delivered in seconds, with no template to fill in.
Problem
Invoicing is small, repetitive, and easy to postpone — which is exactly why it slips. Every invoice means opening a template, updating the client name, the service, the amount, the date, incrementing the number, exporting to PDF, writing the email, attaching the file, sending. Ten minutes of low-value work, repeated for every job — and the errors are quiet ones: a stale figure copied from the last invoice, a duplicated invoice number, a client who never receives theirs because the send got forgotten during a busy afternoon.
Before
Invoicing was a fully manual, multi-app task — template, PDF export, email, attachment — with no guarantee it happened the same way twice, or at all.
After
A webhook-triggered workflow builds a structured prompt, generates a styled HTML invoice, and emails it straight to the client. Nothing depends on someone remembering to send it.
Interactive workflow
Click through the actual node graph
Generation, constrained
Using a model for document layout trades consistency for flexibility. A fixed HTML template would produce byte-identical invoices every time; generating one instead lets the layout adapt to varied inputs without maintaining template variants. The trade-off is kept narrow on purpose: the prompt specifies exact output requirements — HTML only, inline CSS, no markdown fences, starting directly at the opening tag — and every variable that matters financially (client name, email, service, amount, invoice number, date, payment terms) is injected into the prompt rather than left for the model to invent.
The invoice number and issue date are computed at runtime in the workflow, not requested from the model, so those two values stay deterministic even though the surrounding document is generated fresh each time.
Why inline CSS and a print stylesheet
Email clients strip external stylesheets, so styling has to travel with the markup — every rule is inline. A print media query hides the "Print Invoice" button when the page actually prints, so the client is left with a clean document rather than a webpage with a stray button on it.
Delivered in the body, not as an attachment
The generated HTML is emailed to the client rendered inline, in the message body, rather than buried in an attachment they have to open first. That removes the last manual step between "invoice generated" and "client has seen it."
What a production version changes
A fixed layout template, with the model reserved for the parts that genuinely vary — line-item descriptions, service summaries, multi-language output — would keep the financial figures and structure fully deterministic while keeping the flexibility where it's actually useful.
Impact
A ten-minute manual task becomes a single submission — the client gets a professional, print-ready invoice within seconds.