# Publish LinkedIn & X posts with Telegram Bot and Gemini: n8n workflow

> Started by an incoming Telegram message, and works across Telegram and in-memory vectors. It puts Gemini behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/publish-linkedin-and-x-posts-with-telegram-bot-and-gemini (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Publish LinkedIn & X posts with Telegram Bot and Gemini

Started by an incoming Telegram message, and works across Telegram and in-memory vectors. It puts Gemini behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 28 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fpublish-linkedin-and-x-posts-with-telegram-bot-and-gemini)

**28 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 7 Logic 8 Service 12

The steps in the order they run, from what starts it.

- 1 **Telegram Trigger** Telegram trigger *Starts it*
- 2 **Google Gemini Chat Model** Lm Chat Google Gemini *Model*
- 3 **Embeddings Google Gemini** Embeddings Google Gemini *Model*
- 4 **Create X (Twitter) post** Twitter Tool *Service*
- 5 **Simple Memory** Memory Buffer Window *Model*
- 6 **Create post in LinkedIn as a company** Linked In Tool *Service*
- 7 **Create post in LinkedIn as a person** Linked In Tool *Service*
- 8 **Save knowledge** Tool Workflow *Model*
- 9 **Set input context** Set *Logic*
- 10 **AI Agent** Agent *Model*
- 11 **Retrieve knowledge** Vector Store In Memory *Model*
- 12 **Chat Memory Manager** Memory Manager *Model*
- 13 **Input type switch** Switch *Logic*
- 14 **Split agent's response** Code *Logic*
- 15 **Success** Telegram *Service*
- 16 **Text prompt** Set *Logic*
- 17 **Download document** Telegram *Service*
- 18 **Download audio** Telegram *Service*
- 19 **If** If *Logic*
- 20 **Split Out** Split Out *Logic*
- 21 **Encode document** Extract From File *Service*
- 22 **Encode audio** Extract From File *Service*
- 23 **Error** Telegram *Service*
- 24 **Send response** Telegram *Service*
- 25 **Describe document** Http Request *Service*
- 26 **Describe audio** Http Request *Service*
- 27 **Document prompt** Set *Logic*
- 28 **Audio prompt** Set *Logic*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 28, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Telegram, in-memory vectors
- **Model:** Gemini
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Telegram and in-memory vectors accounts, and a key for Gemini. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls Gemini. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 28 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 28 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fpublish-linkedin-and-x-posts-with-telegram-bot-and-gemini)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Telegram](https://millionrounds.com/workflows?service=Telegram#library)[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**Auto-create TikTok videos with VEED.io AI and ElevenLabs** 28 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/auto-create-tiktok-videos-with-veed-io-ai-and-elevenlabs)
- [**Auto-generate social media videos with OpenAI and Blotato** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/auto-generate-social-media-videos-with-openai-and-blotato)
- [**Summarize RSS articles and publish AI images** 28 steps · calls a model · Discord, LinkedIn](https://millionrounds.com/workflow/summarize-rss-articles-and-publish-ai-images)
- [**Your first WordPress + AI content creator - quick start** 28 steps · calls a model · Google Drive, Telegram](https://millionrounds.com/workflow/your-first-wordpress-ai-content-creator-quick-start)
- [**AI content creation and publishing engine with Mistral** 27 steps · calls a model · Telegram, YouTube](https://millionrounds.com/workflow/ai-content-creation-and-publishing-engine-with-mistral)
- [**Automated Instagram content creation from trending posts** 27 steps · calls a model · Postgres, Telegram](https://millionrounds.com/workflow/automated-instagram-content-creation-from-trending-posts)
