Back to Catalog

Templates by Feras Dabour

Create & share AI videos with Telegram, Gemini & post to TikTok, Instagram, FB

Video Generation with Telegram Bot and Gemini API – Auto-Post to TikTok, Instagram & Facebook This n8n workflow turns your Telegram messenger into a full video content pipeline: you send a text or voice idea to a Telegram bot, collaborate with an AI on the script and caption, let Gemini generate the video, and then automatically publish it to TikTok, Instagram and Facebook – all with status tracking and Telegram confirmations. --- What You Need to Get Started This workflow connects several external services. You’ll need: Telegram Bot API Key Create a bot via Telegram’s BotFather and copy the bot token. This is used by the Listen for incoming events and other Telegram nodes. OpenAI API Key Required for: Speech to Text (OpenAI Whisper) – to transcribe voice notes. The OpenAI Chat Model used inside the AI Agent. Google Gemini / Vertex (via n8n Gemini Node) Used by the Generate a video node (model: veo-3.0-fast-generate-001) to create the video. Google Drive The generated video is temporarily stored in a Google Drive folder via Upload video and later downloaded again for uploading to Blotato. Blotato API Key Social media publishing layer: Uploads the video as media. Creates posts for TikTok, Instagram and Facebook. Exposes a status endpoint the workflow uses for polling. Google Sheets Access (optional but included) Used by Save Prompt & Post-Text to log your prompts and captions. Once these credentials are configured in n8n, the workflow runs end-to-end from Telegram idea to multi-platform publishing. --- How the Workflow Operates – Step by Step Input & Initial Processing (Telegram + Voice Handling) This phase listens to your messages and normalizes them into a single text input for the AI. | Node Name | Role in Workflow | | ------------------------------ | ------------------------------------------------------------------------------------------------------- | | Listen for incoming events | Telegram Trigger node that starts the workflow whenever your bot receives a message (text or voice). | | Voice or Text | Set node that structures the incoming payload and prepares a unified text field for downstream nodes. | | A Voice? | IF node that checks whether the incoming message is a voice note or plain text. | | Get Voice File | If voice is detected, this Telegram node downloads the audio file from Telegram. | | Speech to Text | Uses OpenAI Whisper to convert the voice note into a text transcript. | If you send text: The workflow skips the voice download/transcription and goes directly to the AI agent with your original text. If you send a voice note: The workflow downloads the file, runs it through Whisper in Speech to Text, and passes the resulting transcript onward. The output of this stage is always a clean text string representing your idea. --- AI Core & Approval Loop (Script + Caption via AI) Here the AI designs the video prompt (for Gemini) and the social media caption (for all platforms), then iterates with you until you approve. | Node Name | Role in Workflow | | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | AI Agent | Central logic agent. Takes your idea text and applies the system prompt to create a video prompt and social media caption. Handles revisions based on your feedback. | | OpenAI Chat Model | The LLM backing the agent (OpenAI Chat model). | | Window Buffer Memory | Memory buffer that stores recent turns, so the agent can keep context across your “make it shorter / more fun / more technical” requests. | | Send questions or proposal to user | Telegram node that sends the AI’s suggested prompt + caption back to you for review. | | Approved from user? | IF node that checks whether the agent’s output is the “approved” JSON (meaning you said “ok” / “approved”) or just a normal suggestion. | Video Prompt Assistant System Prompt (Internal Instructions) The AI Agent is configured with a system message like: > You are a video prompt assistant for Telegram. > > 1. Analyze the user’s message and create a video prompt. > 2. Create relevant social media text with hashtags. > 3. Present both to the user and ask for feedback. > 4. If the user requests changes, refine and present again. > 5. Only when the user says “approved” or “ok”, output a final JSON: > { "videoPrompt": "...", "socialMediaText": "..." } Key behavior: Before approval: The agent always responds with human-readable suggestions (prompt + caption) and a follow-up question asking what to change. After approval: The agent returns only JSON (no Markdown, no explanation) with: videoPrompt – to be sent to Gemini. socialMediaText – to be used as a caption on all platforms. JSON Parsing | Node Name | Role in Workflow | | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Parse AI Output | Code node that extracts videoPrompt and socialMediaText from the agent’s output. It is tolerant of different formats (e.g. JSON wrapped in markdown) and throws errors if required fields are missing. | If the AI output is approved JSON, this node returns two clean fields: videoPrompt socialMediaText These are used in all subsequent steps. --- User Feedback & Logging Right after parsing the final JSON, the workflow informs you and logs the content. | Node Name | Role in Workflow | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Inform user about processing | Telegram node that tells you: “Okay. Your video is being prepared now. I’ll let you know as soon as it’s online.” | | Save Prompt & Post-Text | Google Sheets node that appends a new row containing the videoPrompt and socialMediaText to a sheet (e.g., for tracking which prompts/captions you used). | This gives you both visibility (confirmation message) and historical tracking of your content ideas. --- Video Generation with Gemini Now the actual video is created using Google Gemini’s video model. | Node Name | Role in Workflow | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | Generate a video | Gemini node (model models/veo-3.0-fast-generate-001) that uses videoPrompt to generate a vertical video (aspect ratio 9:16). | The videoPrompt from the AI agent is passed directly into this node. The resulting binary output is a generated short-form video suitable for TikTok, Reels and Stories. --- Staging the Video in Google Drive To make the video accessible for Blotato, the workflow uses Google Drive as a simple file staging area. | Node Name | Role in Workflow | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Upload video | Uploads the generated video binary to a specific folder in Google Drive (n8n_videos). The file name is taken from the binary metadata or defaults to video.mp4. | | Download Video from Drive1 | Immediately downloads the uploaded video by file ID, this time as binary data suitable for passing into [Blotato]. | Using Drive ensures that the file is properly hosted and addressable when uploading to [Blotato]’s media API. --- Uploading to [Blotato]and Creating Posts First, the video is sent to [Blotato] as a media asset. Then three separate posts are created for TikTok, Instagram, and Facebook. Media Upload | Node Name | Role in Workflow | | ----------------- | ------------------------------------------------------------------------------------------------------------------------- | | Upload media1 | [Blotato] media node. Uploads the binary video as a media asset and returns a public url used by all post creation nodes. | Platform-Specific Post Creation From the uploaded media, the workflow fans out into three branches: | Node Name | Platform | Role in Workflow | | ------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | Create TikTok post | TikTok | Creates a TikTok post using the media URL and socialMediaText as the caption. Also sets the flag that the video is AI-generated. | | Create post1 | Instagram | Creates an Instagram (or related) post linked to the [Blotato] account (e.g., aimaginate_xx), using the same socialMediaText and media URL. | | Create Facebook post | Facebook Page | Creates a Facebook post on your specified page, again using the shared caption and media URL. | At this point, all three platforms have an initial “post submission” created via [Blotato]. Next, the workflow tracks their publishing status. --- Status Monitoring & Retry Loops Each platform has its own mini-loop that polls [Blotato]) until the post is either published or failed. TikTok Status Loop | Node Name | Role in Workflow | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | Wait | Initial 5-second (or configured) pause after creating the TikTok post. | | Check Post Status | Blotato “get” operation that fetches the current status (published, in-progress, etc.) of the TikTok post by postSubmissionId. | | Published to TikTok? | IF node that checks if status === "published". | | Confirm publishing to Tiktok | Telegram node that notifies you when the TikTok post is live (often including a link or at least a confirmation text). | | In Progress? | IF node that checks if status === "in-progress". | | Give Blotat other 5s :) | Wait node that sleeps a bit before checking again. Feeds back into Published to TikTok? to create a polling loop. | | Send TikTok Error Message | Telegram node that informs you if the status is neither published nor in progress (i.e., a failure). | Instagram Status Loop | Node Name | Role in Workflow | | ----------------------------------- | ------------------------------------------------------------------------------------ | | Wait1 | Wait node after Create post1, giving Blotato time to process the Instagram post. | | Get post1 | Blotato “get” operation to read status of the Instagram post. | | Published to Instagram? | IF node checking if status === "published". | | Confirm publishing to Instagram | Telegram message with confirmation that your Instagram post is live. | | In Progress?1 | IF node checking if status === "in-progress". | | Give Blotat more time | Wait node that loops back to Published to Instagram? for another status check. | | Send Instagram Error Message | Telegram notification if the Instagram post fails. | Facebook Status Loop | Node Name | Role in Workflow | | ---------------------------------- | -------------------------------------------------------------------------------- | | Wait2 | Wait node after Create Facebook post (longer pause, e.g. 30 seconds). | | Get Facebook post | Blotato “get” operation to fetch Facebook post status. | | Published to Facebook? | IF node testing for status === "published". | | Confirm publishing to Facebook | Telegram notification that the Facebook post is online. | | In Progress?2 | IF node checking if the Facebook post is still in progress. | | Give Blotat other 5s :)2 | Wait node that loops back into Published to Facebook? for repeated checks. | | Send Facebook Error Message | Telegram notification if the Facebook post fails or ends in an unexpected state. | This structure ensures that each platform is monitored independently, with clear success or error messages delivered right into your Telegram chat. --- 🛠️ Personalizing Your Video Content Bot The real power of this workflow is how easy it is to adapt it to your own style, platforms, and preferences. Tweak the AI Prompt & Behavior Where: Inside the AI Agent node, in the System Message* (systemMessage) of the options. What you can change: The tone (funny, educational, corporate, storytelling, etc.). The level of detail in the video prompt (camera moves, style, characters, environment). The caption structure (hook, value, CTA, hashtag strategy). Whether the agent should produce multiple variants or just one. You can also extend it, e.g.: Ask for multi-slide carousel prompts instead of a single video. Force language (e.g., always English, always German). Add platform-specific hints (e.g., stronger hooks for TikTok). Change Video Model or Aspect Ratio Where: Generate a video node. Options: Swap the model (within the Gemini node) if you want higher quality or different behavior. Adjust the aspectRatio from 9:16 to 16:9 or 1:1 depending on your target platform. Modify Which Platforms You Post To Where: Blotato nodes: Create TikTok post Create post1 (Instagram) Create Facebook post You can: Disable or delete branches for platforms you don’t use. Add new accounts or platforms supported by Blotato. Use different captions per platform (e.g. shorter for TikTok, more detailed for Facebook) by adding extra AI formatting steps. Adjust Wait Times and Retry Logic Where: Wait and IF nodes: Wait, Wait1, Wait2, Give Blotat other 5s :), Give Blotat more time, Give Blotat other 5s :)2 What: Increase or decrease retry intervals. Limit the number of loops (e.g. by adding a counter) if needed. Customize error messages in the Telegram nodes. Extend Logging & Analytics Where: Save Prompt & Post-Text (Google Sheets). Ideas: Add more columns (timestamp, platform flags, target audience, campaign name). Write back publish status and final URLs after success. Use this sheet as a content inventory or analytics base. --- In short, this workflow gives you a full AI-powered video pipeline: Idea (text/voice) via Telegram Drafting & approval of video prompt + caption via OpenAI agent Video generation with Gemini (veo) Staging in Google Drive Auto-posting and status monitoring across TikTok, Instagram & Facebook via Blotato All communication and confirmations returned directly to Telegram And everything is fully editable so you can adapt it precisely to your personal brand and content strategy.

Feras DabourBy Feras Dabour
1283

Generate AI photos with Gemini & auto-post to FB, Instagram & X with approval

Social Media Foto Creation Bot with Approval Loop Create & Share AI Photos with Telegram, Gemini & Post to Facebook, Instagram & X Description This n8n workflow turns your Telegram messenger into a complete AI Photo Content Pipeline. You send your photo idea as a text or voice message to a Telegram bot, collaborate with an AI to refine the prompt and social media caption, let Gemini generate the image, and then automatically publish it after your approval to Facebook, Instagram, and X (Twitter) – including status tracking and Telegram confirmations. --- What You Need to Get Started This workflow connects several external services. You will need the following credentials: Telegram Bot API Key Create a bot via BotFather and copy the bot token. This is used by the Listen for incoming events and other Telegram nodes. OpenAI API Key Required for Speech to Text (OpenAI Whisper) to transcribe voice notes. Used by the AI Agent model (OpenAI Chat Model) for prompt creation. Google Gemini API Key Used by the Generate an image node (model: models/gemini-2.5-flash-image) to create the AI image. Google Drive & Sheets Access The generated image is temporarily stored in a Google Drive folder (Upload image1) and later retrieved by Blotato. Prompts and post texts are logged to Google Sheets (Save Prompt & Post-Text) for tracking. Blotato API Key The layer for social media publishing. Uploads the image as a media asset (Upload media1) and creates posts for Facebook, Instagram, and X. --- How the Workflow Operates – Step by Step Input & Initial Processing (Telegram + Voice Handling) This phase receives your messages and prepares the input for the AI. | Node Name | Role in Workflow | | :--- | :--- | | Listen for incoming events | Telegram Trigger node that starts the workflow on any incoming message. | | Voice or Text | Set node that structures the incoming message into a unified text field. | | A Voice? | IF node that checks if the message is a voice note. | | Get Voice File | If voice is detected, this downloads the audio file from Telegram. | | Speech to Text | Uses OpenAI Whisper to convert the voice note into a text transcript. | The output of this stage is always a clean text string containing your image idea. AI Core & Refinement Loop (Prompt + Caption via AI) Here, the AI drafts the image prompt (for Gemini) and the social media caption (for all platforms) and enters an approval loop with you. | Node Name | Role in Workflow | | :--- | :--- | | AI Agent | Central logic agent. Creates a videoPrompt (used for image generation) and socialMediaText based on your idea, and asks for feedback. | | OpenAI Chat Model | The LLM backing the agent (e.g., GPT-4.1-mini). | | Window Buffer Memory | Stores recent turns, allowing the agent to maintain context during revisions. | | Send questions or proposal to user | Sends the AI's suggestion for review back to you. | | Approved from user? | IF node that checks if the output is the approved JSON (meaning you replied with "ok" or "approved"). | | Parse AI Output | Code node that extracts the videoPrompt and socialMediaText fields from the agent’s final JSON output. | Content Generation & Final Approval Once the prompt and caption are set, the image is created and sent to you for final approval before publishing. | Node Name | Role in Workflow | | :--- | :--- | | Inform user about processing | Telegram node to confirm: "Okay. Your image is being prepared now..." | | Save Prompt & Post-Text | Google Sheets node that logs the videoPrompt and socialMediaText. | | Generate an image | Gemini node that creates the image based on the videoPrompt. | | Send a photo message | Sends the generated image to Telegram for review. | | Send message and wait for response | Telegram node that waits for your response to the image (e.g., "Good?" / "Approve"). | | Upload image1 | Temporarily saves the generated image to Google Drive. | | Download image from Drive | Downloads the image back from Drive. | | If1 | IF node that checks if the image was approved in the previous step (approved == true). | Upload & Publishing (Blotato) After final approval, the image is uploaded to Blotato, and post submissions for the social media platforms are created. | Node Name | Role in Workflow | | :--- | :--- | | Upload media1 | Blotato Media node. Uploads the approved image as a media asset and returns a public url. | | Create instagram Post | Creates an Instagram post using the media URL and socialMediaText. | | Create x post | Creates an X (Twitter) post using the media URL and socialMediaText. | | Create FB post | Creates a Facebook post using the media URL and socialMediaText. | Status Monitoring & Retry Loops (X, Facebook, Instagram) An independent loop runs for each platform, polling Blotato until the post is either published or failed. | Node Name | Role in Workflow | | :--- | :--- | | Wait, Wait1, Wait2 | Initial pauses after post creation. | | Check Post Status, Get post1, Check Post Status1 | Blotato Get operations to fetch the current status of the post. | | Published to X?, Published to Facebook?, Published to Instagram? | IF nodes checking for the "published" status. | | Confirm publishing to X, Confirm publishing to Facebook, Confirm publishing to Instagram | Telegram nodes that notify you of successful publication (often including the post link). | | In Progress?, In Progress?1, In Progress?2 | IF nodes that check for "in-progress" status and loop back to the Wait nodes (Give Blotat other 5s). | | Send X Error Message, Send Facebook Error Message, Send Instagram Error Message | Telegram nodes that notify you if a failure occurs. | --- 🛠️ Personalizing Your Content Bot The workflow is highly adaptable to your personal brand and platform preferences: Tweak the AI Prompt & Behavior: Where: In the AI Agent node, within the System Message. Options: Change the tone (casual, professional, humorous) and the level of detail required for the prompt generation or the social media captions. Change Gemini Model or Image Options: Where: In the Generate an image node. Options: Swap the model or adjust image options like Aspect Ratio or Style based on Gemini's API capabilities. Modify Which Platforms You Post To: Where: In the Blotato nodes: Create instagram Post, Create x post, Create FB post. Options: Disable or delete branches for unused platforms, or add new platforms supported by Blotato.

Feras DabourBy Feras Dabour
671

Auto create & publish X-threads (Twitter) with GPT via Telegram & approval loop

AI X (twitter) Threads Bot with Approval Loop This n8n workflow transforms your Telegram messenger into a personal assistant for creating and publishing X-Threads. You can simply send an idea as a text or voice message, collaboratively edit the AI’s suggestion in a chat, and then publish the finished thread directly to X just by saying “Okay.” What You’ll Need to Get Started Before you can use this workflow, you’ll need a few prerequisites set up. This workflow connects three different services, so you will need API credentials for each: Telegram Bot API Key: You can get this by talking to the “BotFather” on Telegram. It will guide you through creating your new bot and provide you with the API token. New Chat with Telegram BotFather OpenAI API Key: This is required for the “Speech to Text” and “AI Agent” nodes. You’ll need an account with OpenAI to generate this key. OpenAI API Platform Blotato API Key: This service is used to publish the final post to X. You’ll need a Blotato account and to connect your X profile there to get the key. Blotato platform for social media publishing Once you have these keys, you can add them to the corresponding credentials in your n8n instance. How the Workflow Operates, Step-by-Step Here is a detailed breakdown of how the workflow processes your request and handles the publishing. Input & Initial Processing This phase captures your idea and converts it into usable text. Node Name Role in Workflow Start: Telegram Message This Telegram Trigger node initiates the entire process upon receiving any message from you in the bot. Prepare Input Consolidates the message content, ensuring the AI receives only one clean text input. Check: ist it a Voice? Checks the incoming message for text. If text is empty, it proceeds to voice handling. Get Voice File If a voice note is detected, this node downloads the raw audio file from Telegram. Speech to Text This node uses the OpenAI Whisper API to convert the downloaded audio file into a text string. AI Core & Iteration Loop This is the central dialogue system where the AI drafts the content and engages in the feedback loop. AI: Draft & Revise Post The main logic agent. It analyzes your request, applies the “System Prompt” rules, drafts the post, and handles revisions based on your feedback. OpenAI Chat Model Defines the large language model (LLM) used for generating and revising the post. Window Buffer Memory A memory buffer that stores the last turns of the conversation, allowing the AI to maintain context when you request changes (e.g., “Make it shorter”). Check if Approved This crucial node detects the specific JSON structure the AI outputs only when you provide an approval keyword (like “ok” or “approved”). Post Suggestion Or Ask For Approval Sends the AI’s post draft back to your Telegram chat for review and feedback. AI Agent System Prompt (Internal Instructions - English) The agent operates under a strict prompt that dictates its behavior and formatting (found within the AI: Draft & Revise Post node. Publishing & Status Check Once approved, the workflow handles the publication and monitors the post’s status in real-time. Node Name Role in Workflow Approval: Extract Final Thread Posts Parses the incoming JSON, extracting only the clean text ready for publishing. Create post with Blotato Uses the Blotato API to upload the finalized content to your connected X account. Give Blotat 5s :) A brief pause to allow the publishing service to start processing the request. Check post status Checks back with Blotato to determine if the post is published, in progress, or failed. Published? Checks if the status is “published” to send the success message. In Progress? Checks if the post is still being processed. If so, it loops back to the next wait period. Give Blotat other 5s :) Pauses the workflow before re-checking the post status, preventing unnecessary API calls. Final Notification Node Name Role in Workflow Send a confirmation message Sends a confirmation message and the direct link to the published X post. Send an error message Sends a notification if the post failed to upload or encountered an error during processing. 🛠️ Personalizing Your Content Bot The true power of this n8n workflow lies in its flexibility. You can easily modify key components to match your unique brand voice and technical preferences. Tweak the Content Creator Prompt The personality, tone, and formatting rules for your X content are all defined in the System Prompt. Where to find it: Inside the AI: Draft & Revise Post node, under the System Message setting. What to personalize: Adjust the tone, change the formatting rules (e.g., number of hashtags, required emojis), or insert specific details about your industry or target audience. Switch the AI Model or Provider You can easily swap the language model used for generation. Where to find it: The OpenAI Chat Model node. What to personalize: Model: Swap out the default model for a more powerful or faster alternative (e.g., gpt-4 family, or models from other providers if you change the node). Provider: You can replace the entire Langchain block (including the AI Model and Window Buffer Memory nodes) with an equivalent block using a different provider’s Chat/LLM node (e.g., Anthropic, Cohere, or Google Gemini), provided you set up the corresponding credentials and context flow. Modify Publishing Behavior (Schedule vs. Post) The final step is currently set to publish immediately, but you might prefer to schedule posts. Where to find it: The Create post with Blotato node. What to personalize: Consult the Blotato documentation for alternative operations. Instead of choosing the “Create Post” operation (which often posts immediately), you can typically select a “Schedule Post” or “Add to Queue” operation within the Blotato node. If scheduling, you will need to add a step (e.g., a Set node or another agent prompt) before publishing to calculate and pass a Scheduled Time parameter to the Blotato node.

Feras DabourBy Feras Dabour
311

Extract & organize email invoices with Gmail, Drive & OpenAI GPT

Who’s it for This template is for founders, finance teams, and solo operators who receive lots of invoices by email and want them captured automatically in a single, searchable source of truth. If you’re tired of hunting through your inbox for invoice PDFs or “that one receipt from three months ago,” this is for you. What it does / How it works The workflow polls your Gmail inbox on a schedule and fetches new messages including their attachments. A JavaScript Code node restructures all attachments, and a PDF extraction node reads any attached PDFs. An AI “Invoice Recognition Agent” then analyzes the email body and attachments to decide whether the email actually contains an invoice. If not, the workflow stops. If it is an invoice, a second AI “Invoice Data Extractor” pulls structured fields such as dateemail, dateinvoice, invoicenr, description, provider, netamount, vat, gross_amount, label (saas/hardware/other), and currency. Depending on whether the invoice is in an attachment or directly in the email text, the workflow either: uploads the invoice file to Google Drive, or document a direct link to the mail, then appends/updates a row in Google Sheets with all invoice parameters plus a Drive link, and finally marks the Gmail message as read. How to set up Add and authenticate: Gmail credentials Google Sheets credentials Google Drive credentials OpenAI (or compatible) credentials for the AI nodes Create or select a Google Sheet with the expected columns (dateemail, dateinvoice, invoicenr, description, provider, netamount, vat, gross_amount, label, currency, link). Create or select a Google Drive folder where invoices/docs should be stored. Adjust the Gmail Trigger filters (labels, search query, polling interval) to match the mailbox you want to process. Update node credentials and resource IDs (Sheet, Drive folder) via the node UIs, not hardcoded in HTTP nodes. Requirements n8n instance (cloud or self-hosted) Gmail account with OAuth2 setup Google Drive and Google Sheets access OpenAI (or compatible) API key configured in n8n Sufficient permissions to read emails, read/write Drive files, and edit the target Sheet How to customize the workflow Change invoice categories: Extend the label enum (e.g., add “services”, “subscriptions”) in the extraction schema and adjust any downstream logic. Refine invoice detection: Tweak the AI prompts to be more or less strict about what counts as an invoice or receipt. Add notifications: After updating the Sheet, send a Slack/Teams message or email summary for high-value invoices. Filter by sender or subject: Narrow the Gmail Trigger to specific vendors, labels, or keywords. Extend the data model: Add fields (e.g., cost center, project code) to the extractor prompt and Sheet mapping to fit your bookkeeping setup.

Feras DabourBy Feras Dabour
290

Create LinkedIn content with GPT-4 via Telegram bot & approval loop

AI LinkedIn Content Bot with Approval Loop This n8n workflow transforms your Telegram messenger into a personal assistant for creating and publishing LinkedIn posts. You can simply send an idea as a text or voice message, collaboratively edit the AI's suggestion in a chat, and then publish the finished post directly to LinkedIn just by saying "Okay." What You'll Need to Get Started Before you can use this workflow, you'll need a few prerequisites set up. This workflow connects three different services, so you will need API credentials for each: Telegram Bot API Key: You can get this by talking to the "BotFather" on Telegram. It will guide you through creating your new bot and provide you with the API token. New Chat with Telegram BotFather OpenAI API Key: This is required for the "Speech to Text" and "AI Agent" nodes. You'll need an account with OpenAI to generate this key. [OpenAI API Platform](https://platform.openai.com ) Blotato API Key: This service is used to publish the final post to LinkedIn. You'll need a Blotato account and to connect your LinkedIn profile there to get the key. [Blotato platform for social media publishing] Once you have these keys, you can add them to the corresponding credentials in your n8n instance. ----- How the Workflow Operates, Step-by-Step Here is a detailed breakdown of how the workflow processes your request and handles the publishing. 1\. Input & Initial Processing This phase captures your idea and converts it into usable text. | Node Name | Role in Workflow | | :--- | :--- | | Start: Telegram Message | This Telegram Trigger node initiates the entire process upon receiving any message from you in the bot. | | Prepare Input | Consolidates the message content, ensuring the AI receives only one clean text input. | | Check: ist it a Voice? | Checks the incoming message for text. If text is empty, it proceeds to voice handling. | | Get Voice File | If a voice note is detected, this node downloads the raw audio file from Telegram. | | Speech to Text | This node uses the OpenAI Whisper API to convert the downloaded audio file into a text string. | 2\. AI Core & Iteration Loop This is the central dialogue system where the AI drafts the content and engages in the feedback loop. | Node Name | Role in Workflow | | :--- | :--- | | AI: Draft & Revise Post | The main logic agent. It analyzes your request, applies the "System Prompt" rules, drafts the post, and handles revisions based on your feedback. | | OpenAI Chat Model | Defines the large language model (LLM) used for generating and revising the post. | | Window Buffer Memory | A memory buffer that stores the last turns of the conversation, allowing the AI to maintain context when you request changes (e.g., "Make it shorter"). | | Check if Approved | This crucial node detects the specific JSON structure the AI outputs only when you provide an approval keyword (like "ok" or "approved"). | | Post Suggestion Or Ask For Approval | Sends the AI's post draft back to your Telegram chat for review and feedback. | AI Agent System Prompt (Internal Instructions - English) The agent operates under a strict prompt that dictates its behavior and formatting (found within the AI: Draft & Revise Post node): > You are a LinkedIn Content Creator Agent for Telegram. > Keep the confirmation process, but change the output format as follows: > > Your Task > Analyze the user's message: > > * Topic > * Goal (e.g., reach, show expertise, recruiting, personal branding, leads) > * Target Audience > * Tonality (e.g., factual, personal, bold, inspiring) > > Create a LinkedIn post as ONE continuous text: > > * Strong hook in the first 1–2 lines. > * Clear main part with added value, story, example, or insight. > * Optional Call-to-Action (e.g., question to the community, invitation to exchange). > * Integrate hashtags at the end of the post (5–12 suitable hashtags, mix of niche + somewhat broader). > * Readable on LinkedIn: short paragraphs, emojis only sparingly. > > Present the suggestion to the user in the following format: > > Headline: Post Proposal: > Below that, the complete LinkedIn post (incl. hashtags at the end in the same text). > > Ask for feedback: > For example: > "Any changes? (Tone, length, formality, personal vs. professional, more technical content, different hashtags?)" > > If the user requests changes: > Adjust the post specifically based on the feedback. > Again, output only: > Post Proposal: > the revised complete post. > > If the user says “approved”, “ok”, “sounds good”, or similar: > Return exclusively this JSON, without additional text, without Markdown: > > json > { > "Post": "The final LinkedIn post as one text, including hashtags at the end" > } > > > Important: > > * Never output JSON before approval, only normal suggestion text. > * The final output after approval consists of only one field: Post. 3\. Publishing & Status Check Once approved, the workflow handles the publication and monitors the post's status in real-time. | Node Name | Role in Workflow | | :--- | :--- | | Approval: Extract Final Post Text | Parses the incoming JSON, extracting only the clean text ready for publishing. | | Create post with Blotato | Uses the Blotato API to upload the finalized content to your connected LinkedIn account. | | Give Blotat 5s :) | A brief pause to allow the publishing service to start processing the request. | | Check post status | Checks back with Blotato to determine if the post is published, in progress, or failed. | | Published? | Checks if the status is "published" to send the success message. | | In Progress? | Checks if the post is still being processed. If so, it loops back to the next wait period. | | Give Blotat other 5s :) | Pauses the workflow before re-checking the post status, preventing unnecessary API calls. | 4\. Final Notification | Node Name | Role in Workflow | | :--- | :--- | | Send a confirmation message | Sends a confirmation message and the direct link to the published LinkedIn post. | | Send an error message | Sends a notification if the post failed to upload or encountered an error during processing. | ----- 🛠️ Personalizing Your Content Bot The true power of this n8n workflow lies in its flexibility. You can easily modify key components to match your unique brand voice and technical preferences. 1\. Tweak the Content Creator Prompt The personality, tone, and formatting rules for your LinkedIn content are all defined in the System Prompt. Where to find it: Inside the AI: Draft & Revise Post node, under the System Message setting. What to personalize: Adjust the tone, change the formatting rules (e.g., number of hashtags, required emojis), or insert specific details about your industry or target audience. 2\. Switch the AI Model or Provider You can easily swap the language model used for generation. Where to find it: The OpenAI Chat Model node. What to personalize: Model: Swap out the default model for a more powerful or faster alternative (e.g., gpt-4 family, or models from other providers if you change the node). Provider: You can replace the entire Langchain block (including the AI Model and Window Buffer Memory nodes) with an equivalent block using a different provider's Chat/LLM node (e.g., Anthropic, Cohere, or Google Gemini), provided you set up the corresponding credentials and context flow. 3\. Modify Publishing Behavior (Schedule vs. Post) The final step is currently set to publish immediately, but you might prefer to schedule posts. Where to find it: The Create post with Blotato node. What to personalize: Consult the Blotato documentation for alternative operations. Instead of choosing the "Create Post" operation (which often posts immediately), you can typically select a "Schedule Post" or "Add to Queue" operation within the Blotato node. If scheduling, you will need to add a step (e.g., a Set node or another agent prompt) before publishing to calculate and pass a Scheduled Time parameter to the Blotato node.

Feras DabourBy Feras Dabour
155
All templates loaded