n8n

How to Connect Telegram AI with Airtable Access Control?

Chat requests from Telegram are routed to an AI assistant with strict access rules. Team members get answers and tools based on their role set in Airtable. It fits groups that want fast help in chat with strong control.

Messages from the Telegram bot are matched to a user record in Airtable. If the user is not found, a clear reply is sent back in Telegram. If found, the AI uses OpenAI with session memory and only the tools that user is allowed to use. Tools include Wikipedia search, a calculator, and a weather agent that calls Open Meteo for city coordinates and forecast. A custom permission check wraps each tool so blocked tools return a helpful notice instead of running.

A second entry point lets other workflows call the agent with a session id and allowed tools, which makes reuse across channels easy. You need a Telegram bot, an Airtable base for users, and OpenAI keys. Expect faster chat responses, less manual checking, and safe tool use by role. Great for field teams asking for weather, quick facts, or math while admins control access in one place.

What are the key features?

  • Telegram Trigger listens for new messages and routes them into the flow.
  • Airtable search loads granted roles and allowed tools by matching the Telegram username.
  • An If branch handles unknown users and sends a polite Telegram reply.
  • OpenAI chat model with session memory keeps context per Telegram user.
  • Custom permission check wraps every tool and blocks those not in the user list.
  • Built in tools include Wikipedia search, calculator, and role and tool listing replies.
  • Weather sub agent uses its own memory and calls Open Meteo for coordinates and forecast.
  • ExecuteWorkflowTrigger allows other workflows to call the agent with chat input and session id.
  • Telegram reply nodes send final results back to the user in chat.

What are the benefits?

  • Reduce manual permission checks from minutes to seconds
  • Automate up to 70 percent of routine chat lookups
  • Improve access control by ensuring only approved tools run
  • Connect five services in one chat channel
  • Support many concurrent users with per user session memory
  • Lower onboarding time by using simple Airtable controls

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, Airtable, OpenAI, Wikipedia and Open Meteo. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, open the Telegram Trigger node and the Telegram reply nodes, choose Create new credential, and paste your bot token from BotFather. Save and test by sending a message to your bot.
  4. Copy the Airtable Users base from the provided template. In n8n, open the Airtable node, click Create new credential, choose API Key or Access Token, and paste your key from the Airtable account page. Select the correct base and the Users table.
  5. Check the Airtable fields. You need username, name, granted_roles, and allowed_tools. Confirm the filter formula matches the username field so the lookup finds the right record.
  6. Open the OpenAI nodes, click Create new credential, and enter your OpenAI API key from the OpenAI API page. Pick models similar to gpt 4o for the main agent and gpt 4o mini for the weather agent.
  7. Review the permission check code nodes. Ensure the ai_tool connections include Wikipedia, calculator, weather agent, and the role and tool listing tools. The code will block any tool not listed for the user.
  8. For the weather sub agent, confirm the HTTP request tools point to Open Meteo endpoints. Send a test city name and check that coordinates and forecast data return as expected.
  9. Validate the unknown user path. Send a message from a Telegram account not in Airtable and confirm you receive the unknown user reply.
  10. Add your Telegram username to the Airtable Users table, set allowed_tools and granted_roles, then message the bot again. Ask for weather, a Wikipedia fact, and a quick calculation to confirm permissions work.
  11. Check memory keys. The main memory uses the Telegram user id and the weather agent uses a session id suffix. Note that old memory may remain after permission changes, so clear sessions if needed.
  12. If messages do not arrive, open the Telegram Trigger node and click Listen for Test Events, ensure your n8n instance is reachable, and verify the Airtable credential and base selection.

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.

Airtable

Sign up

Free (1,000 API calls / mo)

Open Meteo

Sign up

Free tier: $0 / mo, no API key, non-commercial use; limits 600/min, 5,000/hour, 10,000/day, 300,000 / mo

OpenAI

Sign up

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

Telegram

Sign up

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

Wikipedia

Sign up

Free: $0 (public Wikimedia APIs). Enterprise Free: $0 with 5,000 on‑demand requests / mo and twice‑monthly snapshots

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.