A contract request lands on your site at 23:40. The client writes: "Need the standard retainer, 3 months, starting Monday." By morning they should have a filled PDF in their inbox with your signature block, their name, dates and scope already in place. Two ways to build that pipeline, and they cost very different amounts of your attention.
Below is one concrete case, two builds for it, and a criterion you can actually check before you pick.
The case: a small studio and 40 requests a month
A two-person design studio publishes a price page with a request form. Inquiries arrive through the form, plus a few by email and one or two by phone. About 40 a month, of which roughly 30 turn into signed contracts.
Every contract is the same template with six variables: client legal name, address, scope line, start date, term, and fee. That is it. There are no negotiated clauses in 8 out of 10 deals; the remaining 2 ask for something custom — a payment schedule, a liability cap, a different notice period.
That ratio is the whole decision. If your deals look like this, the two builds below behave very differently. If 6 out of 10 of your deals are custom, read the second build as a warning, not a plan.
What you get at the end, and how you know it works
The finished pipeline does three things without you touching it: it takes the form submission, fills the template, and sends an email to the client with the document attached and a copy to you.
You know it works when you can do this by hand: submit the form with a fake name and a fake email, and within a minute your own inbox has a document where the client name appears in the header, the dates are the ones you typed, and the fee matches. Then open the PDF and check that no placeholder like {{client_name}} survived.
That last check is the one people skip, and it is the one that catches half the bugs.
Build A: a form tool plus a document generator, every field checked by a person
The first path uses tools that already exist: a hosted form (Tally, Typeform, a Google Form), a document generator that merges form answers into a template (Documint, Formstack Documents, Google Docs plus a merge add-on), and a human who reads the output before hitting send.
What the AI does here: almost nothing at runtime. You use it once to draft the template and the field list, and to write the email body. That is a 20-minute conversation, not a build.
What the human does: opens the generated document, compares six fields against the request, fixes typos, sends.
The steps:
- Define the fields. List every variable in the contract. Six in the studio's case. Owner: human, 15 minutes. Check: print the list and have a second person try to fill it from a sample request without asking questions.
- Build the template. One document with marked placeholders. Owner: human or AI draft, human approves. Check: fill it manually with a fake client and read the whole thing out loud — awkward phrasing in a contract is a real cost.
- Connect the form to the generator. Owner: human, in the tool's UI. Check: submit one test entry and confirm the document appears.
- Add the email step. Most generators send the document themselves; if not, use the form tool's email action. Check: the attachment opens on a phone, not just your laptop.
- Run it for a week with manual review. Owner: human. Check: count how many of the 10 documents needed a correction. If it is more than 2, your template or field list is wrong, not the tool.
What it costs: a form tool and a document generator run in the low tens of dollars a month at this volume; some generators price per document, so 40 a month is cheap. Your time: a weekend to set up, then 3–5 minutes per contract to review. At 30 contracts a month that is about two and a half hours of a person's attention monthly.
That review time is not waste. It is the thing that keeps a wrong address off a signed document.
Build B: a script with a template engine and automatic send
The second path is a small service you own. A form posts JSON to your endpoint, a template engine fills an HTML or DOCX template, a PDF is rendered, and an email with the attachment goes out through a transactional email API.
What the AI does: writes the code, the template, and the tests. You describe the six fields and the email, and it produces a working first draft in one session. It will also produce confident mistakes — assume the first run is broken.
What the human does: gets the API keys, decides what happens on a custom request, and reads the first twenty real documents before trusting the pipeline.
Here is the core in Python, using Jinja2 for the template and WeasyPrint for HTML-to-PDF. Pin the versions, because the rendering output changes between WeasyPrint releases:
pip install "jinja2==3.1.4" "weasyprint==62.3"
from datetime import date
from pathlib import Path
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from weasyprint import HTML
env = Environment(
loader=FileSystemLoader("templates"),
undefined=StrictUndefined, # a missing field raises instead of rendering blank
)
template = env.get_template("contract.html")
payload = {
"client_name": "Northwind Studio LLC",
"client_address": "12 Harbour Road, Bristol",
"scope": "Brand identity, 3 concepts",
"start_date": date(2027, 1, 5).isoformat(),
"term_months": 3,
"fee_usd": 4800,
}
html = template.render(**payload)
Path("out").mkdir(exist_ok=True)
HTML(string=html).write_pdf("out/contract.pdf")
print("written out/contract.pdf")
The StrictUndefined line is the important one. Without it Jinja2 renders a missing field as an empty string, and you email a contract with a blank fee. With it, the script fails loudly and the client gets nothing — which is the correct failure.
Sending is a separate step through a transactional email API (Postmark, Resend, SendGrid — the shape is the same): build the attachment from the PDF bytes, set From to an address on your own domain, and send to the client with a copy to you.
Check the exact method names and parameter casing in the provider's current docs before writing the call. These APIs rename fields between versions, and an AI agent will happily invent a plausible one.
The step that decides everything: what happens on a custom request
The studio in our case gets 2 custom deals in 10. A script that fills six fields cannot handle "client wants net-45 payment and a liability cap." So the pipeline needs a branch: if a request contains anything outside the six fields, it does not auto-send. It parks the request, emails you, and waits.
How you detect that is a decision, not a code detail. Two honest options:
- A checkbox on the form — "standard terms" versus "custom terms." Simple, and the client tells you the truth surprisingly often.
- A required free-text field with a length check: if the scope text is longer than, say, 200 characters, route to manual review. Crude, but it catches the deals that will bite.
What does not work is letting the AI "understand" whether a request is standard. It will be right most of the time and wrong exactly on the deal that matters.
The criterion: pick by three numbers, not by taste
Forget which build is "better." Answer three questions about your own work:
| Question | Build A fits | Build B fits |
|---|---|---|
| Requests per day | Under ~5 | Over ~10 |
| Share of non-standard terms | Above 2 in 10 | Under 1 in 10 |
| Someone available to review each document | Yes, and willing | No, or it is the bottleneck |
Read it as a threshold, not a score. If you are under five requests a day and a third of them are custom, Build B will spend its life in the manual-review branch and you will have paid for code that mostly does nothing. If you are at twenty a day and every one is the same six fields, Build A turns a person into a copy-paste machine.
The middle case — around 8–10 a day, mostly standard — is where the two builds genuinely compete, and there the tiebreaker is the third row: do you have a person, and does reviewing documents annoy them or reassure them?
What access you need, and where it is impossible
Build A needs almost nothing: an account on the form tool and the generator, both with email sending enabled. No keys, no domain setup beyond what the tools provide. If a tool does not offer an API or a webhook on its cheap plan, you do not need one — you are using its UI.
Build B needs more, and each item is a real gate:
- A transactional email API key with a verified sending domain. You get it in the provider's dashboard, and you must add DNS records (SPF and DKIM) for your domain. This is a human step and it takes a day to propagate. Without it, mail lands in spam or is rejected.
- A place to run the script — a small VPS, a serverless function, or even a cron job on a machine you already pay for. It needs outbound HTTPS and enough memory to render a PDF; WeasyPrint is not featherweight.
- The template file with placeholders, stored where the script can read it.
- A receiving endpoint for the form. If your form tool cannot POST JSON to a URL you control, Build B is not available to you at all — check this before writing any code.
Where access is impossible: if your contract template lives in a system with no export and no API (some CRM and e-signature tools are like this on lower tiers), neither build can read it. You would be re-creating the template by hand, and it will drift from the real one. Fix the template ownership first.
Where it breaks
Three failures are specific to this pipeline, not to pipelines in general.
1. The duplicate send. A form tool retries a webhook when your endpoint is slow, and the client gets two contracts. Or the client clicks submit twice. The fix is an idempotency key: the form sends a unique submission ID, and your script records it and refuses to send twice for the same ID. Build A has the same problem in milder form — most generators will happily produce two documents.
2. The blank or wrong field. A missing client address renders as an empty line, and the document goes out anyway. StrictUndefined in the template engine turns this into a hard failure. In Build A the human catches it; in Build B nothing does unless you build it in. Validate that every required field is non-empty before rendering, and refuse to send if not.
3. Personal data in the wrong place. Client names, addresses and fees flow through a form tool, a generator, an email provider and possibly an AI agent's context window. Under the data protection rules that apply to you, you are the controller of that data, and each tool is a processor you should be able to name. Practical rule: do not paste real client data into an AI chat to debug the template. Use a fake client with a fake address, and keep the real data in the pipeline.
How to check it by hand before you trust it
Run these five scenarios. Each has a success sign you can see.
- Happy path. Submit the form with a fake client, all six fields filled. Success: one email arrives, the PDF opens, the name and fee match what you typed, no
{{anywhere in the document. - Missing field. Submit with the address left blank. Success: no email goes to the client, and you get an error notification. If a contract with a blank address arrives, your validation is missing.
- Double submit. Submit the same request twice within a few seconds. Success: one email, not two.
- Custom request. Submit with a long scope text or the custom-terms box ticked. Success: no auto-send, and you get a review request.
- Phone check. Open the attachment on a phone, not a desktop. Success: the text is readable without zooming, and the signature block is on the page it belongs to.
Run all five again after any change to the template. Template edits break layouts in ways code tests do not catch.
What it costs, honestly
Build A: a weekend of setup, then minutes per contract. Money is in the low tens of dollars a month at 40 requests, more if the generator prices per document. The hidden cost is the review — it does not go away, and it grows linearly with volume.
Build B: one focused session with an AI agent for a working draft, then real time on the parts the agent gets wrong — email deliverability, the duplicate guard, the custom-request branch. Realistically a few days of elapsed time spread over a week or two, most of it waiting on DNS and testing. Money is a domain, an email provider (often free at this volume, paid above a few hundred sends a month), and a small server if you need one. The hidden cost is maintenance: a template change, a provider API change, or a library upgrade, and you are back in the code.
Neither number is large. The difference is whose time, and whether that time recurs.
If you would rather not own either the setup or the maintenance, asibiont.com takes such projects on turnkey: the developer names a price, you top up your balance and the pipeline is delivered working. Details are on the subscription tiers page.
The decision in one line
If a person already reads every document before it goes out, Build A costs you a weekend and never surprises you. If nobody does and the deals are standard, Build B earns its keep — but only after the custom-request branch and the duplicate guard are in place, because those two are what turn a demo into something you can leave running overnight. Start with the three numbers from the table above, and let the answer pick the build rather than the other way round. The same discipline applies to any pipeline where a document leaves your hands and reaches a client: the person who signs off on the output is part of the system, whether that person is you at a screen or a check in the code.
If you would rather not build it yourself: we take such a project on — you describe the task, we build it and bring it to a working result, and the developer names the price. The payment goes through a balance top-up on the payment page.