See llms.txt for all machine-readable content.

Back to Templates

Plan and publish LinkedIn posts from Google Sheets with OpenRouter and Telegram

Last update

Last update 6 hours ago

Categories

Share


Quick Overview

This workflow runs daily to publish scheduled LinkedIn posts from a Google Sheets content calendar, drafting copy with OpenRouter and generating an image with OpenAI before publishing via upload-post, while sending approval requests, failure alerts, and a daily digest to Telegram.

How it works

  1. Runs every day at 09:00 (cron) and reads rows from a Google Sheets post calendar.
  2. Filters the sheet for rows that are Approved, scheduled for today, and not already Published, and processes each due post one at a time.
  3. Loads brand guidelines from a separate Google Sheets tab and uses OpenRouter (with a fallback model) to draft LinkedIn post copy in a structured JSON format.
  4. Uses OpenAI to generate a black-and-white post image based on the drafted copy, uploads it to imgbb, and then hosts the photo for LinkedIn using the upload-post API.
  5. Publishes the post to LinkedIn via upload-post, marking the row as Published in Google Sheets on success.
  6. If publishing returns an error, sends an admin alert to Telegram and updates the Google Sheets row status to Error.
  7. Sends Telegram messages to request manager review for rows marked pending_review and posts a daily Telegram digest with the number of published posts.

Setup

  1. Connect credentials for Google Sheets, OpenRouter, OpenAI, Telegram, imgbb (HTTP query auth), upload-post, and SMTP email.
  2. Update the Google Sheets document and sheet/tab URLs for both the post calendar and the brand guide to point to your own spreadsheets.
  3. Ensure your calendar sheet includes columns like id, Date Scheduled (dd/MM/yyyy), Topic, and Status, and use Status values Approved, pending_review, Published, and Error.
  4. Set the environment variables MANAGER_TELEGRAM_CHAT_ID, ADMIN_TELEGRAM_CHAT_ID, and ALERT_EMAIL used by the Telegram and email alert steps.
  5. Verify the upload-post request parameters (user, visibility, and LinkedIn platform) and the imgbb upload settings match your accounts and desired publishing behavior.