Overview
Build an n8n workflow behind a private Telegram bot that reads a photo of your cards or a spoken description, works out the game state with OpenAI and replies with a suggested move and the reason for it.
Problem or Objective
- Which agents can play, test or benchmark themselves on games through a browser or screen?
- Which agents run multi-step workflows across your apps?
More in Games and Simulations
AI Agents and Models
Tools and Integrations
- Tools
- n8n · Telegram · OpenAI API
- Prerequisites
- An n8n instance (cloud or self-hosted), a Telegram bot token and an OpenAI API key with credits.
How It Works
Create a Telegram bot and add its token to a Telegram Trigger node in n8n, set to fire on new messages, with Download Images/Files turned on and Restrict to User IDs set to your own account. Route the message by type. For a photo, an OpenAI node with the Analyze Image operation lists the visible cards, the table and the score as plain text. For a voice note, an OpenAI node with Transcribe a Recording turns the audio into text. Pass that text to an AI Agent node whose instructions name the game, its rules and your house variations, and ask it to restate the game state, suggest one legal move and explain why in two sentences. Send the answer back to the same chat with a Telegram node; check the send operation and its settings in your n8n version. Test with a few positions where you already know the best move before trusting it.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up n8n.
- Connect the toolsConnect the tools this workflow relies on: n8n, Telegram, OpenAI API.
- Check the prerequisitesAn n8n instance (cloud or self-hosted), a Telegram bot token and an OpenAI API key with credits.
- Gather your detailsCollect what the prompt asks for: Card game, Rules and house variations, Which player you are, Sentences in the explanation.
- Run the starter promptPaste the starter prompt below into n8n and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at docs.n8n.io before you rely on it.
Practical Starter Prompt: Suggest my next move from the game state
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You help me practise [Card game]. The rules we play: [Rules and house variations]. You receive either a list of cards read from a photo or a transcript of my voice note. First restate the game state in one line: my hand, the table and whose turn it is. If anything is unclear, ask one question instead of guessing. Otherwise suggest one legal move for [Which player you are] and explain why in at most [Sentences in the explanation] sentences. Only suggest: I review the state and decide the move myself.Paste this into the AI Agent node's instructions. Check the restated game state against your real cards before acting on any move, and only message the bot from the account listed in Restrict to User IDs.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The n8n Telegram Trigger page documents triggering on new messages of any kind, downloading attached images and restricting the trigger to listed users, and the OpenAI node page lists Analyze Image and Transcribe a Recording operations. The AI Agent node page says the agent connects a chat model to tools and decides which to call. None of the pages covers card games, so the quality of the suggestions and how well cards are read from a photo are untested.
Limitations and Considerations
Use the bot for practice and casual games; many clubs, tournaments and online platforms forbid outside help during play, so check the rules before using it at a table. Photos and voice notes are sent to OpenAI for processing, and each message uses API credits. Card recognition from a photo can be wrong; ask the agent to restate the game state so you can catch errors before acting on the suggestion. Restrict the trigger to your own user ID so strangers cannot use your API key through the bot. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Related Videos
About n8n-io/n8n
Give Your Agent Tools (n8n Agents Course 5/7) (opens in a new tab)
Walkthrough of n8n by n8n: it is on the project’s own channel.
Watch on YouTube (opens in a new tab)About n8n-io/n8n
n8n AI Nodes: Connect OpenAI, Claude, and Local Models (opens in a new tab)
Walkthrough of n8n by AI Daily Lab: its description links the GitHub repository.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Telegram Trigger | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 26 Nov 2026, 17:52 UTC
What this source supports
- Message: Trigger on new incoming message of any kind, such as text, photo or sticker.
- Download Images/Files sets whether to download attached images or files to include in the output data; Restrict to User IDs only triggers for events with the listed user IDs.
- OpenAI | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 27 Nov 2026, 07:07 UTC
What this source supports
- The OpenAI node supports image operations including Analyze Image and audio operations including Transcribe a Recording.
- AI Agent | Nodes | n8n Docs (opens in a new tab)
Project documentation · docs.n8n.io · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- The AI Agent node connects a chat model to one or more tools and lets the agent decide which tools to call to finish a task.

