Secure Excel file using n8n action
PDF4me Secure Excel applies comprehensive password protection to Excel documents through n8n automation workflows with multi-level security control. Process Excel files via n8n triggers, binary data, base64 strings, or public URLs to protect at three independent levels: file encryption (password to open), workbook structure protection (prevent sheet modifications), and worksheet content protection (prevent cell edits), with flexible password hierarchy allowing separate passwords for each level or single password for all, plus selective worksheet targeting and four protection types (Contents, Objects, Scenarios, All). This solution is ideal for confidential data protection, template security, controlled access workflows, and automated security enforcement that require multi-level password protection with comprehensive control and seamless integration.
Setup
Add the PDF4me "Secure Excel" 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 "Secure Excel" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Secure Excel action. Configure these parameters to control protection levels and passwords.
Important: Parameters marked with an asterisk (***) are required. At least one password must be provided for respective protection level. Worksheet indexes use 0-based numbering (0 = first worksheet).
| 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 |
| Password | String | File Encryption Password (Level 1) • Password required to open the file - encrypts entire file • Also used as fallback for workbook and worksheet protection if their specific passwords are empty • Optional - no file encryption if empty • User Experience: Prompts "Enter password to open this file" - without password, cannot open or view file at all • Case-sensitive | MyPassword123 |
| Protect Workbook | Boolean | Enable Workbook Structure Protection (Level 2) • True = protect workbook structure - prevents adding/deleting/renaming/moving/hiding worksheets • False = no structure protection (default) • Requires password (ProtectWorkbookPassword or Password fallback) • User Experience: Prompts "This workbook is protected" when trying to modify structure • Default: false | true |
| Protect Workbook Password | String | Workbook Protection Password (Level 2) • Password for workbook structure protection • Password Fallback: Priority 1: ProtectWorkbookPassword (if provided), Priority 2: Password (if provided) • Required if ProtectWorkbook = true and Password is empty • Case-sensitive | StructurePass |
| Protect Worksheets | Boolean | Enable Worksheet Content Protection (Level 3) • True = protect selected worksheets - prevents data modifications • False = no worksheet protection (default) • Requires password (WorksheetProtectionPassword or Password fallback) • User Experience: Prompts "The cell you're trying to change is protected" when trying to edit • Default: false | true |
| Worksheet Protection Type | String | Type of Worksheet Protection • "Contents" = protect cell values, formulas, formatting (prevents editing cells, changing formats) • "Objects" = protect charts, images, shapes, drawings (prevents moving, resizing, deleting objects) • "Scenarios" = protect what-if analysis scenarios (prevents creating, modifying scenarios) • "All" = full protection (Contents + Objects + Scenarios) - Default, read-only access • Case-insensitive | All |
| Worksheet Protection Password | String | Worksheet Protection Password (Level 3) • Password for worksheet content protection • Password Fallback: Priority 1: WorksheetProtectionPassword (if provided), Priority 2: Password (if provided) • Required if ProtectWorksheets = true and Password is empty • Case-sensitive | EditPass |
| Worksheet Names | String | Comma-Separated Worksheet Names • List of worksheet names to protect • Empty = protect all worksheets • Case-sensitive worksheet names • Union with WorksheetIndexes | Sheet1,Summary |
| Worksheet Indexes | String | Comma-Separated Indexes (0-based) • List of worksheet indexes to protect • 0-based indexing (0 = first sheet) • Empty = protect all worksheets • Union with WorksheetNames | 0,2 |
| Binary Data Output Name*** | String | Binary Data Output Mapping • Define the variable name for accessing generated Excel binary data • Used in subsequent workflow actions • Essential for workflow automation | document |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Secured Excel document filename - The name of the output password-protected Excel document file | excel_secured.xlsx |
| fileSize | Number | File size in bytes - The size of the Excel document in bytes after security application | 217600 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the password protection 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 |
| fileFormat | String | Excel file format - The format of the Excel file. Values: "xlsx" for Excel 2007+, "xls" for Excel 97-2003 | xls |
| filePasswordProtected | Boolean | File encryption status - Indicates whether file-level password protection (encryption) was applied. true if file encryption is enabled, false if not | true |
| workbookProtected | Boolean | Workbook protection status - Indicates whether workbook structure protection was applied. true if workbook is protected, false if not | true |
| worksheetsProtected | Boolean | Worksheet protection status - Indicates whether worksheet content protection was applied. true if worksheets are protected, false if not | true |
| worksheetProtectionType | String | Worksheet protection type - The type of worksheet protection applied. Values: "Contents", "Objects", "Scenarios", "All" | All |
| worksheetSelection | String | Worksheet selection - Indicates which worksheets were protected. Values: "all" if all worksheets, or specific worksheet names/indexes | all |
| protectionSummary | Array | Protection summary - Array of strings describing the security measures applied to the document | ["File encryption enabled", "Workbook structure protected", "Worksheets protected (all)"] |
| message | String | Operation message - Descriptive message indicating the result of the security operation, including file format and all protection levels applied | Successfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all) |
N8N Action Response
The PDF4me Secure Excel 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:
[
{
"fileName": "excel_secured.xlsx",
"fileSize": 217600,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"fileFormat": "xls",
"filePasswordProtected": true,
"workbookProtected": true,
"worksheetsProtected": true,
"worksheetProtectionType": "All",
"worksheetSelection": "all",
"protectionSummary": [
"File encryption enabled",
"Workbook structure protected",
"Worksheets protected (all)"
],
"message": "Successfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all)"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | excel_secured.xlsx |
| fileSize | 217600 |
| success | true |
| originalFileName | myExcelFile.xlsx |
| fileFormat | xls |
| filePasswordProtected | true |
| workbookProtected | true |
| worksheetsProtected | true |
| worksheetProtectionType | All |
| worksheetSelection | all |
| protectionSummary | ["File encryption enabled", "Workbook structure protected", "Worksheets protected (all)"] |
| message | Successfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all) |
Schema View
The data structure and types of the response:
1 item
fileName: T excel_secured.xlsx
fileSize: # 217600
success: ☑ true
originalFileName: T myExcelFile.xlsx
fileFormat: T xls
filePasswordProtected: ☑ true
workbookProtected: ☑ true
worksheetsProtected: ☑ true
worksheetProtectionType: T All
worksheetSelection: T all
protectionSummary: [] Array
[0]: T File encryption enabled
[1]: T Workbook structure protected
[2]: T Worksheets protected (all)
message: T Successfully secured Excel file (.xls): File encryption enabled, Workbook structure protected, Worksheets protected (all)
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Excel document file data and metadata:
data
─────────────────────────────
File Name: excel_secured.xlsx
File Extension: xlsx
Mime Type: application/vnd.ms-excel
File Size: 218 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Confidential Data Protection
- Encrypt sensitive financial or personal data files with password protection
- Protect confidential reports and documents from unauthorized access
- Apply multi-level security to ensure data confidentiality
Template Security and Read-Only Distribution
- Protect Excel templates from structure changes while allowing data entry
- Distribute read-only reports with worksheet protection
- Secure formula sheets while allowing input in designated areas
Controlled Access Workflows
- Apply different password levels for different user groups
- Protect specific worksheets while leaving others editable
- Implement security policies with automated password protection