Publish scheduled LinkedIn posts from Twenty CRM via Unipile and SharePoint

Go to Workflow
5 views
Built by Swapnil Mandloi Swapnil Mandloi
Created on July 28, 2026

Description

Quick overview
Automate your LinkedIn content calendar. This workflow fetches scheduled posts from a PostgreSQL database (Twenty CRM), downloads attached media from SharePoint, and publishes them seamlessly to LinkedIn using Unipile.

How it works
A Schedule Trigger (Cron) fires every 5 minutes to check for pending social media posts
A PostgreSQL node queries the database to fetch posts marked as 'SCHEDULED' where the scheduled time has passed.
A Split In Batches node loops through the fetched posts one by one to prevent API concurrency issues.
An IF node checks if there is a SharePoint attachment URL included in the database record.
If an attachment exists, Microsoft Graph API nodes resolve the SharePoint Drive Item and download the image as a binary file
HTTP Request nodes send the text (and binary attachment, if any) to Unipile's API to natively publish the LinkedIn post.
A final PostgreSQL node updates the CRM record to 'POSTED' and saves the live LinkedIn post URL back to the database.

Setup
Add your PostgreSQL credentials and verify that the SQL query matches your Twenty CRM table and schema names.
Connect your Microsoft Entra ID (Azure AD) account to authenticate SharePoint access.
Configure the HTTP Request nodes with your Unipile Account ID and API keys via HTTP Header Auth.
Activate the workflow to allow the 5-minute cron trigger to run continuously in the background.

Requirements
PostgreSQL database (Twenty CRM) , Unipile Account (with an active LinkedIn session),Microsoft Entra ID / SharePoint Account

Customization
Adjust the LIMIT 10 in the initial SQL query if you want to process more or fewer posts per batch.Replace the SharePoint nodes with Google Drive or AWS S3 nodes if you store your post attachments elsewhere.

Nodes Used (3)

Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest
Postgres
n8n-nodes-base.postgres