Notion to LinkedIn: n8n template that publishes the approved draft revision
This n8n workflow turns a Notion page marked Ready for review into a PubNio draft and writes its revision number back. Typing that number into Approve revision publishes it to LinkedIn. Editing the page first updates the draft and raises its revision, so an approval of older text never publishes.
What it does.
- Trigger. A Schedule Trigger every 15 minutes reads every page of one database.
- Approval. Type the draft revision shown in pubnio_revision into Approve revision. An approval of any other revision publishes nothing.
- Request. One draft create with isDraft: true per Ready page, an update when the page text or image changes, and one publish request for the approved revision. An image is imported before the draft that carries it. Each create carries the item's saved key as
Idempotency-Key, and every request sendsPubNio-Version: 2026-12-02. - Result. The answer is written back to the item; the next runs read the post's status until every destination settles.
Fields: Database properties.
The workflow also fills pubnio_key, pubnio_post_id, pubnio_status, pubnio_outcome, pubnio_error, pubnio_sent_at; create them as text fields.
| Field | Type | Use |
|---|---|---|
Status | select | Ready for review creates the draft. |
Post text | text | The LinkedIn post. |
Image URL | URL | Optional public HTTPS image. |
Approve revision | number | The draft revision a person approves. |
pubnio_revision | number | The draft's current revision, written by the workflow. |
pubnio_media | text | The image URL the draft carries, written by the workflow. |
Set up.
- Create a PubNio API key. In PubNio, create an API key with the publish scope; it includes read, which the status checks use.
- Import the workflow. Download the JSON and import it into n8n with Import from File. It is checked on n8n 2.50.7.
- Add the PubNio credential. Create a Header Auth credential named PubNio API key with name Authorization and value Bearer followed by the key. Select it on Create post in PubNio, Read post status, Import media, Read media status, Read draft, Update draft, Publish approved revision.
- Fill PubNio settings. Open the PubNio settings node and set workspaceId, linkedinAccountId. linkedinAccountId: The LinkedIn account ID from PubNio's list of connected accounts.
- Connect Notion. Add the database properties above and the pubnio_ text fields, then select your Notion credential and the database, shared with your Notion integration, on Read rows, Save key before sending, Write result to row.
- Run one approved test item. Approve one test item, run the workflow once, and read pubnio_status and pubnio_outcome. Then activate it.
Request.
isDraft: true saves the post without sending it. Publishing later is a separate publish request with expectedRevision and its own key, <pubnio_key>-publish-r<revision>. PubNio does not post this network's media from a URL, so the workflow first has PubNio import the page's Image URL, waits for the import to be ready, and sends the media ID it returns.
{
"text": "We are hiring two engineers.",
"accounts": [
"33333333-3333-4333-8333-333333333333"
],
"isDraft": true
}
Tested behavior.
The download is imported unchanged into a clean n8n 2.50.7 container, and its node types, versions, parameters, and operations are checked against that release. Then a copy runs with n8n execute. Its PubNio requests and its Code, If, Switch, and Merge nodes run as published. Its trigger and source nodes are simulated by a fake source with the same row shapes, its media wait is cut to one second, and PubNio is a fake API that decodes every request with PubNio's own schemas and checks it with PubNio's own content rules. PubNio's test suite replays every create and validate request the run sent against the real API and requires the same answer. It proves:
- Only pages marked Ready for review reach PubNio, and only as drafts; nothing is published without an approved revision.
- The key is a hash of the stable row ID, saved on the row with its send time before the request that sends it.
- A lost response (503 after PubNio admitted the post) is resent with the same key and PubNio returns the first post.
- A key with no post ID that was sent 23 hours and 1 minute ago, or has no send time, stops at needs_review instead of being resent.
- A 202 is recorded as queued or scheduled, never as published, until a delivery reports it.
- A Ready page becomes one draft with its image imported and records draft and revision 1; a page in any other status is never sent. An image PubNio cannot fetch rejects the page and clears its key.
- Editing the page text and image sends one update with the new image and expectedRevision: 1, and records revision 2; an approval of revision 1 publishes nothing.
- Approving revision 2 publishes it once with key <pubnio_key>-publish-r2 and expectedRevision: 2; the page records queued, then published with the post URL.
- A draft someone publishes in PubNio itself is recorded with its delivery status and never sent again.
Recovery.
- When pubnio_error says The draft is now revision N: The draft changed in PubNio between the read and the update. Nothing was published; the next run reads it again and updates it from the page.
- When pubnio_status is rejected: Fix the page text or image as pubnio_error says and clear pubnio_status. PubNio stored nothing for the rejected request, so the next run saves the draft again.
- When the page sits at draft: It is waiting for Approve revision to equal pubnio_revision.
Limits.
- Page text only; Notion blocks below the properties are not read.
- Text edits made in PubNio are overwritten by the page text on the next run.
- PubNio has no approval step of its own; approval happens in Notion before n8n calls PubNio.
- The check uses a fake PubNio and fake provider answers, so this page shows no real delivery.
Import it and send one test row.
Connect accounts for free, create an API key, and run the workflow once with one approved item.

