n8n

How to Automate Telegram Social Content Creation?

Turn Telegram voice and text into ready social posts with images. Teams and solo marketers can plan posts on the go, then receive clean copy and a matching image prompt. It helps you move from idea to draft in minutes.

Incoming messages from Telegram start the flow. A switch checks if the user sent voice or text. Voice notes are fetched and transcribed to text with OpenAI. That text goes to an AI agent that uses an OpenAI chat model and SerpAPI to research and write content and an image prompt. A structured parser keeps the output in a steady format with two fields: content and image_prompt. The image prompt is sent to the Hugging Face Inference API to create an image. The image file is extracted into a usable property, and a final set step prepares the result for handoff.

Setup needs a Telegram bot plus API keys for OpenAI, SerpAPI, and Hugging Face. Expect faster turnarounds and fewer back and forth steps. Common uses include quick social campaigns, event recaps, product updates, and daily posting from the field. Teams who already work in Telegram get a simple content pipeline without opening extra tools.

What are the key features?

  • Telegram listener captures user messages as the entry point
  • Smart switch routes voice and text down the right path
  • Voice files are fetched and transcribed to text with OpenAI
  • AI agent uses an OpenAI chat model and SerpAPI to research and write
  • Structured output parser enforces content and image_prompt fields
  • HTTP request to Hugging Face creates images from the prompt
  • Extract from File converts the binary image into a usable property
  • Final set node organizes the message and image for downstream use

What are the benefits?

  • Reduce content drafting time from 2 hours to 10 minutes
  • Cut manual research by 70 percent using built in web search
  • Create images instantly from AI prompts with no design work
  • Handle both voice and text requests in one chat channel
  • Keep outputs consistent with a fixed content and image_prompt format
  • Support more requests per day without adding staff

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram, OpenAI, SerpAPI and Hugging Face. See the Tools Required section above for links to create accounts with these services.
  3. In Telegram, create a bot with BotFather and copy the bot token. In the n8n credentials manager, create a Telegram credential and paste the token. Open the Telegram Trigger node and select this credential.
  4. Activate the workflow or use test mode, then send a test text message to your bot. Confirm the trigger receives the message in the n8n execution log.
  5. Open the OpenAI nodes (Transcribe Voice to Text and OpenAI Chat Model). In the credential dropdown, click Create new credential, add your OpenAI API key from the OpenAI dashboard, and save.
  6. Open the SerpAPI tool node. Create a new SerpAPI credential and paste the API key from your SerpAPI account. Save and ensure the AI agent shows SerpAPI connected as a tool.
  7. Open the HTTP Request node for image generation. Attach a Hugging Face credential with your API key from your Hugging Face account. If the node also uses Header Auth, create a Header Auth credential and add any required headers as instructed by your Hugging Face plan.
  8. Check the Structured Output Parser node to confirm the schema has two fields: content and image_prompt. This keeps results consistent.
  9. Send a voice message to the bot. Verify the Fetch Voice Message and Transcribe steps run and the text appears in the AI Agent step input.
  10. Send a text message prompt. Confirm the AI Agent returns content and image_prompt. Make sure the Generate Image node returns an image and the Extract from File node exposes it as a property.
  11. If the Telegram trigger does not fire, recheck the bot token and ensure the workflow is active. For OpenAI errors, verify model access and account limits. For SerpAPI or Hugging Face errors, confirm API keys and endpoint permissions.
  12. Once tests pass, activate the workflow, set permissions for your team, and monitor executions to track message volume and runtime.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Hugging Face

Sign up

Free tier: $0 / mo, includes ~$0.10 in monthly Inference API credits; extra usage not available on Free

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

SerpAPI

Sign up

Free tier: $0 / mo, 100 searches / mo

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.