{"product_id":"n8n-workflow-post-scheduled-threads-updates-from-postgresql-queue","title":"n8n Workflow: Post Scheduled Threads Updates from PostgreSQL Queue","description":"\u003ch3\u003eAuto-publish scheduled Threads updates from your PostgreSQL queue—every 4 hours\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow automatically checks your PostgreSQL content queue for the next \u003cstrong\u003escheduled\u003c\/strong\u003e post and publishes it to \u003cstrong\u003eThreads\u003c\/strong\u003e via the Threads Graph API. After publishing, it updates the same database record to mark the content as \u003cstrong\u003epublished\u003c\/strong\u003e and stores the publish timestamp.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSchedules execution every four hours\u003c\/strong\u003e using an n8n Schedule Trigger.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eQueries PostgreSQL\u003c\/strong\u003e for the oldest record where \u003ccode\u003estatus\u003c\/code\u003e is \u003ccode\u003escheduled\u003c\/code\u003e, returning \u003ccode\u003epost_text\u003c\/code\u003e and optional \u003ccode\u003eimage_url\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eStops if no queued content is found\u003c\/strong\u003e, preventing empty Threads posts.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates a Threads post container\u003c\/strong\u003e using the Threads Graph API:\n    \u003cul\u003e\n      \u003cli\u003eUses \u003cstrong\u003eIMAGE\u003c\/strong\u003e when \u003ccode\u003eimage_url\u003c\/code\u003e is present.\u003c\/li\u003e\n      \u003cli\u003eUses \u003cstrong\u003eTEXT\u003c\/strong\u003e otherwise.\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePublishes the created container\u003c\/strong\u003e through the Threads Graph API.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates PostgreSQL\u003c\/strong\u003e to set \u003ccode\u003estatus\u003c\/code\u003e to \u003ccode\u003epublished\u003c\/code\u003e and stores \u003ccode\u003epublished_at\u003c\/code\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomate a content calendar for a brand: queue posts in PostgreSQL and publish to Threads on schedule.\u003c\/li\u003e\n  \u003cli\u003eSaaS operators managing social distribution: centralize drafting\/scheduling in a database, then publish automatically.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers standardizing publishing pipelines: keep one queue and let n8n handle Threads delivery.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNode\/stack:\u003c\/strong\u003e Schedule Trigger, IF, PostgreSQL, HTTP Request, Sticky Note.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgreSQL table expectation:\u003c\/strong\u003e \u003ccode\u003econtent_queue\u003c\/code\u003e with columns \u003ccode\u003eid\u003c\/code\u003e, \u003ccode\u003epost_text\u003c\/code\u003e, \u003ccode\u003eimage_url\u003c\/code\u003e, \u003ccode\u003estatus\u003c\/code\u003e, \u003ccode\u003escheduled_at\u003c\/code\u003e, \u003ccode\u003epublished_at\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eThreads integration:\u003c\/strong\u003e Replace \u003ccode\u003eYOUR_THREADS_ACCESS_TOKEN\u003c\/code\u003e in both HTTP requests with a valid Threads access token with publish permission.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDatabase logic:\u003c\/strong\u003e fetches the next \u003cem\u003eoldest\u003c\/em\u003e \u003ccode\u003escheduled\u003c\/code\u003e item, publishes, then updates status and timestamp.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46086632014003,"sku":"N8N-19927","price":58.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/HhkSIA2KjmNnz2BAl_Noc_zl2Uj9G0.png?v=1790326836","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-post-scheduled-threads-updates-from-postgresql-queue","provider":"N8N Commerce","version":"1.0","type":"link"}