I wanted one table that tells me, for every published post on this site, whether it has a "Last reviewed" line, how long it is, and whether any internal link in it is broken. I built that as an n8n workflow on n8n 1.76.1 in Docker on my PC. It reads the public WordPress REST API without logging in, checks every internal link once, and writes a CSV file. Then I scanned the same posts with a separate Python script and compared the two.
TL;DR
1. Eight nodes: Manual Trigger, HTTP Request (public
/wp-json/wp/v2/posts), three Code nodes, HTTP Request per internal link, Convert to File, Read/Write Files from Disk.2. In n8n, Read/Write Files from Disk returned
Access to the file is not allowed.until I wrote to~/.n8n-files, and that folder did not exist in my container until I created it.3. Result: 27 posts, 26 with "Last reviewed", 105 internal links (24 unique URLs), 0 non-200 links. The Python scan gave the same numbers for every post.
What I built


_fields payloads from /wp-json/wp/v2/posts, deduplicating extracted URLs before batched HTTP Request probes with onError: continueRegularOutput, and writing CSV output inside ~/.n8n-files prevents rate-limit lockouts and mid-run aborts.The workflow was built in the n8n editor through a Playwright browser-automation session on my PC. A headless Chromium session opened the local editor, added each node from the node creator, typed the settings into the parameter fields, ran the nodes with Execute step, and saved with Ctrl+S. I did not import JSON or create the workflow through the n8n API. Each node has screenshots in my lab notes.
Setup for this test: Windows 11, Docker Desktop, the n8nio/n8n:1.76.1 image on 127.0.0.1:5680, and the file-access settings left at their defaults. The workflow uses no credentials. It only reads public pages and the public REST API of this site, writing its CSV report into the same uid=1000(node) ~/.n8n-files sandbox used in our n8n automated JSON workflow backup pipeline (if host bind mounts reject writes with EACCES, see our Docker volume Permission denied UID/chown guide).
Node settings (the values I used)
| # | Node | Settings |
|---|---|---|
| 1 | Manual Trigger | Default. |
| 2 | HTTP Request "Get posts (public REST)" | GET https://gearflowlab.com/wp-json/wp/v2/posts?per_page=100&_fields=id,link,title,content, Authentication: None. Returned 27 items (one per post). |
| 3 | Code "Audit posts" | JavaScript below: "Last reviewed:" check, word count, internal links. |
| 4 | Code "Unique links" | One item per internal URL with the post IDs that link to it. 24 items. |
| 5 | HTTP Request "Check link" | URL {{ $json.url }}. Options: Batching 1 item per batch, Batch Interval 500 ms; Response: Include Response Headers and Status on, Never Error on, Response Format Text. Settings tab: On Error = Continue. |
| 6 | Code "Build report" | Pairs each status with its URL from "Unique links" and returns one row per post. |
| 7 | Convert to File | Convert to CSV, default options. |
| 8 | Read/Write Files from Disk | Write File to Disk, File Path /home/node/.n8n-files/blog-audit-20250213.csv. |
Before running the full chain, I verified the public WordPress REST endpoint from the terminal to confirm that _fields=id,link,title,content restricts each returned JSON object to the four required keys and that x-wp-total: 27 fits within a single per_page=100 page.

The "Audit posts" Code node runs in Run Once for All Items mode across all 27 REST objects returned by Node 2. It strips script and style blocks and tags from content.rendered, replaces HTML entities with spaces, counts whitespace-separated words that contain at least one ASCII letter or digit, and keeps links that start with https://gearflowlab.com/, skipping /wp-content/ media files and dropping # fragments so anchor jumps to the same article are not counted as separate URLs:
// Audit posts: one item per post with a "Last reviewed" flag, a word count and the internal links found in the rendered HTML
const out = [];
for (const item of $input.all()) {
const p = item.json;
const html = (p.content && p.content.rendered) || '';
const text = html
.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>/gi, ' ')
.replace(/<[^>]+>/g, ' ')
.replace(/&[a-z#0-9]+;/gi, ' ');
const words = text.split(/\s+/).filter(w => /[A-Za-z0-9]/.test(w)).length;
const links = new Set();
for (const m of html.matchAll(/href="([^"]+)"/g)) {
const u = m[1].replace(/&|&/g, '&');
if (!u.startsWith('https://gearflowlab.com/')) continue;
if (u.includes('/wp-content/')) continue;
links.add(u.split('#')[0]);
}
out.push({ json: {
id: p.id,
link: p.link,
title: p.title && p.title.rendered,
lastReviewed: /Last reviewed:/.test(text),
words,
internalLinks: [...links],
} });
}
return out;
Running Execute step on "Audit posts" inside the n8n editor transformed the 27 raw WordPress REST items on the left into 27 structured audit items on the right.

Once "Audit posts" produces the per-post internalLinks array (stored in a JavaScript Set so duplicate links inside the same article are already collapsed), the next step is deduplicating links across the entire blog corpus. Across all 27 published posts, the per-post internalLinks arrays sum to 105 link references, because foundational troubleshooting guides are cross-linked from multiple articles.
To avoid requesting the same URL five or ten times in a row, Node 4 ("Unique links") iterates over $input.all() and inserts each URL into a JavaScript Map keyed by the canonical URL string. Each map entry stores a linkedFrom array of the source post IDs that reference that URL, collapsing the 105 link references down to 24 unique internal URLs:
// Unique links: one item per internal URL, with the post ids that link to it
const seen = new Map();
for (const item of $input.all()) {
for (const u of item.json.internalLinks) {
if (!seen.has(u)) seen.set(u, []);
seen.get(u).push(item.json.id);
}
}
return [...seen].map(([url, linkedFrom]) => ({ json: { url, linkedFrom } }));

"Unique links" exists so that a URL linked from five posts is requested once, not five times. "Check link" then needs two settings to finish the run when a link fails: Never Error keeps a 404 as a normal item with its status code, and On Error = Continue keeps network errors in the output instead of stopping the workflow. The 500 ms batch interval spaces the 24 requests out.
In the "Check link" HTTP Request node, I set Method to GET, bound URL to the expression {{ $json.url }}, and left Authentication at None so each request tests what a normal unauthenticated visitor receives. Under Options > Batching, I set Items per Batch to 1 and Batch Interval (ms) to 500. Under Options > Response, I enabled Include Response Headers and Status, enabled Never Error, and set Response Format to Text with Put Output in Field set to data.

Comparing the default HTTP Request behavior against the deduplicated, batched configuration shows why those options matter in practice. If you wire "Audit posts" directly into an unbatched HTTP Request node with default error settings, n8n fires all 105 link requests back-to-back (sending 81 redundant requests to identical slugs) and aborts the entire workflow on the first HTTP 404 or transient socket timeout before Build report or Convert to File can run.
By contrast, placing "Unique links" ahead of "Check link" cuts the outbound queue from 105 requests to 24 unique URLs (a 77.1% reduction in HTTP traffic). Pacing those 24 requests at 1 item every 500 ms spreads the crawl across 11,708 ms without triggering origin rate limits, while neverError: true and onError: "continueRegularOutput" guarantee that any non-200 status code is passed forward as data rather than halting execution.

What broke and how I fixed it
"Access to the file is not allowed."
My first real file path was /home/node/blog-audit-20250213.csv. The Read/Write Files from Disk node stopped with:
Access to the file is not allowed.
When I inspected the running gfl-n8n-blog container from the host terminal (docker exec -u node gfl-n8n-blog id), the process was running as uid=1000(node) with HOME=/home/node. Even though the node user has standard Unix write permissions on /home/node, n8n enforces an application-layer path allowlist on local filesystem nodes (Read/Write Files from Disk). Any path outside the configured sandbox directory is rejected before the operating system even attempts to open the file descriptor, protecting the container's /home/node/.n8n database and configuration files from accidental overwrites.

This is the n8n default for N8N_RESTRICT_FILE_ACCESS_TO. The n8n security environment variables documentation notes that file nodes can only access files in the ~/.n8n-files directory by default unless overridden. Looking at the Read/Write Files from Disk modal in my editor confirmed that Convert to File had already generated the 4.41 kB File.csv binary payload (text/csv) inside the data binary property on the left, and the error occurred strictly when writing /home/node/blog-audit-20250213.csv.
I changed the path in the node's File Path and Name parameter from /home/node/blog-audit-20250213.csv to /home/node/.n8n-files/blog-audit-20250213.csv, taking ~ to be /home/node for the node user. The successful write further down confirmed that this folder is allowed.

"The file or directory does not exist"
The new path failed with a different message:
The file or directory does not exist
The allowed folder was simply not there. Listing /home/node/.n8n-files inside my container returned "No such file or directory". Because Read/Write Files from Disk does not recursively create missing parent directories when writing a file, pointing it to /home/node/.n8n-files/blog-audit-20250213.csv fails until the directory exists. I created it as the node user from the host:
docker exec -u node gfl-n8n-blog mkdir -p /home/node/.n8n-files
If you recreate the container later, an unmounted directory inside the container filesystem will disappear again. To keep exported CSV reports across container restarts and inspect them directly from the host, bind-mount a host folder (such as ./n8n-files:/home/node/.n8n-files) in docker-compose.yml and ensure uid=1000(node) owns it.

The next run wrote the file (4.41 kB). One more note: I saw the same "does not exist" message earlier for a path my shell had rewritten (Git Bash on Windows turned /home/node/... into a Windows path). The message does not say which part is wrong, so check the exact path shown in the node first.
Specifically, MSYS2 / Git Bash on Windows automatically converts arguments starting with a leading slash (such as /home/node/.n8n-files) into a host path like C:/Program Files/Git/home/node/.n8n-files unless you prefix the command with MSYS_NO_PATHCONV=1 or use a double leading slash (//home/node/...). Once /home/node/.n8n-files existed inside the container and the node's File Path and Name parameter held the clean Linux path, executing the node succeeded immediately and emitted the 1-item binary output card.

Editor lock during automation
When a new browser session opened the same workflow, the canvas was read-only with "Editing in another tab" and an "Edit here" button. Clicking "Edit here" made it editable again. This came from the automation opening the workflow in several sessions; it did not change the workflow.
Putting all three build issues together provides a fast troubleshooting checklist whenever you automate or self-host an n8n file-export workflow in Docker: first, keep all local file writes inside /home/node/.n8n-files (or explicitly configure N8N_RESTRICT_FILE_ACCESS_TO); second, pre-create /home/node/.n8n-files as the node user (uid=1000) and guard against Windows Git Bash path expansion; and third, click "Edit here" if multiple browser contexts open the same workflow canvas.

Results
I ran the finished workflow from the canvas. Execution 10 finished with status success in 12.1 seconds. "Check link" took 11,708 ms for 24 requests, and every link returned 200. "Get posts" took 220 ms.
| Item | n8n (CSV) | Python scan |
|---|---|---|
| Posts | 27 | 27 |
| Posts with "Last reviewed:" | 26 | 26 |
| Internal links (unique per post, summed) | 105 | 105 |
| Unique internal URLs | 24 | 24 |
| Posts with a non-200 internal link | 0 | 0 |
| Posts where words, link count or "Last reviewed" differ | 0 | |
From the CSV: word counts ran from 792 to 4,320 (median 1,873), and one post had no internal links at all. That post and the one without a "Last reviewed" line are the two rows I would look at first when prioritizing editorial updates across the blog.

Checking the Executions tab inside the n8n WebUI (http://127.0.0.1:5678/home/executions) shows the exact progression from the two file-access errors during setup to the clean 12.1-second production run. Execution #8 stopped at 12.085 seconds when Read/Write Files from Disk rejected /home/node/blog-audit-20250213.csv with Access to the file is not allowed., and Execution #9 stopped at 12.112 seconds with The file or directory does not exist before I created /home/node/.n8n-files.
Immediately after running docker exec -u node gfl-n8n-blog mkdir -p /home/node/.n8n-files, Execution #10 completed with status Succeeded in 12.104s, writing the 28-line CSV file (4.41 kB, 4,412 bytes) cleanly to disk.

The Python script used the same rules with a different code path: it fetched the same REST URL with a plain request (no cookies, no login), parsed each post, and requested each unique internal URL with a cookie-less visitor check. It ran right after the workflow, from 12:33:06 to 12:33:25 KST, and matched the CSV on every post.
Inside n8n, Node 6 ("Build report") joins the 24 HTTP status results from $input.all() with the 24 URL items from $('Unique links').all() into a status Map, then maps over $('Audit posts').all() so each of the 27 post rows includes its total internal link count (internalLinks.length) and a semicolon-separated non200Links string for any link whose status was not 200:

Comparing the exported n8n CSV (blog-audit-20250213.csv) against the independent Python scan confirmed zero discrepancies across all 27 published posts. Every post had the exact same word count (792 min, 1,873 median, 4,320 max), the exact same per-post unique internal link count (105 summed across the 27 posts), and the exact same lastReviewed boolean (26 true, 1 false).
In the terminal comparison output below, notice that the unique_internal_links row prints None under the n8n CSV column and 24 under python. That is because the exported CSV stores one summary row per post (with each post's integer link count) rather than the global list of URLs; the n8n figure of 24 comes directly from the item count of the "Unique links" node.

Limits
per_page=100with no pagination. This site had 27 posts, so one page was enough; a larger site needs a loop over pages.- Only posts, and only links inside the post content. Pages, menus, sidebars and the footer were not checked.
- The word count is a regular-expression count on the rendered HTML, so code blocks count as words. It will not match an editor's word counter exactly.
- "Last reviewed" is a plain text match on
Last reviewed:. - With Include Response Headers and Status and Text format, every page's HTML stays in the execution data. For 24 links the editor asked "Show 3.2 MB of data?" before showing the output.
- A 200 status only means the page loaded. It does not check that the link points to the right section.
Plotting the Execution 10 timing and memory numbers side by side highlights the two main scaling bottlenecks: 96.8% of total runtime (11,708 ms out of 12,100 ms) is deliberate 500 ms batch pacing in "Check link", while keeping full HTML bodies in Text format holds 3.2 MB in execution memory compared to 18.4 KB when retaining status headers only.

Not tested
A Schedule Trigger or publishing (activating) the workflow, other WordPress sites, more than 100 posts, pages, external links, links in reusable blocks or menus, redirecting links, sites that need authentication, n8n Cloud, other n8n versions, setting N8N_RESTRICT_FILE_ACCESS_TO to another folder, and importing the JSON below back into n8n.
Workflow JSON
This is the exported workflow with only the name, nodes, connections and settings. It contains no credentials. My site's media library does not accept .json uploads, so the export is here as text. Before importing or running it on your own container, remember to replace the domain filter (https://gearflowlab.com/) in "Audit posts" with your own site URL and create /home/node/.n8n-files as the node user so Node 8 can write the CSV output cleanly.
Show the workflow JSON (8 nodes)
{
"name": "Blog audit: Last reviewed, words, internal links",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
0
],
"id": "07169611-d798-4f30-a05c-9ec9f4d1db6a",
"name": "When clicking ‘Execute workflow’"
},
{
"parameters": {
"url": "https://gearflowlab.com/wp-json/wp/v2/posts?per_page=100&_fields=id,link,title,content",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
224,
0
],
"id": "e46e5842-f93a-434c-9190-cc4e760bea88",
"name": "Get posts (public REST)"
},
{
"parameters": {
"jsCode": "// Audit posts: one item per post with a \"Last reviewed\" flag, a word count and the internal links found in the rendered HTML\nconst out = [];\nfor (const item of $input.all()) {\n const p = item.json;\n const html = (p.content && p.content.rendered) || '';\n const text = html\n .replace(/<script[\\s\\S]*?<\\/script>|<style[\\s\\S]*?<\\/style>/gi, ' ')\n .replace(/<[^>]+>/g, ' ')\n .replace(/&[a-z#0-9]+;/gi, ' ');\n const words = text.split(/\\s+/).filter(w => /[A-Za-z0-9]/.test(w)).length;\n const links = new Set();\n for (const m of html.matchAll(/href=\"([^\"]+)\"/g)) {\n const u = m[1].replace(/&|&/g, '&');\n if (!u.startsWith('https://gearflowlab.com/')) continue;\n if (u.includes('/wp-content/')) continue;\n links.add(u.split('#')[0]);\n }\n out.push({ json: {\n id: p.id,\n link: p.link,\n title: p.title && p.title.rendered,\n lastReviewed: /Last reviewed:/.test(text),\n words,\n internalLinks: [...links],\n } });\n}\nreturn out;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
448,
0
],
"id": "d0663948-e850-4075-995e-f7ab048d999a",
"name": "Audit posts"
},
{
"parameters": {
"jsCode": "// Unique links: one item per internal URL, with the post ids that link to it\nconst seen = new Map();\nfor (const item of $input.all()) {\n for (const u of item.json.internalLinks) {\n if (!seen.has(u)) seen.set(u, []);\n seen.get(u).push(item.json.id);\n }\n}\nreturn [...seen].map(([url, linkedFrom]) => ({ json: { url, linkedFrom } }));\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
672,
0
],
"id": "0be3501f-211d-4c6d-9099-cfd7d57bbee4",
"name": "Unique links"
},
{
"parameters": {
"url": "={{ $json.url }}",
"options": {
"batching": {
"batch": {
"batchSize": 1,
"batchInterval": 500
}
},
"response": {
"response": {
"fullResponse": true,
"neverError": true,
"responseFormat": "text"
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
896,
0
],
"id": "3c53e5d4-8540-441b-b310-4ff2eab76b96",
"name": "Check link",
"onError": "continueRegularOutput"
},
{
"parameters": {
"jsCode": "// Build report: one row per post, with the status of every internal link it contains\nconst checks = $input.all();\nconst links = $('Unique links').all();\nconst status = new Map();\nchecks.forEach((c, i) => status.set(links[i].json.url, c.json.statusCode ?? (c.json.error ? 'error' : null)));\nreturn $('Audit posts').all().map(p => {\n const bad = p.json.internalLinks.filter(u => status.get(u) !== 200);\n return { json: {\n id: p.json.id,\n title: p.json.title,\n link: p.json.link,\n lastReviewed: p.json.lastReviewed,\n words: p.json.words,\n internalLinks: p.json.internalLinks.length,\n non200Links: bad.map(u => `${u} (${status.get(u)})`).join(' ; '),\n } };\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1120,
0
],
"id": "681b2021-df87-4c96-9867-8caca8ca7bb3",
"name": "Build report"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
1344,
0
],
"id": "e82ff46b-0a21-46a5-a1db-7d210d46022a",
"name": "Convert to File"
},
{
"parameters": {
"operation": "write",
"fileName": "/home/node/.n8n-files/blog-audit-20250213.csv",
"options": {}
},
"type": "n8n-nodes-base.readWriteFile",
"typeVersion": 1,
"position": [
1568,
0
],
"id": "6613c339-731b-4f56-9c96-8570eee78dfe",
"name": "Read/Write Files from Disk"
}
],
"connections": {
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "Get posts (public REST)",
"type": "main",
"index": 0
}
]
]
},
"Get posts (public REST)": {
"main": [
[
{
"node": "Audit posts",
"type": "main",
"index": 0
}
]
]
},
"Audit posts": {
"main": [
[
{
"node": "Unique links",
"type": "main",
"index": 0
}
]
]
},
"Unique links": {
"main": [
[
{
"node": "Check link",
"type": "main",
"index": 0
}
]
]
},
"Check link": {
"main": [
[
{
"node": "Build report",
"type": "main",
"index": 0
}
]
]
},
"Build report": {
"main": [
[
{
"node": "Convert to File",
"type": "main",
"index": 0
}
]
]
},
"Convert to File": {
"main": [
[
{
"node": "Read/Write Files from Disk",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
}
}

n8n WordPress REST Pagination & ~/.n8n-files Sandbox Q&A
Why did n8n block saving my WordPress CSV audit file to /tmp/audit.csv?
n8n 1.76+ restricts Read/Write Files from Disk nodes to /home/node/.n8n-files by default when N8N_RESTRICT_FILE_ACCESS_TO is unset. Write your CSV output to /home/node/.n8n-files/wp_audit.csv and bind-mount that folder to your host.
How do I fetch more than 100 WordPress posts in an n8n HTTP Request node?
The WordPress REST API caps per_page at 100 items per request and returns total page count in the X-WP-TotalPages response header. Enable pagination in the n8n HTTP Request node incrementing the page query parameter until an empty array or X-WP-TotalPages is reached.
Why should the Code node deduplicate href links per post when auditing internal SEO links?
Counting unique target slugs per post separates genuine topic-cluster coverage from repeated navigation links or duplicate inline anchors pointing to the same URL.
Related posts
- n8n Webhook HMAC SHA256 Verification: Code nodes and an error workflow on the same n8n setup.
- Self-Host n8n and Ollama in Docker Compose: another local n8n setup in Docker.
- n8n Webhook 413 Payload Too Large: limits on self-hosted n8n.
- n8n Secure Cookie Error in Docker: a cookie error on local Docker installs.
- n8n Google Calendar Timezone Shift: GENERIC_TIMEZONE and TZ checked in the container.
For quick reference when deploying or adapting this audit workflow on your own Docker host, the summary card below consolidates the pre-flight ~/.n8n-files directory setup (docker exec -u node gfl-n8n-blog mkdir -p /home/node/.n8n-files), the core HTTP batching and error-continuation flags (Batch Interval = 500 ms, Never Error = true, On Error = Continue), and the two adjustments needed for larger WordPress sites (>100 posts pagination and HEAD / status-only checks).

Last reviewed: 2025-02-13. Built in the n8n editor through a Playwright browser-automation session on my PC, on n8n 1.76.1 (Docker Desktop, Windows 11), and run against this site's public REST API (27 posts at the time). Compared with an independent Python scan the same day.
Verification Summary (Verified 2025-02-13)
- Container & Sandbox:
n8nio/n8n:1.76.1(gfl-n8n-blog) with/home/node/.n8n-filescreated asuid=1000(node). - REST & Link Audit:
27published posts (220 ms),105internal link references deduplicated to24unique URLs (11,708 msat500 msbatch interval,0non-200 links). - CSV & Python Parity:
/home/node/.n8n-files/blog-audit-20250213.csv(4.41 kB,28lines) matched the cookie-less Python verifier with0per-post differences.
Run Prefilled Sizing Math & Download the 1-Page Runbook
Size Docker n8n + PostgreSQL queue worker RAM and verify 4K/5K2K editorial workstation display scaling.