Back to DocRaptor in Google Sheets
SheetXAI logo
DocRaptor logo
DocRaptor · Google Sheets Guide

Batch-Generate PDFs Async From a Google Sheet and Collect URLs

2026-05-14
5 min read

The Scenario

You handle contract operations for a legal team. There are 50 contract summaries sitting in the 'Contracts' tab — one per row, with columns for ContractID, PartyName, and HTMLContent. Each one needs its own individual PDF. You've done this before by submitting each row one at a time, waiting, copying the URL, pasting it into column D, moving to the next row. By row 15, you're checking your phone every 30 seconds to see if the last job finished.

The bad version:

  • Open the DocRaptor dashboard, paste in the HTML from row 1, generate, copy the URL, paste it into D1.
  • Open a new tab, paste in the HTML from row 2, generate, copy the URL, paste it into D2.
  • Repeat 48 more times. Somewhere around row 30 you lose track of which job maps to which row.

Nobody hired you to manually orchestrate 50 API calls. The intellectual work here is zero — it's pure mechanical repetition, and it scales to exactly one person's patience.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Google Sheet. It reads all 50 rows, submits each one as an async DocRaptor job, polls each job ID until it's completed, and writes the download URLs back into column D — treating the whole batch as a single coordinated operation.

For each row in the 'Contracts' sheet (columns: ContractID, PartyName, HTMLContent), submit an async PDF creation job to DocRaptor, poll each job ID until status is 'completed', then write the download URL into column D.

What You Get

  • All 50 DocRaptor async jobs submitted in sequence.
  • Each job polled until completion — SheetXAI waits on each status check rather than firing-and-forgetting.
  • Download URLs written to column D for each row, matched back to the correct ContractID.
  • Any job that returns an error status gets a note in column D (e.g. "DocRaptor error: invalid HTML") so failures are visible without digging through a log.

What If the Data Is Not Quite Ready

Some rows in HTMLContent are blank — the contract summary hasn't been written yet

For each row in the 'Contracts' sheet, skip any row where column C (HTMLContent) is empty, mark those rows in column D as 'Skipped – no content'. For all other rows, submit async PDF jobs to DocRaptor, poll until complete, and write the download URL to column D.

The HTML content columns contain placeholder text that needs substituting before sending

For each row in the 'Contracts' sheet, replace any instance of '{{PartyName}}' in column C with the value from column B (PartyName), then submit the resulting HTML as an async PDF job to DocRaptor, poll until complete, and write the download URL to column D.

You need a separate tracking column showing when each PDF completed

For each row in the 'Contracts' sheet, submit an async PDF job to DocRaptor using the HTML in column C. Poll each job ID until complete. Write the download URL to column D and the completion timestamp to column E. Mark failed jobs with 'Failed' in column D and the error message in column E.

Full pipeline: validate, substitute, submit, poll, log, flag failures

Read the 'Contracts' sheet. Skip rows where column C is empty (mark column D as 'Skipped'). For all other rows, substitute '{{PartyName}}' in column C with the value from column B. Submit each as an async DocRaptor PDF job. Poll each job until complete. Write the download URL to column D and the timestamp to column E. For any failures, write 'Failed' to column D and the error detail to column E. When all jobs are done, add a summary row at the bottom showing total submitted, total completed, total failed.

One coordinated operation from raw data to auditable batch result.

Try It

Get the 7-day free trial of SheetXAI and open any Google Sheet where you've been generating PDFs one row at a time — ask SheetXAI to run the full batch through DocRaptor async and write every URL back in one pass. Related: generate a single styled PDF report or pull the DocRaptor document history for audit.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more