Unlock PDF in n8n
Unlock PDF is a PDF4me node action in n8n that removes password protection from a PDF when you supply the correct password. Use it to make protected files readable by later workflow steps, clear encryption from an archive you own, or unlock every statement a supplier sends without opening them one at a time.
What this node does
PDF4me: Unlock PDF takes a protected PDF from Binary Data, a Base64 String, or a URL, applies the password you provide, and returns a copy that opens without a prompt. The Password field is required, so this unlocks documents you are already authorised to open rather than recovering a lost password. Its usual job is to sit at the front of a pipeline, because extraction and conversion steps cannot read an encrypted file.
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 unlock requests securely.
Important Facts You Should Not Miss

PDF4me Unlock PDF parameters panel in n8n
Unlock PDF vs Protect Document
These two actions are opposites, and workflows often use both: unlock an incoming file to read it, then re-protect the result before it goes back out.
| Aspect | Unlock PDF | Protect Document |
|---|---|---|
| What it does | Removes existing password protection | Applies password protection |
| Password you supply | The current password on the document | The new password you want to set |
| Typical position | First step, so later nodes can read the file | Last step, before the file is sent or stored |
| Prerequisite | You must already know the password | None beyond the source document |
What Parameters Does Unlock PDF Need?
Required: Action, Input Data Type, the field matching that input type, Output File Name, and Password. Binary Data Output Name and Custom Profiles carry working defaults.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Action | Required | Selects the PDF4me node action to run. Choose Unlock PDF. | Unlock PDF |
| Input Data Type | Required | Format of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL. | Binary Data |
| Input Binary Field | Conditional | Name of the binary property on the incoming n8n item that holds the protected PDF. Required when Input Data Type is Binary Data. Defaults to data. | data |
| Base64 Document Content | Conditional | Base64-encoded content of the protected PDF. Required when Input Data Type is Base64 String. | JVBERi0xLjQK... |
| File URL | Conditional | Publicly reachable HTTPS URL to the protected PDF. Required when Input Data Type is URL. | https://example.com/statement.pdf |
| Output File Name | Required | Filename for the unlocked PDF returned by the node. Include the .pdf extension. | unlocked_output.pdf |
| Password | Required | The current password on the document. Shown masked in the panel. Reference a credential or environment variable rather than typing the secret into a saved workflow. | {{ $env.PDF_PASSWORD }} |
| Binary Data Output Name | Optional | Name of the binary property the output item exposes. Defaults to data. | data |
| Custom Profiles | Optional | Advanced Options field for extra processing settings, supplied in a JSON-like format. Leave blank unless you have a specific profile to apply. | { "preserveMetadata": true } |
Output Fields
A successful run returns one n8n item carrying the unlocked PDF.
| Field | Type | What it contains |
|---|---|---|
Binary (data) | Binary | The unlocked PDF, under Binary Data Output Name (default data). |
fileName | String | Generated filename, matching Output File Name. |
docName | String | Name of the processed document, for reference and tracking. |
mimeType | String | MIME type of the output, always application/pdf. |
fileSize | Number | Size of the returned PDF in bytes. |
isUnlocked | Boolean | Confirms the document was unlocked. A useful assertion before handing the file to an extraction step. |
securityRemoved | Boolean | Confirms password protection and access restrictions were removed. |
success | Boolean | True when the unlock completed, false on failure such as a wrong password. Use it to branch error handling. |
message | String | Human-readable status message, carrying success confirmation or error detail. |
How Do I Set Up Unlock PDF in n8n?
- Add PDF4me to your n8n workflow and choose the Unlock PDF action.
- In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
- Set Input Data Type to Binary Data (default), Base64 String, or URL and supply the matching source PDF field.
- Set Output File Name for the unlocked file, ending in
.pdf. - Enter the document Password, ideally as an expression that reads a credential or environment variable.
- Leave Binary Data Output Name as
dataunless a later node expects a different property. - Execute the node and route the unlocked PDF into the next step, such as extraction, conversion, or storage.
Typical Setups
Workflow ExamplesCommon n8n workflow patterns using Unlock PDF.
- A statement arrives by email protected with a known password.
- Unlock PDF removes the protection using a stored secret.
- A table extraction step reads the transactions into a sheet.
- Legacy documents in a shared drive all carry the same old password.
- Unlock PDF runs over each file during a migration batch.
- The unprotected copies land in the new document system, searchable.
- Unlock PDF opens an incoming protected document.
- The workflow stamps, merges, or edits the readable file.
- Protect Document applies a fresh password before it is sent back out.
- Unlock PDF attempts the stored password on each arriving file.
- An IF node tests the returned success and isUnlocked fields.
- Failures route to an alert so a rotated password is noticed immediately.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Unlock PDF |
| Input Data Type | Binary Data |
| Input Binary Field | data |
| Output File Name | unlocked_output.pdf |
| Password | {{ $env.PDF_PASSWORD }} |
| Binary Data Output Name | data |
| Credentials | PDF4me API credential |