Google Sheets to Instagram: n8n template with row approval
This n8n workflow reads a Google Sheet every 15 minutes and sends each row whose approved box is ticked to Instagram through PubNio, at the row's publish_at time or now. It saves an idempotency key on the row before sending, so a rerun after a timeout replays PubNio's first answer instead of posting again.
What it does.
- Trigger. A Schedule Trigger every 15 minutes reads every row of one sheet.
- Approval. Tick the row's approved checkbox. Unticked rows are never sent or written.
- Request. One create request per approved item. 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: Sheet columns.
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 |
|---|---|---|
id | text | Unique per row and never reused; it seeds the idempotency key. |
approved | checkbox | TRUE sends the row. |
caption | text | The Instagram caption. |
image_url | URL | A public HTTPS image; Instagram feed posts need media. |
publish_at | text | Optional ISO 8601 time with an offset, e.g. 2026-12-08T09:00:00+01:00. Empty publishes now. |
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.
- Fill PubNio settings. Open the PubNio settings node and set workspaceId.
- Connect Google Sheets. Add the sheet columns above and the pubnio_ text fields, then select your Google Sheets credential and the same spreadsheet and sheet 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.
platforms: ["instagram"] lets PubNio pick the workspace's one ready Instagram account; publish_at becomes scheduledAt.
{
"text": "Spring drop is here. Link in bio.",
"platforms": [
"instagram"
],
"media": [
{
"url": "https://cdn.example.com/spring.jpg"
}
],
"scheduledAt": "2026-12-08T09:00:00+01:00"
}
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 approved items are sent to PubNio.
- 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 row with publish_at records scheduled and the time in pubnio_outcome, not published.
- publish_at is sent unchanged as scheduledAt and image_url as media[0].url: PubNio posts Instagram media from a URL, so nothing is imported.
- A row without an image is rejected with media_required at targets.0.media, then accepted once image_url is filled.
Recovery.
- When pubnio_status is rejected and pubnio_error names media_required or a media_* issue: Fix image_url and clear pubnio_status. PubNio stored nothing for the rejected request, so the next run sends the row again.
- When pubnio_status stays scheduled: Nothing to do: the next runs read the post until Instagram confirms it.
Limits.
- One Instagram account per workspace: with two connected, platforms is ambiguous and PubNio rejects the row; switch to accounts with an account ID.
- Feed posts only. Reels, Stories, and carousels need a targets body with a placement, which this template does not build.
- PubNio has no approval step of its own; approval happens in Google Sheets 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.

