Extract worksheet from Excel file using n8n action
PDF4me Extract Worksheets from Excel converts entire worksheets from Excel workbooks into structured JSON through n8n automation workflows. Process Excel files via n8n triggers, binary data, base64 strings, or public URLs to extract complete worksheet data with automatic header detection, flexible worksheet selection by name or index, multi-sheet support, and data type preservation. This solution is ideal for complete data export, multi-sheet processing, API integration, database migration, and comprehensive Excel-to-JSON transformation workflows that require full worksheet extraction with structured output and seamless integration.
Setup
Add the PDF4me "Extract Worksheets" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites:
- PDF4me API credentials
- n8n workflow access
Configuration:
- Add PDF4me node to workflow
- Select "Extract worksheet from Excel file" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Extract Worksheets action. Configure these parameters to control worksheet extraction.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Excel Input Format Selection • Choose the format of your Excel data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field*** | Binary | Binary Excel File Input (Required if Binary Data) • Reference Excel file (.xlsx, .xls) from previous n8n node or file upload • PDF4me processes binary Excel files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Excel Content*** | String | Base64 Encoded Excel Input (Required if Base64 String) • Provide Excel content (.xlsx, .xls) as base64 encoded string • PDF4me automatically decodes and processes the Excel content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| Excel URL*** | String | Public Excel URL Input (Required if URL) • Provide a public/open permission URL to the Excel file (.xlsx, .xls) • PDF4me downloads and processes the Excel file from the provided URL • Required when Input Data Type is "URL" | https://abc.com/data.xlsx |
| Excel Name*** | String | Excel Input Filename • Specify the name of the input Excel file with proper extension (.xlsx, .xls) • PDF4me uses this for format detection and processing optimization | data.xlsx |
| Worksheet Names | String | Comma-Separated Worksheet Names • List of worksheet names to extract • Format: "Sheet1,Summary,Report" • Selection Logic: If provided → Extract those named worksheets. If both WorksheetNames and WorksheetIndexes provided → Extract worksheets matching EITHER (union). If NEITHER provided → Extract ALL worksheets • Case-sensitive worksheet names | Employees,Sales |
| Worksheet Indexes | String | Comma-Separated Indexes (0-based) • List of worksheet indexes to extract • Format: "0,1,2" (Index 0 = first sheet, Index 1 = second sheet, etc.) • Selection Logic: If provided → Extract those indexed worksheets. If both parameters provided → Extract worksheets matching EITHER (union) • 0-based indexing: Index 0 = first worksheet | 0,2,4 |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| jsonFileName | String | JSON output filename - The name of the generated JSON file containing extracted worksheet data | excel_extracted.json |
| txtFileName | String | TXT output filename - The name of the generated TXT file containing extracted worksheet data | excel_extracted.txt |
| jsonFileSize | Number | JSON file size in bytes - The size of the JSON output file in bytes | 206933 |
| txtFileSize | Number | TXT file size in bytes - The size of the TXT output file in bytes | 206933 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the worksheet extraction process. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Excel document filename - The name of the input Excel document file | myExcelFile.xlsx |
| extractBy | String | Extraction method - The method used to identify worksheets for extraction. Values: "name" if extracted by worksheet names, "index" if extracted by worksheet indexes | name |
| worksheetNames | String | Worksheet names extracted - Comma-separated list of worksheet names that were extracted | Sheet2 |
| parsedData | Object | Parsed worksheet data - Object containing extracted worksheet data with worksheet names as keys and arrays of row objects as values. Each row object contains column headers as keys and cell values as values | {"Sheet2": [{"First Name": "Dulce", "Age": 32}]} |
| message | String | Operation message - Descriptive message indicating the result of the worksheet extraction operation, including the worksheet names and extraction method | Successfully extracted worksheet(s) 'Sheet2' by name and created JSON and TXT outputs |
N8N Action Response
The PDF4me Extract worksheet from Excel file API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"jsonFileName": "excel_extracted.json",
"txtFileName": "excel_extracted.txt",
"jsonFileSize": 206933,
"txtFileSize": 206933,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"extractBy": "name",
"worksheetNames": "Sheet2",
"parsedData": {
"Sheet2": [
{
"": 1,
"First Name": "Dulce",
"Last Name": "Abril",
"Gender": "Female",
"Country": "United States",
"Age": 32,
"Date": "15/10/2017",
"Id": 1562
},
{
"": 2,
"First Name": "Mara",
"Last Name": "Hashimoto",
"Gender": "Female",
"Country": "Great Britain",
"Age": 25,
"Date": "16/08/2016",
"Id": 1582
},
{
"": 3,
"First Name": "Philip",
"Last Name": "Gent",
"Gender": "Male",
"Country": "France",
"Age": 36,
"Date": "21/05/2015",
"Id": 2587
}
]
},
"message": "Successfully extracted worksheet(s) 'Sheet2' by name and created JSON and TXT outputs"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| jsonFileName | excel_extracted.json |
| txtFileName | excel_extracted.txt |
| jsonFileSize | 206933 |
| txtFileSize | 206933 |
| success | true |
| originalFileName | myExcelFile.xlsx |
| extractBy | name |
| worksheetNames | Sheet2 |
| parsedData | Object with worksheet names as keys and row arrays as values |
| message | Successfully extracted worksheet(s) 'Sheet2' by name and created JSON and TXT outputs |
Parsed Data Structure:
| Worksheet Name | Row Data |
|---|---|
| Sheet2 | Array of row objects with column headers as keys |
Note: The action returns two binary outputs - data_json (JSON format) and data_txt (TXT format), both containing the same extracted worksheet data. The parsedData object provides direct access to the extracted data in the JSON response.
Schema View
The data structure and types of the response:
1 item
jsonFileName: T excel_extracted.json
txtFileName: T excel_extracted.txt
jsonFileSize: # 206933
txtFileSize: # 206933
success: ☑ true
originalFileName: T myExcelFile.xlsx
extractBy: T name
worksheetNames: T Sheet2
parsedData: {} Object
Sheet2: [] Array
[0]: {} Object
"": # 1
First Name: T Dulce
Last Name: T Abril
Gender: T Female
Country: T United States
Age: # 32
Date: T 15/10/2017
Id: # 1562
[1]: {} Object
"": # 2
First Name: T Mara
Last Name: T Hashimoto
Gender: T Female
Country: T Great Britain
Age: # 25
Date: T 16/08/2016
Id: # 1582
[2]: {} Object
"": # 3
First Name: T Philip
Last Name: T Gent
Gender: T Male
Country: T France
Age: # 36
Date: T 21/05/2015
Id: # 2587
message: T Successfully extracted worksheet(s) 'Sheet2' by name and created JSON and TXT outputs
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array{}= Object
Binary Data View
The extracted worksheet data is returned as two binary files - one in JSON format and one in TXT format:
data_json
─────────────────────────────
File Name: excel_extracted.json
File Extension: json
Mime Type: application/json
File Size: 207 kB
data_txt
─────────────────────────────
File Name: excel_extracted.txt
File Extension: txt
Mime Type: text/plain
File Size: 207 kB
Both binary files contain the same extracted worksheet data in different formats. The parsedData object in the JSON response provides direct access to the structured data without needing to parse the binary files.
Binary Data Access:
- JSON Binary Object:
$binary.data_json.data - TXT Binary Object:
$binary.data_txt.data - Base64 Content: Available for direct use in both formats
- File Operations: Ready for download, email, or storage
Use Cases
Complete Data Export and Migration
- Extract entire Excel workbooks as JSON for system migrations, data archival, and backup operations
- Convert multi-sheet Excel files to JSON format for cloud storage and database import
- Export complete worksheet data for API integration and cross-system synchronization
Multi-Sheet Processing and Analysis
- Extract multiple worksheets simultaneously for parallel processing in n8n workflows
- Process different worksheet tabs with different business logic and transformations
- Integrate complete workbook data with external APIs and data analysis platforms
Business Intelligence and Data Integration
- Export Excel data to JSON for business intelligence tools and analytics platforms
- Convert Excel reports to structured JSON for automated reporting and dashboard updates
- Integrate Excel data with CRM systems, databases, and cloud services