Quick Overview
This workflow runs hourly to read the next pending post from Google Sheets, publishes it to Threads via the Threads Graph API, and then updates the sheet with published or failed status plus timestamps and error details.
How it works
- Runs every hour on a schedule.
- Reads the first row in Google Sheets (Sheet1) where the status column equals pending.
- Retrieves the authenticated Threads account’s user ID from the Threads Graph API.
- Creates a Threads text post container using the content from the pending Google Sheets row.
- Publishes the post to Threads and updates the same Google Sheets row as published with posted_at and updated_at timestamps.
- If any Threads API call fails, records the error message and marks the corresponding Google Sheets row as failed with an updated_at timestamp.
Setup
- Create a Meta app and generate a Threads access token, then add it to an HTTP Header Auth credential used for the Threads Graph API requests.
- Set up a Google Sheets Service Account credential in n8n and share your target spreadsheet with the service account email.
- Replace the placeholder Google Sheet ID in all Google Sheets nodes and confirm the sheet name is Sheet1 (or update it to match your sheet).
- Ensure your sheet has the required columns (row_number, content, status, posted_at, updated_at, error_message) and set status to pending for posts you want published.