Create Your Own AI-Powered Google Tool Agent in 2023 (No Code)

Create Your Own AI-Powered Google Tool Agent in 2023 (No Code): Learn how to build your first N8N agent with Google tools, including adding records to Google Sheets, updating Google Calendar, and sending emails - all through a chat interface. Step-by-step guide for beginners.

2025年6月15日

party-gif

Streamline your productivity with this comprehensive guide on building a powerful AI agent that seamlessly integrates with Google tools. Discover how to automate tasks like updating your calendar, tracking your calorie intake, and sending emails - all through a simple chat interface. Whether you're a beginner or an experienced user, this step-by-step tutorial will equip you with the skills to create your own AI-powered assistant that works for you.

Set Up the N8N Platform

To set up the N8N platform, follow these steps:

  1. Go to n8n.io and click on "Get Started" to create a free 14-day trial account.
  2. Once you're on the platform, click on "Create Workflow" to start building your first AI agent.
  3. Click on the "On Chat Message" node to trigger the AI agent.
  4. In the bottom left corner, you'll see the chat interface that you'll be using to interact with your agent.
  5. Click on the "AI" button in the top right, then select "AI Agent" to set up the AI model for your agent.
  6. Choose the "OpenAI Chat Model" and select the "GPT-4 Mini" option, which is suitable for most tasks.
  7. Click on "Memory" and select "Simple Memory" with a context window length of 10 to give your agent the ability to remember previous conversations.

Now your AI agent is set up and ready to use. You can start interacting with it through the chat interface and it will have the necessary memory to provide contextual responses.

Connect to Google Services

To connect your N8N agent with various Google services, follow these steps:

  1. Go to the Google Cloud Console (https://console.cloud.google.com/) and click on "Create a new project". Name the project "N8N Google" and click "Create".

  2. Click on the project you just created, then go to the "APIs & Services" section. Click on "Enable APIs and Services" and search for the following APIs: Google Workspace, Google Calendar API, Gmail API, Google Sheets API, and any other Google services you want to use. Enable each of these APIs.

  3. Go to the "OAuth consent screen" section and set up the consent screen. Select "External" as the app type, enter your email address, and fill out the other required information. Click "Save" when done.

  4. In the "Credentials" section, click on "Create credentials" and select "OAuth client ID". Choose "Web application" as the application type and name it "N8N". In the "Authorized redirect URIs" section, add the redirect URL provided by N8N.

  5. Once the client ID and client secret are generated, copy them and paste them into the corresponding fields in the N8N platform.

  6. Click "Sign in with Google" and authenticate with the Google account you want to use for these services.

After completing these steps, your N8N agent will be connected to the necessary Google services, allowing you to automate tasks such as updating Google Sheets, managing your Google Calendar, and sending emails through Gmail.

Add Google Sheets for Calorie Tracking

Click on the plus icon and add Google Sheets. The example is to create a simple calorie tracker. If you say "I just ate two slices of pizza", the AI agent will estimate the calories and update it to Google Sheets automatically.

First, rename the node to "Add or update the calorie tracker" to help the AI agent understand its purpose. Set the tool description to "Manual Add or update the calorie tracker".

Under the resource, select "Spreadsheet" and the operation as "Append or update row". Choose the Google Sheet you created called "calorie tracker" and map the columns manually. For the "Food" column, let the model define the values.

For the "Date" column, add a description to format it as "day month year and hour minute". To ensure the AI agent knows the correct time, add a system message that says "today's date and time is $2".

Finally, add a description that says "if I don't specify how many calories are in each food item, use ChatGPT to get the calories before you add it to the tracker."

With this setup, you can now ask the AI agent to "add one burger to my calorie tracker", and it will estimate the calories and update the Google Sheet accordingly.

Search the Calorie Tracker

To search the calorie tracker, we'll create a new node that will allow us to retrieve the records from the Google Sheet. Here's how you can set it up:

  1. Click on the "+" icon and add a new Google Sheets node.
  2. Rename the node to "Search Calorie Tracker".
  3. In the tool description, set it to "Search the calorie tracker".
  4. For the resource, select "Sheet" and for the operation, select "Get rows".
  5. In the document, select the "Calorie Tracker" sheet.
  6. For the "Map each column manually" section, you can leave the default settings as they are.
  7. Finally, click on "Save" to save the changes.

Now, you can use this node to search the calorie tracker. For example, if you want to know how many calories you've eaten today, you can send a message like "How many calories did I eat today?" and the AI agent will use the "Search Calorie Tracker" node to retrieve the records and provide you with the total calorie count.

Add Google Calendar Functionality

To add Google Calendar functionality to your N8N agent, follow these steps:

  1. Go to the N8N platform and click on the "+" icon to add a new node.
  2. Search for and select the "Google Calendar" node.
  3. Click on the node to configure it.
  4. In the "Tool Description" field, set it to "Automatically Add to Google Calendar".
  5. In the "Resource" field, select "Event".
  6. In the "Operation" field, select "Create".
  7. In the "Calendar" field, select the calendar you want to use.
  8. For the "Start" and "End" fields, let the model define these parameters.
  9. In the "Summary" field, add a description for the event.
  10. Click "Save" to save the node.

To add the ability to search your Google Calendar, follow these steps:

  1. Duplicate the previous Google Calendar node by clicking on it and selecting "Duplicate".
  2. Rename the new node to "Search Google Calendar".
  3. In the "Operation" field, select "Get Many".
  4. In the "Calendar" field, select the calendar you want to search.
  5. Let the model define the remaining parameters.
  6. Click "Save" to save the node.

Now, you can use your N8N agent to add events to your Google Calendar and search for existing events. For example, you can say "Add a meeting with Jessica at 2pm tomorrow" and the agent will create the event in your calendar. Or you can ask "What's on my calendar for this weekend?" and the agent will search your calendar and provide the details.

Integrate with Gmail

To integrate your N8N agent with Gmail, follow these steps:

  1. Click on the "+" icon to add a new node.
  2. Search for and select the "Gmail" node.
  3. In the "Gmail" node, select the "Send Email" operation.
  4. In the "Resource" field, select "Message".
  5. In the "To" field, allow the AI model to define the recipient's email address.
  6. In the "Subject" field, allow the AI model to define the email subject.
  7. In the "Message" field, allow the AI model to define the email content.
  8. Add a description in the "Sign off" field, such as "Best regards, AI Andy".
  9. Save the workflow and test the integration by sending an email through your N8N agent.

With this setup, your N8N agent can now send emails on your behalf, using the AI model to compose the email content.

Set Up the Telegram Chatbot

To set up the Telegram chatbot, follow these steps:

  1. Delete the existing chat node by right-clicking on it and selecting "Delete".
  2. Right-click on the canvas and add a new node, selecting "Telegram" and then "On Message".
  3. Click on the Telegram icon to open the documentation.
  4. Scroll down until you find the "Start a chat with BotFather" section.
  5. Open Telegram and start a chat with the BotFather.
  6. In the BotFather chat, select /newbot to create a new bot.
  7. Choose a name for your bot, making sure it ends with _bot.
  8. Copy the access token provided by the BotFather and paste it into the "Access Token" field in the Telegram node in N8N.
  9. In the "Prompt User Message" field, select the "Telegram Message" from the previous nodes.
  10. Double-click on the "Simple Memory" node and select the "Chat ID" from the Telegram trigger as the "Key" for the session ID.
  11. Save the workflow and activate it by clicking the button in the top right.

Now, you can use the Telegram chatbot to interact with your AI agent and perform various tasks, such as adding items to the calorie tracker, managing your Google Calendar, and sending emails.

Conclusion

In this step-by-step guide, you have learned how to build your first N8N agent with Google tools. You have set up the necessary integrations with Google Sheets, Google Calendar, and Gmail, allowing your AI agent to automate various tasks for you.

The key highlights of this process include:

  1. Configuring the N8N platform and setting up the AI agent with the OpenAI chat model.
  2. Connecting your Google account and enabling the required APIs for seamless integration.
  3. Designing a calorie tracker workflow that utilizes the AI agent's capabilities to estimate calorie counts and update a Google Sheet.
  4. Implementing a Google Calendar integration to automatically add and search events.
  5. Integrating a Gmail node to send emails directly from your AI agent.
  6. Setting up a Telegram chatbot interface for a user-friendly interaction experience.

By following these steps, you now have a powerful AI agent that can assist you with a variety of tasks, from tracking your calorie intake to managing your calendar and sending emails. This setup provides a solid foundation for further customization and expansion of your AI-powered automation capabilities.

常問問題