@apdf/n8n-nodes-apdf
v1.1.0
Published
n8n node for Apdf — PDF tracking links, reader analytics and PDF processing
Maintainers
Readme
@apdf/n8n-nodes-apdf
An n8n node for Apdf — the PDF engagement layer for apps and agents.
Share a PDF as a per-recipient tracking link, then find out who opened it, which pages they actually read, how long they stayed and what they typed into its forms. The same node also covers the full Apdf PDF toolset: create, convert from Office, merge, split, compress, OCR, encrypt, read and fill forms, and page operations.
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the
community node installation guide
and install @apdf/n8n-nodes-apdf.
Credentials
The nodes authenticate with an Apdf API token.
- Sign in at apdf.io and open Dashboard → API → Tokens.
- Create a token and copy it. A token belongs to one workspace, so every request through this node acts on that workspace.
- In n8n, create new Apdf API credentials and paste the token.
The Base URL field defaults to https://apdf.io/api and only needs changing if you run
Apdf on another host.
Apdf sends the token as Authorization: Bearer <token>. The credential test calls
GET /me, which returns the user and workspace the token acts as.
Nodes
This package ships two nodes:
| Node | Purpose | | ---------------- | -------------------------------------------------------------------- | | Apdf Trigger | Starts a workflow when a reader interacts with a document you shared | | Apdf | Reads engagement data and runs PDF operations |
Apdf Trigger
The trigger receives the webhook that an Apdf automation sends when a reader does something.
Automations, and so this trigger, need a Pro or Business plan. On the free Hobby plan Apdf refuses to create the automation, so activating the workflow fails with an error. The same happens once the plan's limit of active automations is reached. See pricing for the limits of each plan.
Setup
The trigger registers itself. Pick the events you care about and activate the workflow — the node creates the matching automation in Apdf, and deletes it again when you deactivate.
- Add the Apdf Trigger node and select your Apdf API credentials.
- Choose one or more Events.
- Optionally restrict it to certain Documents by ID, and add Conditions such as page number equals 7.
- Activate the workflow. The automation appears under Documents → Automations in Apdf, named after your workflow.
Nothing needs creating by hand. If you delete the automation in Apdf, deactivating and reactivating the workflow recreates it.
Under Options you can set an Auth Header Value. The node sends it to Apdf as a webhook header and rejects any incoming request that does not carry it — worth setting, since the webhook URL is otherwise the only thing protecting the endpoint. Auth Header Name changes which header carries it, and Automation Name overrides the name the automation gets in Apdf.
Events
Choose at least one event. Apdf filters on its side, so the workflow only runs for what you selected.
| Event | Fires when | | -------------------- | --------------------------------------------------- | | Document Opened | A reader opens the document | | Document Downloaded | A reader downloads the document | | Document Printed | A reader prints the document | | Page Viewed | A reader navigates to a page | | Page Read | A reader stays on a page, measured every 15 seconds | | Page Left | A reader navigates away from a page | | Text Copied | A reader copies text from the document | | Link Clicked | A reader clicks a link in the document | | Form Submitted | A reader submits a form in the document | | Annotation Created | A reader creates an annotation | | Annotation Updated | A reader modifies an annotation | | Annotation Deleted | A reader removes an annotation |
Document and page events — opened, downloaded, printed, viewed, read and left — trigger an automation once per reading session, even where the underlying measurement repeats. Page Read is measured every 15 seconds, but your workflow runs once for that session. Text Copied, Link Clicked, Form Submitted and the annotation events fire every time they happen.
Output
The trigger emits the automation payload unchanged:
{
"automation": { "id": "…", "name": "Notify on read" },
"document": {
"doc_id": "…",
"name": "Proposal.pdf",
"viewer_url": "https://…",
"file_pages": 12
},
"trigger": { "matched_event": "page:read", "conditions_evaluated": true },
"event": {
"session_id": "…",
"viewer_id": "…",
"recipient": { "name": "Jane Doe", "email": "[email protected]" },
"data": { "page": 5, "duration_ms": 45000 }
},
"session": { "total_duration_ms": 182000, "pages_viewed": 8, "completion_rate": 66.7 },
"timestamp": "2026-07-28T12:00:00+00:00"
}session.completion_rate is a percentage of the document's pages. event.recipient is
null when Apdf cannot tie the reader to a tracking link.
event.data varies by event:
| Event | event.data |
| -------------------------------------- | ------------------------------------------------------------------- |
| Page Viewed | page |
| Page Read, Page Left | page, duration_ms |
| Text Copied | page, text |
| Link Clicked | page, url, text, is_internal |
| Form Submitted | fields |
| Annotation Created, Annotation Updated | page, type, comment_text, comment_author, annotated_text |
| Annotation Deleted | page |
| Document Opened, Downloaded, Printed | null |
Example
Alert your team the moment a prospect reads your pricing page:
Apdf Trigger — event Page Read, Documents set to the proposal's ID, and a Condition of page number equals
5.Use a condition rather than an IF node downstream. The automation fires once per reading session, on the first Page Read that satisfies its conditions, so filtering afterwards in n8n would usually see a different page and never match.
Slack — post
{{ $json.event.recipient.name }} just read page {{ $json.event.data.page }} — {{ $json.session.pages_viewed }} pages in {{ $json.session.total_duration_ms / 1000 }}s.
Conditions
| Condition | Tests | | ----------------------------- | ---------------------------------------------- | | Page Number Equals | The page the event happened on | | Time on Page At Least | Seconds spent on that page | | Total Reading Time At Least | Seconds spent in the whole session | | Pages Viewed At Least | How many distinct pages were seen | | Completion Rate At Least | Percentage of the document read |
Not every condition works with every event — a page condition needs a page event, for instance. Apdf validates the combination when the workflow is activated and returns a clear error if it cannot work.
Apdf
Wherever an operation needs a document, the node offers a Document Name or ID dropdown populated from your workspace — pick one, or supply an ID with an expression when it comes from an earlier node.
List operations follow the n8n convention: Return All fetches every page, or leave it off and set a Limit. Responses are unwrapped, so each record arrives as its own item rather than as one item holding the whole response.
Document
Create, list, get and delete tracked documents, archive and unarchive them, and switch a document between public and link-only access.
Creating a document takes a publicly reachable File URL and a Name.
Tracking Link
Create one link per recipient so that reading activity is attributed to a person rather than an anonymous reader. Create, list, delete, activate and deactivate links.
A Recipient Name is required; Recipient Email is optional.
Analytics
| Operation | Returns | | ---------------------- | --------------------------------------------------------------- | | Get Document Analytics | Sessions, readers, completion rate and downloads for a document | | Get Sessions | The reading sessions recorded for a document | | Get Session | One session, including its per-page detail | | Get Annotations | Highlights and comments readers left | | Get Form Submissions | What readers typed into the document's forms |
The operations of the Apdf PDF API: Create From HTML, Convert From Office, Merge, Split, Compress, Convert to Image, Extract Pages, Delete Pages, Rotate Pages, Overlay Pages, Underlay Pages, Search Content, Read Content, OCR Convert, OCR Search Content, OCR Read Content, Read Form, Fill Form, Visualize Form, Add Security, Remove Security and Read Metadata.
Every operation takes its source as a publicly reachable URL. Operations that change a PDF return a new file and never modify the source, including Delete Pages.
Convert From Office takes a Word, Excel, PowerPoint, OpenDocument or RTF file (docx, doc, xlsx, xls, pptx, ppt, odt, ods, odp, rtf) instead of a PDF.
The form operations work together:
- Read Form returns every form field with its name, type, value and options, along with its label and the text printed around it on the page.
- Fill Form takes the fields to fill by those names. A checkbox takes
trueorfalse; radio buttons, dropdowns and list boxes take the option to select. Fields you leave out keep their value, and calculated fields such as totals are updated. Enable Flatten under Options so the filled fields can no longer be changed. - Visualize Form renders the form pages as images with a numbered box on every field, and
lists which field each number is. Hand the images to an AI step, so it can tell which field
to fill even when the names say nothing, like
Text12.
Automation
Full control over the rules that turn reader activity into webhook calls: Create, Get, Get Many, Delete, Activate, Deactivate, Duplicate, and Get Executions for the delivery history.
Creating one takes a Name, one or more Events and a Webhook URL. Set Scope to Specific Documents to narrow it to given IDs, add Conditions to fire only past a threshold, and add Webhook Headers so your endpoint can authenticate the call.
Like the trigger, this needs a Pro or Business plan. Create, Activate and Duplicate fail with an error on the Hobby plan or once the plan's limit of active automations is reached.
If you only want a workflow to react to readers, use the Apdf Trigger instead — it creates and removes its own automation. Use this resource when you are managing automations programmatically, for instance pointing them at systems outside n8n.
Job
Check Status polls an asynchronous operation for its result.
Asynchronous operations
Apdf runs heavy work on a queue. Seven operations always return a job ID instead of a result:
- Create From HTML
- Convert From Office
- Compress
- Convert to Image
- OCR Convert
- OCR Read Content
- OCR Search Content
The remaining PDF operations run inline by default, and return a job ID only when you enable Run Asynchronously under Options.
To get the result of a job, either poll it with the Job → Check Status operation, or set a Webhook URL so Apdf calls you when the job finishes.
Page ranges
Operations that take a Pages value accept page numbers and ranges, for example 1,3-5.
Two shortcuts are available:
z— the last pagerN— the Nth page from the end, sor2is the second-to-last page
Split additionally accepts nN, which splits into files of N pages each. n2 yields
files of two pages.
Resources
- Apdf documentation
- Apdf MCP server — for agent access rather than workflow steps
- n8n community nodes documentation
