Add Escalation Tools to Agents

Support Inbox Commander - Challenge 5 of 6
Difficulty
4/10
Tags
Gmail ToolTelegram ToolGmailTelegramAI Tools
Requirements
OpenAI API credentials configured in n8nTelegram Bot token (or Slack credentials)Completed "Create Specialized Support Agents" challenge

The outcome: After this challenge, your AI agents won't just analyze - they'll act. Support emails get draft replies ready to send. Urgent issues trigger Telegram alerts to your phone. The AI goes from advisor to autonomous worker.

Why this matters: An AI that can only think but not act is just a fancy calculator. Tools are what turn AI agents into actual automation. This is the difference between "AI helped me write a reply" and "AI handled it while I was sleeping."

n8n provides built-in tool nodes that you can connect directly to AI Agents. These tools let agents perform actions like sending emails, posting to Slack, or triggering alerts without needing complex sub-workflow setups.

What you'll learn:

  • Built-in tool nodes - Gmail Tool, Telegram Tool, Slack Tool
  • Connecting tools to agents - the ai_tool connection type
  • Agent + Tool architecture - the pattern behind autonomous AI systems

Your Task

  1. 1Copy the exercise below
  2. 2Paste into your n8n editor (Ctrl+V)
  3. 3Solve it — use hints if you get stuck
  4. 4Check the solution when done

Add built-in tools to your agents so they can take actions:

Tool 1: Gmail Tool (for Email Draft)

  1. Add a Gmail Tool node to your workflow
  2. Configure it to create draft replies (Resource: Draft, Operation: Create)
  3. Connect it to the Support, Finance, and Promotions agents

Tool 2: Telegram Tool (for Human Escalation)

  1. Add a Telegram Tool node to your workflow
  2. Configure it to send alert messages
  3. Connect it to the High Priority agent

Update Agent Prompts: Each agent needs to know about its tools. Add a "Tools" section to each system prompt describing what tools are available.

Test it: Send a support email and verify the agent creates a draft reply.

Hints

Adding the Gmail Tool:

  1. Search for "Gmail Tool" in the node panel (not regular Gmail node)
  2. Configure it:
    • Resource: Draft
    • Operation: Create
    • Subject: ={{ $fromAI("subject") }}
    • Message: ={{ $fromAI("emailBody") }}
    • Thread ID: ={{ $('Gmail Trigger').item.json.threadId }}
  3. Drag from the Gmail Tool's output to the agent's "Tools" input (creates ai_tool connection)

Adding the Telegram Tool: 4. Search for "Telegram Tool" in the node panel 5. Connect your Telegram Bot credentials 6. Set message to: ={{ $fromAI("summary") }} 7. Connect it to the High Priority agent

The $fromAI() Pattern: Tool inputs use $fromAI("parameterName") - the AI decides what to pass based on context.

Update Agent Prompts: Add tool descriptions so agents know when to use them: ## Tools Email Draft - Use this to draft a reply to the customer.

Explanation

How Built-in Tools Work:

n8n provides "Tool" versions of popular integrations (Gmail Tool, Telegram Tool, Slack Tool, etc.) designed specifically for AI Agents. When you connect a tool to an agent:

  • n8n tells the AI what tools are available
  • The AI decides when to use them based on context
  • Parameters flow from AI to tool via $fromAI()
  • Results return to the AI for further processing

The $fromAI() Pattern:

In tool nodes, you use $fromAI("parameterName") to extract values the AI provides. The agent decides what to pass based on its analysis of the email.

Tool Prompts Matter:

Just like system prompts, tool descriptions help the AI understand when and how to use each tool. Be specific:

  • "Email Draft - Use to send a response to the customer"
  • "Telegram - Use for urgent issues requiring human attention"

Why Built-in Tools vs Sub-workflows?

For simple integrations like sending emails or alerts, built-in tools are preferred:

  • Single node instead of a separate workflow
  • Less complexity to maintain
  • Faster to set up

Sub-workflows are better for complex multi-step operations or when you need to reuse the same logic across many different agents.

Copy the Solution

Paste into n8n with Ctrl+V to compare with your approach.

Login to see the exercise

Create an account to access challenges and track your progress.

Log in to see exercise
Step 5 of 6

Next up

Complete the Triage System

Related Content

Continue your learning journey with these related challenges and guides: