Automated PDF417 Barcode Data Extraction to Google Sheets

Aug 6, 2025·5 Minutes Read

What You'll Have When Done: A fully automated system that monitors your Google Drive for PDF417 barcode images (like airline boarding passes), extracts all the encoded data, parses flight information, and automatically adds structured data to your Google Sheets for easy tracking and management.

Prerequisites

Before you begin, make sure you have:

  • A PDF.co API Key (Get yours here)
  • Google Drive OAuth2 credentials configured in n8n
  • Google Sheets OAuth2 credentials configured in n8n
  • An n8n instance (cloud or self-hosted)
  • A Google Drive folder for uploading PDF417 barcode images
  • A Google Sheets document with the following columns:
    • Client Name
    • Flight Number
    • Date
    • Route
    • Seat
    • Confirmation Code
    • Processed Date

Quick Start Options

Option A: I Want It Working Now

  1. Import this workflow template → Download JSON File
  2. Connect your Google accounts in n8n (Drive, Sheets)
  3. Add your PDF.co API key
  4. Set up your Google Drive monitoring folder
  5. Configure your destination Google Sheet
  6. Test with a sample boarding pass image
  7. Activate and let it run

Option B: I Want to Build It Step-by-Step

Follow the 5-step guide below to create the automation from scratch.

What This Automation Does (Overview)

  1. Monitors your Google Drive folder for new PDF417 barcode images
  2. Extracts the barcode data using PDF.co's advanced barcode reader
  3. Downloads the extracted data from PDF.co
  4. Parses the BCBP (Bar Coded Boarding Pass) format into readable information
  5. Appends the structured flight data to your Google Sheets automatically

Step-by-Step Build Guide

Step 1: Monitor Google Drive for New Barcode Images

Node: Google Drive Trigger

Settings:

  • Trigger On: Changes Involving a Specific Folder
  • Folder to Watch: Select your designated barcode upload folder
  • Watch For: File Created

What This Does: Automatically detects when new PDF417 barcode images (like boarding pass screenshots) are uploaded to your specified Google Drive folder.

Success Looks Like: The trigger activates immediately when a new image or PDF is uploaded.

Important: Make sure the file sharing setting is set to “Anyone with the link” so that PDF.co can access the file.

Step 2: Extract Barcode Data with PDF.co

Node: PDF.co API → Barcode Reader

Settings:

  • URL: ={{ $json.webContentLink }} (from the Google Drive trigger)
  • Barcode Types: PDF417

What This Does: Takes the uploaded image and uses PDF.co's Barcode Reader to extract the encoded data from PDF417 barcodes, commonly found on airline boarding passes.

Success Looks Like: PDF.co processes the image and returns a URL containing the extracted barcode data string.

Step 3: Download the Extracted Data

Node: HTTP Request

Settings:

  • Method: GET
  • URL: ={{ $json.url }} (from the PDF.co barcode reader step)

What This Does: Downloads the barcode extraction results from PDF.co's servers, providing access to the raw BCBP data string.

Success Looks Like: The raw barcode data is downloaded and ready for parsing into structured flight information.

Step 4: Parse BCBP Data into Readable Format

Node: Code → JavaScript

To handle the parsing, you'll need a custom JavaScript function. Download the parser script here and paste it into your Code node.

What This Does: Parses the raw BCBP (Bar Coded Boarding Pass) string to extract the passenger name, flight details, dates, seat assignments, and confirmation codes into a structured format.

Success Looks Like: The raw barcode string is converted into clean, readable data with proper formatting for names, dates, and flight information.

Step 5: Add Parsed Data to Google Sheets

Node: Google Sheets → Append Row

Settings:

  • Document From List: Select your Client Travel Management spreadsheet
  • Sheet From List: Choose the appropriate sheet (usually Sheet1)
  • Columns Mapping:
    • Client Name: ={{ $json.clientName }}
    • Flight Number: ={{ $json.flightNumber }}
    • Date: ={{ $json.travelDate }}
    • Route: ={{ $json.route }}
    • Seat: ={{ $json.seat }}
    • Confirmation Code: ={{ $json.confirmationCode }}
    • Processed Date: ={{ $json.processedDate }}

What This Does: Takes the parsed flight information and automatically adds a new row to your Google Sheets with all the extracted data, creating an organized travel log.

Success Looks Like: Each processed boarding pass appears as a new row in your spreadsheet with properly formatted flight information, passenger details, and processing timestamps.

Congratulations! You've created a fully automated PDF417 barcode processing system that can extract flight information from boarding pass images and PDFs and organize it in Google Sheets.

Built something cool with this workflow? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials