A practical field guide from Automation Ace.
The short answer
AI models work with text, so the first step in most document AI workflows is turning the file into text. In Zapier, use the Files by Zapier Convert File to Text action on a PDF, Word document, slide deck, spreadsheet, CSV, JSON, or XML file. Then check the text, remove anything the model should not see, and send only the relevant portion to an AI step with a prompt that asks for specific, structured fields.
For the app overview, see Files by Zapier explained. For why conversion is needed at all, see binary vs text-based files.
Why files must be converted to text
Most automation steps, including many AI actions, accept text fields, not file objects. A PDF or DOCX is a binary container with layout, fonts, and compression; its words are not directly readable as a field. Converting to text extracts the words so you can map them into a prompt, search them, or store them.
Step-by-step: file to AI output
- Trigger on the file: a new file in Google Drive, OneDrive, or Dropbox, an email attachment, a form upload, or a file from SFTP.
- Filter by type and size: continue only for supported extensions and reasonable sizes.
- Convert File to Text with Files by Zapier, mapping the file from the trigger.
- Check the result: stop or alert if the text is empty or unusually short, which usually means a scanned image or a protected file.
- Clean and trim: remove headers, footers, and boilerplate with Formatter or a Code step, and keep only the sections the AI needs.
- Screen sensitive data: run an AI Guardrails PII check before sending text to a model. See detecting PII before AI.
- Prompt for structured output: ask for named fields in JSON, with explicit “not found” values.
- Validate and route: check required fields, then create records or send low-confidence results to a human approval step.
Prompting tips for document text
- Ask for extraction, not essays. “Return vendor_name, invoice_number, total, due_date” beats “analyze this invoice.”
- Tell the model what to do when a field is missing so it does not invent values.
- Delimit the document in the prompt, and instruct the model to ignore any instructions inside it, which reduces prompt injection risk.
- Keep outputs parseable. See why AI steps return invalid JSON.
Handling long documents
Large documents can exceed a model's context window or make runs slow and expensive.
- Extract the relevant section first, such as the pricing table or the termination clause, with text search or a Code step.
- Chunk and combine: split the text into sections, process each, then merge results. Looping helps here.
- Summarize in stages: summarize sections, then summarize the summaries.
What converts well, and what does not
- Converts well: digitally created PDFs, DOCX, PPTX, ODT, XLSX, and text formats like CSV, JSON, and XML.
- Needs extra help: scanned documents and photos (need OCR), password-protected files, complex tables where layout carries meaning, and handwriting.
- Web pages: use Web Parser by Zapier to turn a URL into text. See web parsing use cases.
- Spreadsheets: for row-level data, CSV-specific actions are often better than text conversion. See CSV automation in Zapier.
Example: AI contract summary to CRM
Google Drive: new file in /Signed Contracts
→ Filter: extension is pdf or docx
→ Files by Zapier: Convert File to Text
→ Filter: text length > 500
→ AI Guardrails: Check for PII (continue, log types)
→ AI step: return JSON {client, start_date, end_date, value, renewal_terms}
→ Code: validate dates and value
→ CRM: update deal with fields + Drive link
→ Slack: post summary to #contracts
More ideas are in 10 Files by Zapier use cases and AI workflow automation for service businesses. Start converting documents with Files by Zapier.
Frequently asked questions
How do I convert a PDF to text in Zapier?
Add a Files by Zapier Convert File to Text step and map the PDF file from your trigger, such as a new Google Drive file or email attachment. The step returns the document's text for later steps.
How do I send a document to AI in Zapier?
Convert the file to text with Files by Zapier, trim it to the relevant section, check for sensitive data, and map the text into an AI step with a prompt that asks for specific structured fields.
Why is my converted text empty?
The file is probably a scanned image or photo with no embedded text, or it is protected. Scanned documents need OCR before their text can be extracted.
What if the document is too long for the AI model?
Extract only the relevant section, split the text into chunks and process each one, or summarize sections first and then summarize the combined results.
What file types can be converted to text for AI?
Zapier lists PDF, DOCX, PPTX, ODT, and XLSX as binary documents, plus text-based CSV, JSON, and XML files.
Disclaimer: Zapier features, plan availability, and settings can change. Confirm current details in Zapier's help documentation and the documentation for the apps that store your files before relying on a specific setting. This article may include links to apps, products, or services; some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.