Skip to main content
← Back to Blog
2025-11-20 · 11 min readAI AutomationUpdated Oct 30, 2026

n8n Automation Guide: Build a Telegram Translation Workflow with OpenAI

Learn n8n's building blocks by building one real workflow, a Telegram bot that translates messages with OpenAI, then cover credentials, error workflows, rate limits and other common gotchas, and when to choose n8n over Zapier or Make.

Avnish Yadav
Avnish Yadav
Developer & Automation Builder
4 views
n8n Automation Guide: Build a Telegram Translation Workflow with OpenAI

This guide is for developers and technical leads who want to learn n8n by building something real. You will learn the core ideas (nodes, workflows and credentials), then build a Telegram bot that translates incoming messages with OpenAI. After that come the gotchas that break workflows in production, and a short comparison with Zapier and Make.

Key takeaways

  • An n8n workflow is a chain of nodes: a trigger starts it, and each node passes JSON items to the next one.
  • Data from earlier nodes is reached with expressions such as {{ $json.message.text }}. Drag fields from the INPUT pane so n8n writes them for you.
  • Plan for failure from day one: set an error workflow, use retries for flaky APIs, and check incoming data before you trust it.

Why manual processes drain your time

Every developer and product team knows the cost of manual, repetitive work. It's not just the time lost. It's the mental overhead, the risk of human error, and the slower pace that follows.

  • Data silos: information lives in dozens of apps, so a full picture means manual exports and imports.
  • Repetitive work: confirmation emails, CRM syncs and routine reports eat time you could spend on harder problems.
  • Slow processes: onboarding a customer or getting an approval can mean back-and-forth across several systems.
  • Costly integrations: custom code for every pair of apps is slow to build and hard to maintain.

A workflow automation tool such as n8n handles this kind of glue work. n8n is part of my toolkit for client work.

n8n unpacked: concepts and real-world uses

n8n is a workflow automation platform that connects apps and APIs through workflows you build from nodes. Its README calls it "fair-code distributed under the Sustainable Use License and n8n Enterprise License": the source is always visible, and you can self-host it. That is not the same as an OSI open-source license, so check the license if you plan to resell n8n as a service.

You build a workflow on a canvas by adding nodes and connecting them. Each node does one job: start the workflow, call an app, transform data or make a decision.

Understanding the core components

  1. Nodes: the building blocks. There are trigger nodes (a webhook, a schedule, a new database row), app nodes (Google Sheets, Slack, HubSpot), logic and data nodes (If, Merge, Loop Over Items) and AI nodes (OpenAI and others).
  2. Workflows: a sequence of connected nodes. Something triggers the workflow, and then it runs its steps in order.
  3. Credentials: n8n stores your API keys and logins in its credential store, so nodes can use a service without the key appearing in the workflow itself.

Here is how a workflow that summarizes new articles from an RSS feed and posts them to Slack could look:

RSS Feed Trigger -> HTTP Request (fetch the full article if the feed has only a summary) ->
HTML (extract the article text) -> OpenAI (summarize) ->
Slack (post the summary)

Or a business process: create a task when an enterprise lead arrives in your CRM, enrich it, and notify sales:

HubSpot Trigger (new contact) -> If (lead type is "Enterprise") ->
    HTTP Request (enrich from a data provider's API) ->
    Google Sheets (log the enriched data) ->
    Jira (create a task) ->
    Slack (notify the sales channel)

Both are sketches, not finished workflows. The useful part is that n8n shows the data flowing between each pair of nodes, so you can see exactly what each step received. You can also write JavaScript expressions inside node fields to reshape data without a separate code step.

Build your first n8n automation, step by step

You can run n8n on your own machine, on a server, or use n8n Cloud. For this workflow there is one catch to know first: Telegram only sends updates to HTTPS URLs. The Telegram Bot API requires an HTTPS webhook, and n8n's Telegram Trigger docs say the same. A plain local install at localhost can't receive Telegram messages, so use n8n Cloud or a self-hosted n8n with a public HTTPS address.

1. Set up your n8n instance

To try n8n locally with Docker, the commands from n8n's README are:

docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

Then open http://localhost:5678. The named volume keeps your workflows and credentials when the container stops. n8n's Docker docs recommend Docker Compose for a longer-lived setup. If you self-host behind a reverse proxy for Telegram, the trigger's common issues page says to set WEBHOOK_URL to your public address.

2. Create a new workflow

In the n8n editor, create a new workflow. You start with an empty canvas.

3. Add the Telegram Trigger

The workflow will react to a message sent to your Telegram bot, translate it, and reply with the translation. Search for "Telegram", add a Telegram Trigger node, connect your bot's credential, and set Trigger On to Message.

n8n's docs note that the Message event fires on any kind of message: text, photo, sticker and so on. A photo has no text, so add an If node right after the trigger. Give it one condition: drag the message.text field into it, choose the String comparison is not empty, and connect the next node to the If node's true output. Messages without text stop there. n8n's If node docs list is not empty among the String comparisons.

One webhook per bot

n8n's Telegram Trigger common issues page says Telegram allows only one webhook per bot. The test URL and the production URL overwrite each other, so only one of them gets messages at a time. Use a separate bot for testing, or unpublish the workflow while you test.

4. Add the translation step

Search for "OpenAI" and add an OpenAI node after the If node's true output. Add your OpenAI API key as a credential. Set Resource to Text and Operation to Generate a Chat Completion. n8n's docs say the OpenAI node V2, introduced in n8n 1.117.0, renamed the "Message a Model" operation to "Generate a Chat Completion" and added a separate "Generate a Model Response" operation for the Responses API. Older tutorials use the old name.

Pick a model from the Model list. A small, efficient model is enough for translation. On the date above, OpenAI's models page calls gpt-6-luna its most efficient model for focused, high-volume tasks. Model ids change often, so check that page.

Add two messages:

  • Role System: Translate the user's message into Spanish. Reply with the translation only.
  • Role User: {{ $json.message.text }}

{{ $json.message.text }} is an n8n expression. It reads the text field of the incoming message, which the Telegram Bot API describes as "the actual UTF-8 text of the message." Rather than typing it, drag the text field from the INPUT pane, and n8n writes the expression for you. As a rule of thumb, keeping the instruction (system) apart from the user's text (user) also makes it harder for a message to hijack the instruction. For a larger AI workflow that pulls several structured fields out of each message, see the n8n inbox triage tutorial.

5. Send the translation back to Telegram

Add a Telegram node after the OpenAI node, with Resource set to Message and Operation set to Send Message. Fill in:

  • Chat ID: {{ $('Telegram Trigger').item.json.message.chat.id }}
  • Text: drag the reply text field from the OpenAI node's output in the INPUT pane.

The Chat ID reads the chat from the trigger node, using the $("<node-name>").item syntax from n8n's docs on the output of other nodes. The current item here is the OpenAI output, which no longer holds the chat. The node name must match the trigger's name on your canvas.

n8n's docs don't spell out the exact output path of the OpenAI node, and it depends on the Simplify Output setting. That's why dragging the field is safer than typing a path. An older version of this post typed choices[0].message.content, which only matches the raw API response.

The Send Message node has an Append n8n Attribution option, on by default, which adds "This message was sent automatically with n8n" to each message. Turn it off if you don't want that line.

6. Test and publish

Run the workflow from the editor and send your bot a message to get test data. Once each node shows the output you expect, publish the workflow. n8n then registers the production webhook, and every text message the bot receives gets a translated reply.

Gotchas, trade-offs and failure modes

n8n is powerful, but robust workflows need care in a few places:

  • Error handling is crucial. APIs go down, data arrives malformed, credentials expire. n8n's error handling docs describe an error workflow: a separate workflow that starts with an Error Trigger node and runs when a linked workflow fails. Set it in Workflow Settings and have it post to Slack or email you. Without it, a workflow can fail silently for days.
  • Handle errors per node, too. n8n's node settings include Retry On Fail and an On Error setting. Continue (using error output) passes the error to a separate branch, so you can deal with one bad item without stopping the run.
  • Rate limits and backoff. Many APIs limit how fast you can call them. Loop Over Items (formerly Split in Batches) and Wait nodes let you send work in small groups with pauses between them. High-volume integrations may need real exponential backoff in a Code node.
  • Data types and transformations. n8n passes JSON items between nodes, but you'll meet strings, nested arrays and binary files too. The Code node runs JavaScript (and native Python in n8n 2) to reshape data. As a rule of thumb, a wrong guess about the shape of the JSON is a common reason a new workflow breaks.
  • Check incoming data. Don't assume an API, or a user, always sends the same shape. In the Telegram workflow, the If node from step 3 does this for photos and stickers.
  • Credentials across environments. Keep separate credentials for development and production, and restrict who can reach your n8n instance.
  • Version control. You can export workflows as JSON and keep them in Git. That gives you history, review and a way to recover a workflow someone broke.
  • Scalability. For heavy loads, n8n's queue mode splits the work: a main instance receives triggers, Redis holds the queue of pending runs, and separate worker instances run them. The docs give a default of 10 parallel jobs per worker.

n8n vs Zapier vs Make

Tool How it runs Trade-off Use it when
n8n Self-hosted or n8n Cloud; fair-code license with visible source You can own the infrastructure, but then you own setup, updates and uptime You want control over data and hosting, or custom code inside workflows
Zapier Zapier calls itself a fully managed cloud platform No servers to run, but your workflows live on Zapier's platform You want the least operations work
Make Runs in Make's cloud; an on-premise agent (Enterprise plan) reaches systems on your local network Hosted like Zapier, with an add-on for internal systems You prefer a hosted visual builder and need occasional on-prem access

Compare current pricing on each vendor's site for your expected volume. Plans change often, so this post makes no cost claim.

Frequently asked questions

Is n8n truly low-code? What if I need custom logic?

Most common integrations and transformations need only nodes and simple expressions. For custom logic or an API without a dedicated node, the Code node runs JavaScript, and the HTTP Request node calls any API. You can move from low-code to full code inside the same workflow.

How does n8n compare to Zapier or Make?

The biggest difference is hosting. You can self-host n8n and read its source, while Zapier describes itself as a fully managed cloud platform and Make runs in its own cloud. Self-hosting gives you control over data and infrastructure, and it also makes you responsible for running it.

How do I manage credentials and API keys in n8n?

Store them as n8n credentials, not inside node fields or Code nodes. Use separate credentials for development and production. Keep your n8n instance behind HTTPS and limit who can log in.

Can n8n handle high-volume automations?

Yes, with the right setup. Queue mode runs executions on separate worker instances fed from a Redis queue, and you add workers as the load grows. n8n's docs give per-worker concurrency (10 jobs by default), not an overall throughput figure, so load-test your own workflows.

Why does my Telegram workflow only work in test or in production?

Telegram allows one webhook per bot, so the test and production URLs overwrite each other. n8n's common issues page suggests a separate test bot, or unpublishing the workflow while you test and publishing it again afterwards.

Your next step

n8n takes over the tedious glue work between apps. That frees developers from boilerplate integrations and lets teams try new processes quickly.

Don't just read about it. Pick one small, repetitive task, such as getting a daily summary in Slack or backing up new files to Google Drive, and build that workflow first. When you're ready for more AI in the loop, follow the AI planning agent tutorial. If you are deciding where n8n fits in a product, micro-SaaS ideas built on AI automation shows some starting points.

Sources

Verified against the sources below on October 30, 2026. Products and docs change often: check the linked sources if something looks different.

  1. n8n on GitHub (README and license)
  2. n8n Docs: Docker installation
  3. n8n Docs: Telegram Trigger node
  4. n8n Docs: Telegram Trigger common issues
  5. n8n Docs: Telegram node message operations
  6. n8n Docs: OpenAI node text operations
  7. n8n Docs: If node
  8. n8n Docs: Output of other nodes
  9. n8n Docs: Error handling
  10. n8n Docs: Node settings
  11. n8n Docs: Loop Over Items (Split in Batches)
  12. n8n Docs: Code node
  13. n8n Docs: Queue mode
  14. Telegram Bot API
  15. OpenAI API: Models
  16. Zapier blog: n8n vs Zapier
  17. Make Help Center: On-premise agent
Share
Discussion

Comments

Loading comments...

Add a comment

Comments are reviewed before they appear.