Quick Overview
This workflow collects an Instagram post request via an authenticated n8n form, uses Google Gemini to draft a caption from a submitted image and verified facts, sends the draft to Telegram for human approval, and publishes to Instagram via the Facebook Graph API only after approval.
How it works
- Receives a post request through an authenticated n8n form with a public HTTPS image URL, product name, verified facts, and an optional call to action.
- Validates the submission and downloads the image file from the provided URL.
- Sends the image and a guarded prompt to Google Gemini to generate a JSON draft containing a caption, five hashtags, a confidence score, and any risks.
- Applies deterministic checks (caption length, product-name inclusion, minimum confidence, banned phrases, risk flags, and exactly five unique hashtags) to decide whether the draft is eligible for review.
- If the draft passes, sends it to Telegram with a private approval link and pauses until a reviewer approves or rejects it.
- If approved, creates an Instagram media container and polls the Instagram Graph API until processing finishes.
- Publishes the post to Instagram, fetches the permalink, and confirms publication in Telegram, or reports rejection/processing delays back to Telegram without publishing.
Setup
- Configure Basic Auth for the request form and publish the workflow so requesters can access the production form URL.
- Add credentials for Google Gemini, Telegram, and Facebook Graph API (Meta) to the corresponding nodes.
- Update the brand settings, Telegram chat ID, Instagram user ID, Graph API version, model name, and moderation rules in the "Configure Brand and Channels" step.
- Use an Instagram professional account connected to a Facebook Page and ensure the submitted image URL is a publicly reachable HTTPS JPG/PNG/WebP that stays accessible while Meta processes the media container.