To create a fully custom automation, you can build an agent from scratch:
-
On your computer, go to studio.workspace.google.com
New agent
.
- Click the Starter to choose which event or schedule will launch your agent.
- Click Choose a step and select the task(s) the agent will perform.
- At the top of the page, click the pencil
to name your agent.
- Optional: Before you turn on your agent, to make sure it works properly, click Test run
Start.
- This runs the agent immediately so you can verify the output.
- If everything works fine, you get a "Run Completed" message.
- After you complete your edits, click Turn on.
Every agent has 2 main parts:
- Starter: This is the event that starts your agent. A starter can be a schedule, like “every Friday at 5 PM,” or an event, like to receive a new email with an attachment. Each agent has only one starter.
- Steps: These are the tasks the agent performs after it starts. You can add multiple steps to an agent. A step could be:
- “Draft a reply in Gmail.”
- “Add a row in Google Sheets.”
- “Send a message in Google Chat.”
Tip: Variables are placeholders for information from your starter or previous steps. They let you create dynamic and powerful agents.
- For example, you can use a variable to insert the subject line of an email from your starter into a Google Chat message step. Learn how to use variables to pass data in your agent.
Build your agent from scratch with an example
In this example, you'll create an agent from scratch that instantly alerts a Google Chat space whenever you receive an email that contains the word "Invoice."
Step 1: Choose your starter
- On your computer, go to studio.workspace.google.com
click New agent
.
- Click Choose a starter
When I get an email. This tells the agent when to begin.
- On the right of the configuration panel, under "Which messages to check," select Specific emails.
- Find the "Has the words" field.
- Enter:
Invoice- This tells the agent to run only when an email contains the word "Invoice" in its subject or body.
For a full list of all available starters and steps, go to Guide to Starters and Steps in Workspace Studio.
Step 2: Add a step
- Below your starter, click Choose a step.
- Under the "Chat" category, select Post in a space.
- In the configuration panel, click Select a space.
- Enter the name of a Chat space where you want to send a notification.
Step 3: Use variables to create a dynamic message
- On your "Post in a space" step, click inside the Message field.
- Enter:
New Invoice Received! From: - Click Variables +
Step1: When I get an email.
- From the list, select Sender email address.
- To add a new line, press Enter.
- Enter:
Subject: - Click Variables +
Step1: When I get an email
Email subject.
-
Your message should look like this:
New Invoice Received! From:[Sender email address]Subject:[Email subject]
-
- When your agent runs, it automatically replaces the variable chips with the actual sender and subject from the email. Learn more about using variables.
Step 4: Name, test & turn on your agent
- At the top of the page, click the pencil
to name your agent.
- At the bottom, click Test run.
- A new window will show that allows you to select a recent email from your inbox that matches your starter conditions to test the agent with.
- In the "Email received" field, enter:
Invoice-
This finds recent emails that match your starter conditions.
-
-
Select an email.
- Click Start.
- If everything works fine, you get a "Run Completed" message and should find the message in your selected Chat space.
- When you're finished, click Turn on.
You've now built a smart and custom agent from scratch that filters your email and keeps your team informed in real time.