Skip to main content

Working with Documents and PDFs

Create and extend Word documents and Google Docs, export to PDF, read long PDFs, and fill PDF forms

Alongside spreadsheets, the other half of file work is documents: reading long ones, producing new ones, and turning them into something you can send. Agents can do all three, in Google Docs, in Microsoft Word on Microsoft 365, and with PDFs.


Reading documents

Give an agent a link to a Word document, a Google Doc, a PDF, or a PowerPoint deck and it can read the contents.

Long documents are read page by page rather than truncated. For a PDF, the agent is given the document's bookmarks as a table of contents, so it can jump to the section it needs instead of grinding through 300 pages to find one clause. It can also request a specific page window — a single page or an inclusive range — and read a page as an image when the page is a scan, a diagram, or a form that only makes sense visually.

This is what makes document-heavy work practical: an agent extracting the termination clause from a contract, checking an invoice against a purchase order, or pulling figures out of a submitted report is reading the relevant pages, not guessing from the first few.

Creating documents

Agents can create documents from scratch:

  • add_google_doc creates a new Google Doc, optionally with initial content.

  • add_word_document creates a new Word document on Microsoft 365, optionally with initial content.

Content is supplied as Markdown and converted to a properly formatted document, so headings, lists, tables, bold and links all come out as real document formatting rather than literal asterisks.

An agent can also append to an existing Google Doc (append_to_doc), which is how running logs, appended case notes, and accumulating summaries are built up across a workflow.

Have the agent open the destination folder before creating a file, so the new document lands where you expect rather than in a default location.

Producing a PDF

Both document types can be exported to PDF — export_google_doc_to_pdf and export_word_doc_to_pdf. The export produces a new file and leaves the source document untouched, which is why it stays available even for documents a step is only allowed to read.

This is the normal last step of a document-producing workflow: build the document from a template, have it reviewed, export the PDF, and send that.

Filling PDF forms

When a PDF has form fields, an agent can fill them in. It opens the PDF, sees the actual field names from the form, supplies values, and gets back a new, filled PDF — the blank form is not modified.

That matters for the common case where the blank form is a controlled document: a claim form, a government filing, an onboarding pack. The template stays pristine and each completed copy is a new file.


Generating documents from templates

For formatted output that has to look a particular way every time — offer letters, purchase-order confirmations, exception notices — do not have an agent write the document from scratch. Use a template: a Word document or Google Doc with placeholders that the workflow fills with live data. The template owns layout and formatting; the workflow supplies the values.

This is covered in full in Generate Documents from Templates.


Protecting source documents

As with spreadsheets, a work item column that holds a document can be marked Read only, and the platform then does not offer agents the tools that would modify that file — appending to it, for instance. Reading it, and creating new files from it such as a PDF export, remain available.

Use this for anything the workflow reads but must not alter: the signed original, the controlled template, the customer's submission. See The File and Image Property Types.

Did this answer your question?