Delete Rows from Excel Worksheet in n8n
Delete Rows is an n8n module by PDF4me that strips unwanted rows from an Excel worksheet in one workflow step. Send a workbook and a Row Ranges string covering single rows, ranges, or a mixed list, and PDF4me deletes them bottom-to-top and returns the cleaned file.
What this node does
PDF4me: Delete Rows removes header rows, blank lines, or outdated sections from an Excel worksheet directly in n8n. Provide the workbook as binary data, Base64, or a URL, target a specific worksheet or leave it blank for the first sheet, and supply a 1-based Row Ranges string (single rows, ranges, or a mix). Returns the cleaned workbook with the requested rows removed. Ideal for sanitizing exports before sharing, trimming templates, or dropping retention-exceeded records.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate row-deletion requests securely.
Important Facts You Should Not Miss
1-3,10,25-30, to delete multiple non-contiguous sections in a single node execution.
Full node panel: workbook via Binary Data, Row Ranges 10-20 on Sheet1
Parameters
Required in the n8n UI: Excel File Input Method, Source Document Name, and Row Ranges. Worksheet Name (defaults to the first sheet), Output File Name (default excel_rows_deleted.xlsx), and Output Binary Data Name (default data) are optional. Conditional workbook-source fields (Binary Data Property Name, Base64 Document Content, Document URL) appear only when the matching Excel File Input Method is chosen.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Excel File Input Method | Required | How the workbook enters the node. From Previous Node (Binary Data) reads from a prior node (default). Base64 String accepts an encoded workbook. URL downloads it from a public link. | From Previous Node (Binary Data) |
| Binary Data Property Name | Conditional | Name of the binary property on the incoming n8n item that holds the workbook. Required when Excel File Input Method is Binary Data. Defaults to data. | data |
| Base64 Document Content | Conditional | Base64-encoded workbook content. Required when Excel File Input Method is Base64 String. | UEsDBBQAAAA... |
| Document URL | Conditional | Publicly reachable HTTPS link to the workbook. Required when Excel File Input Method is URL. | https://files.example.com/report.xlsx |
| Worksheet Name | Optional | Worksheet to clean. Leave blank to target the first sheet in the workbook. | Summary |
| Row Ranges | Required | Row range string with 1-based row numbers. Accepts single rows, ranges, or a mixed comma-separated list. Rows are deleted bottom-to-top. | 1-3,10,25-30 |
| Output File Name | Optional | Filename of the cleaned workbook returned by the node. Default is excel_rows_deleted.xlsx. | excel_rows_deleted.xlsx |
| Source Document Name | Required | Logical filename of the source workbook, used for reference and tracking in the response. | myExcelFile.xlsx |
| Output Binary Data Name | Optional | Name of the binary property the output item exposes. Default is data. Use a different name when a downstream node expects it. | data |
What Fields Does the Output Include?
| Field | Type | What it contains |
|---|---|---|
fileName | String | Name of the output workbook after row deletion, set from Output File Name (default excel_rows_deleted.xlsx). |
fileSize | Number | Size of the output workbook in bytes. |
success | Boolean | True when the row deletion completed successfully. Use to route error-handling branches. |
originalFileName | String | The Source Document Name that was processed, kept for audit trails. |
worksheetName | String | Name of the worksheet where rows were deleted. |
rowRanges | String | The Row Ranges string that was used for this deletion. |
message | String | Descriptive status message including the row ranges and worksheet name. |
Binary (data) | Binary | The cleaned workbook under Output Binary Data Name (default data). Pass into Write Binary File, Email, or any storage upload. |
How Do I Set Up Delete Rows in n8n?
- Add the PDF4me Excel node to your n8n workflow and set Operation to Delete Rows.
- In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
- Set Excel File Input Method to From Previous Node (Binary Data) (default), Base64 String, or URL and fill the matching field.
- Enter Source Document Name, the logical filename of the workbook, for reference and tracking.
- Enter a Row Ranges string with 1-based row numbers, ranges, or a mixed list such as
1-3,10,25-30. - Optionally set Worksheet Name to target a specific sheet. Leave blank to target the first sheet.
- Optionally change Output File Name from the default
excel_rows_deleted.xlsxand Output Binary Data Name from the defaultdata. - Execute the node and route the cleaned workbook into Write Binary File, Email, or cloud storage.
Typical Setups
Workflow ExamplesCommon n8n workflow patterns using Delete Rows.
- A Google Drive Download node pulls the internal report workbook (Binary Data, property
data). - PDF4me Delete Rows runs with Row Ranges targeting the internal-notes rows and blank separator rows.
- A Write Binary File node saves the client-ready workbook using
$json.fileName.
- A Read Binary File node loads the master Excel template.
- PDF4me Delete Rows removes the example data rows before the template is distributed, with Worksheet Name set to the sheet holding sample rows.
- The cleaned template is uploaded to a shared onboarding folder.
- A Cron node triggers weekly on a records workbook stored at a fixed URL.
- An earlier step computes the Row Ranges string for retention-exceeded records and passes it into PDF4me Delete Rows with Excel File Input Method set to URL.
- The cleaned workbook overwrites the source file in cloud storage.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Operation | Delete Rows |
| Excel File Input Method | From Previous Node (Binary Data) |
| Binary Data Property Name | data |
| Worksheet Name | Sheet1 |
| Row Ranges | 10-20 |
| Output File Name | excel_rows_deleted.xlsx |
| Source Document Name | myExcelFile.xlsx |
| Output Binary Data Name | data |
| Credentials | PDF4me API credential |
Frequently Asked Questions
Related Actions
Same Task on Other Platforms
POST office/ApiV2Excel/ExcelDeleteRows endpoint, for custom backend code or Postman testing.Use Cases
- Report cleanup: Remove internal notes, totals, or blank separators before sending to clients.
- Template preparation: Strip example rows from Excel templates prior to onboarding new users.
- Compliance workflows: Drop expired records or retention-exceeded rows automatically.