# How To Use OpenAI Agent Builder with PDFs

Source: https://www.youtube.com/watch?v=Vas26bqtbQg
Recap page: https://rapidrecap.app/video/Vas26bqtbQg
Generated: 2025-11-10T13:02:04.376+00:00

---
## Quick Overview

The video demonstrates how to build an AI agent workflow in OpenAI Agent Builder that successfully extracts specific data (Company Address, Total USD, Invoice #) from a PDF invoice and automatically writes that structured data into corresponding columns in a Google Sheet using Zapier integration via an MCP server.

**Key Points:**
- The workflow uses a three-step agent sequence: Start -> PDF DATA Agent -> USE DATA Agent.
- The first agent, 'PDF DATA', is instructed to extract specific data points: Company Address, Total (USD), and Invoice # from the input PDF file.
- The 'PDF DATA' agent is configured to output structured JSON data, which is then passed to the next step.
- The second agent, 'USE DATA', is configured to use the Zapier tool (connected via an MCP server) to place the extracted data into specific columns ('Invoice #', 'Company Address', 'Total USD') in a Google Sheet named 'Easy Data'.
- The 'USE DATA' agent's instructions explicitly map the parsed JSON outputs (e.g., input.output_parsed.invoice_#) to the correct Google Sheet columns.
- The reasoning effort for the second agent is set to 'High' to ensure reliable tool execution, and Zapier tool approval is set to 'Never require approval' for automation.
- The final result shows the invoice data (Invoice #7, Address, $262.50) successfully written into the Google Sheet in a structured row.

![Screenshot at 00:03: The visual shows the initial three-node workflow structure \(Start -\> PDF DATA Agent -\> USE DATA Agent\) in the Agent Builder interface, setting the stage for PDF data extraction and external tool usage.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-00-03.png)

**Context:** The video is a technical tutorial demonstrating advanced automation capabilities within the OpenAI Agent Builder environment, specifically focusing on handling file inputs (PDFs) and integrating with external services like Google Sheets via Zapier. This process relies on setting up an intermediary structure called an MCP (Multi-Client Platform) server to bridge the Agent Builder environment with third-party tools like Zapier, allowing the AI agent to perform actions outside the builder interface.

## Detailed Analysis

The tutorial constructs an AI agent workflow designed to ingest a PDF invoice, extract key financial and identifying details, and then input that data into a Google Sheet. The workflow begins with a 'Start' node, leading to a 'PDF DATA' agent responsible for extraction. This agent is explicitly instructed to look at the invoice PDF and extract the Company Address, Total (USD), and Invoice #, outputting this information in a structured JSON format defined by a custom JSON schema named 'invoice_data'. Following this, the 'USE DATA' agent takes the parsed JSON output from the previous step and uses the Zapier tool, connected through an MCP server, to write the data to a Google Sheet titled 'Easy Data'. The instructions in the 'USE DATA' agent precisely map the extracted JSON fields (like input.output_parsed.company_address) to the respective column headers in the spreadsheet. The reasoning effort for the final agent is set to 'High' to maximize reliability, and the Zapier tool is configured to run without requiring manual approval for each execution. The demonstration concludes by showing the successful execution where Invoice #7, the company address, and the total amount ($262.50) are correctly populated as a new row in the designated Google Sheet.

### Workflow Setup

- Three nodes arranged linearly: Start -> PDF DATA (Agent) -> USE DATA (Agent)
- The workflow accepts a PDF file as input.

### PDF Data Extraction

- 'PDF DATA' agent instructions specify extraction of 'Company Address, Total (USD), Invoice #'
- Output format is set to JSON using a custom schema named 'invoice_data'.

### JSON Schema Definition

- The custom schema 'invoice_data' defines three properties: 'company_address' (String), 'invoice_#' (Number), and 'total_usd' (Number).

### External Tool Integration (Zapier)

- The 'USE DATA' agent is configured to use the Zapier tool via an MCP server
- Tools enabled include Google Sheets: Create Spreadsheet Row and Lookup Spreadsheet Rows (Advanced).

### Google Sheet Input Instructions

- The 'USE DATA' agent prompt instructs Zapier to 'Append a new row to the spreadsheet, named \'Easy Data\'' and map the extracted data points using context variables like {input.output_parsed.invoice_#} to the correct columns.

### Tool Configuration and Execution

- Zapier connection requires an API key and is set to 'Never require approval for any tool call' for full automation
- Reasoning effort for this step is set to 'High'.

![Screenshot at 00:03: The initial agent workflow diagram showing the sequence of Start, PDF DATA Agent, and USE DATA Agent nodes.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-00-03.png)
![Screenshot at 00:04: A preview of the target invoice PDF document used for data extraction, showing structured fields like Invoice #, dates, and line items.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-00-04.png)
![Screenshot at 01:38: The instruction modal for the 'PDF DATA' agent, detailing the request to extract 'Company Address, Total \(USD\)' and 'Invoice #' from the PDF.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-01-38.png)
![Screenshot at 03:41: The JSON schema creation interface \('invoice\_data'\) defining the required output structure with 'company\_address' \(STR\), 'invoice\_#' \(NUM\), and 'total\_usd' \(NUM\).](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-03-41.png)
![Screenshot at 04:41: The target Google Sheet named 'Easy Data' showing the header row with columns: 'Invoice #', 'Company Address', and 'Total USD'.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-04-41.png)
![Screenshot at 05:20: The 'Add context' menu within the 'USE DATA' agent configuration, showing the available output variables from the preceding 'PDF DATA' step.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-05-20.png)
![Screenshot at 06:11: The Zapier connection modal in the MCP settings, showing the API Key input field and tool selection options.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-06-11.png)
![Screenshot at 07:20: The Google Sheets tool selection menu under the 'Take action' tab, highlighting 'Create Spreadsheet Row' as the necessary tool for writing data.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-07-20.png)
![Screenshot at 08:56: The 'USE DATA' agent's reasoning log showing the constructed instruction for the 'google\_sheets\_create\_spreadsheet\_row' tool, including the mapped variables.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-08-56.png)
![Screenshot at 09:06: The final successful execution result in the Google Sheet, with Invoice #7, the address, and the total $262.50 written into the second row.](https://ss.rapidrecap.app/screens/Vas26bqtbQg/00-09-06.png)
