See llms.txt for all machine-readable content.

Back to Templates

Create and review AI social media images with Telegram, OpenAI and Google Drive

Quick overview

Create two social image drafts from a private Telegram brief and an optional own photo. Approve the displayed estimate, inspect previews, optionally confirm one revision, and save the selected original with your supplied factual caption in private Google Drive. No social publishing occurs.

How it works

  1. Accepts only allowlisted users in matching private Telegram chats. A preflight rejects albums, unsupported file types and unknown or oversized declared attachments before downloading one PNG/JPEG with the native Telegram file node. Actual downloaded bytes are checked again.
  2. Saves the structured brief, confirmed facts and exact user caption in an n8n Data Table. If the user provides no caption, the workflow joins supplied facts deterministically; it does not generate a text caption.
  3. A worker shows the two-image estimate and waits for explicit owner approval before any paid image request.
  4. After approval, OpenAI generates two images or edits one permitted reference image. The worker checks PNG structure, dimensions and byte limits.
  5. Preallocated private Google Drive files are verified by metadata and original-byte readback before the bot sends Telegram previews.
  6. Owner- and version-bound buttons select one inspected original or request one separately priced revision. Each job produces at most three images; old buttons cannot approve a new version.
  7. Final selection binds the original image and caption hashes. The worker verifies folder privacy, writes and reads back a private review manifest, and sends the selected file links.
  8. Compare-and-swap state updates protect reserved operations. Ambiguous provider responses are held without an automatic paid retry; the Google Sheets RAW activity log mirrors status only.

Setup

  1. Import demo.json first and download its real synthetic PNG demonstration ZIP. These files are artificial fixtures, not OpenAI-generated examples. Run setup.json once with Google Sheets and Drive OAuth to create a dedicated activity spreadsheet, private My Drive folder and native Data Table.
  2. Copy returned spreadsheet, private folder and Data Table IDs into BOTH main configuration nodes. Set identical numeric Telegram private user/chat allowlists in both nodes.
  3. Bind the same Telegram bot credential to the Trigger and every Telegram node, including file download. Keep native Telegram Trigger 1.3 secret-token verification and disable automatic file download.
  4. Bind OpenAI to the image HTTP node and Google OAuth to Drive and Sheets. Use a reachable HTTPS webhook; leave workerEnabled and generationEnabled off until configured.
  5. Set the image model, size, quality, current positive per-image estimates and three-output maximum estimate consistently in both configurations.
  6. Run the worker manually or enable its 15-second schedule. Send a private /new request, approve the displayed scope, inspect previews and use only current buttons. Each worker execution advances one saved operation.

Requirements

  • n8n 2.28.6 with native Data Tables and built-in Telegram/HTTP/Code nodes; separate Telegram bot and public HTTPS webhook; numeric allowlisted private user/chat IDs; OpenAI image API access; Google Sheets and Drive OAuth with an owner-only My Drive folder. Provider usage and hosting are separate. One PNG/JPEG input up to2,000,000 bytes, two initial drafts and one optional separately approved revision. No live Telegram, paid image, Google delivery or n8n Cloud test is claimed.

Customization

  • Set private allowlists, dedicated resource IDs, factual brief/caption, current estimates, square1024x1024 or portrait1024x1536 output, and low/medium/high quality in BOTH configurations. The configured V1 image contract is gpt-image-2.5-flare; a different model or API contract requires documentation checks and retesting. Use manual steps or the fifteen-second worker. Keep the deterministic caption, three-output cap and version binding. Review Data Table, Drive and execution retention separately.

Additional info

No social content is published. AI images may change product identity, logo, color or text; inspect originals before final selection. Estimates are not guaranteed provider billing limits. /status JOB shows progress; /abandon JOB VERSION I_ACCEPT_UNKNOWN_BILLING changes local state without canceling, refunding or retrying provider work. Two-active-job admission is best effort; maintain the hundred-row register and native Data Table storage. Local fixtures/mocks do not prove real service access. The release owner records final local test and annotation evidence separately.