Welcome back.
In this video I will show you how to set up AI automation, which is very helpful and can save you a
lot of time.
This automation summarizes your daily emails.
So imagine you receive lots of emails overnight and each morning you just want a quick summary to know
what's important without reading each email individually.
So with this automation you will save a lot of time.
And the great news is we don't even need to build this automation from scratch.
We will build more complex and advanced AI automation in the next lessons, but in that case, we will
use a pre-built ready to use template that is available directly in any template library.
Now I'm going to show you how you can find and import the template we are going to use.
So first let's create new workflow.
Now if you are, if you are using a cloud version on the left hand side you will see templates uh section.
Just click on it.
So to find the exact workflow we'll use today.
Type type.
Email summary agent.
Hit enter.
And as you can see there are over 1500 uh, automation templates available.
Most of them are free to use.
We are interested in this one.
Now just click on Use Workflow and then choose to copy it.
So use workflow.
And copy template to clipboard as a JSON file.
Then go back to 2010.
And just use Ctrl Plus V.
Now in the setup credentials lesson, I've showed you how to set up credentials for most of the services.
So if you are using a cloud version of an A-10, it should be saved and you can manage all your credentials
in credentials section.
But just make sure that when you open Gmail a node.
Is successfully connected.
If not, just simply sign in to your Google account.
And the same for OpenAI node.
Just simply open it.
Click on this little pen.
And the message connection tested successfully should pop up.
If not, go back to the setup credentials lesson and enter your API keys here.
Now it's ready to go and we can move on.
There is another way of importing templates from a library by simply importing templates directly to
your cloud workspace.
So instead of copying templates as a JSON and importing them manually, you can simply click on Import
template to your cloud workspace.
But this is working just if you are using a cloud version cloud version of an A-10.
Now this method allows you for setting up credentials before modifying the workflow itself.
So you can simply just select credentials you want.
I'm going to choose this one.
And for OpenAI this one and hit continue.
And now the template has been successfully imported into your N810 environment.
And the credentials are also successfully connected.
As you can see.
Now OpenAI.
Yes.
Awesome.
Now let's quickly explore the nodes.
So the first node schedules when this automation runs.
So right now it's set to 7 a.m. every day.
But you can adjust it to whatever it fits your routine best.
For instance, maybe you prefer your email summaries at midnight or every Sunday morning at 9 a.m.,
or perhaps each night at 10 p.m..
So simply click the note and adjust the timing that works best for you.
So here you can change the trigger interval so you can switch to seconds, minutes, hours, days,
weeks, months or set up a custom cron.
Here you can choose.
The number of days between triggers.
Here you can set up the specific hour you want the workflow to be triggered.
And here at which minute.
Now let's go back to our workflow.
Now when I make this workflow active just by clicking on this toggle.
Every day at 7 a.m., this workflow will be triggered by, according to the New York Time Zone.
And because I'm not based in New York, I'm going to change the settings to change the time zone to
my local time zone for London Europe.
And confirm it.
And now this workflow will be activated every day at 7 a.m. in my local time zone.
So that's why this is really important, to double check in the settings that you have set up the correct
time zone.
Because if you are importing templates from a library by default, it can be configured to use your
timezone or any other time zone which could cause issues if you live elsewhere.
And this mistake happens frequently.
So select the correct time zone and let's move on.
Now as you can see why it's important the template from the library.
It comes with Beautiful notes.
And they're called sticky notes.
And you can simply add them to your workflows by searching sticky notes.
And you can always.
Use it to help you understand or make some notes inside your workflows.
So for example here you can change the color.
And by double clicking you can edit it and add any text you want.
For now let's remove it.
And most of the templates available in the Naa10 library come with these notes.
So here we can see that it starts the workflow every day at 7 a.m. you can adjust the time if you want
to.
You can see that the next node.
So Gmail tool fetches all emails received in the past 24 hours from the email address, etc..
So as you can see, according to this node, it grabs every email received in the past 24 hours.
So let's open it and let's see what's inside.
So as a result we have a message.
So we want to fetch a message.
So email you can also fetch a labor draft or treat.
You have different options to choose from.
We can fetch many emails so we can get we can use get many operation.
We can delete emails.
We can add labels.
You can even mark emails as read as only you can reply.
We can send emails, you can send and wait for response.
So you have plenty of options to choose from.
In that case, we want to fetch multiple emails.
So we're going to leave this operation as it is.
Now we want to return all emails from the past 24 hours.
And we want to simplify the output.
Now this code snippet has been added by the author of this workflow.
Now you can also turn it off and set up a limit.
For example, let's say you want to fetch just last ten emails so you can change it, but you want to
leave it as as written all as I want to have access and summarize all my emails from the past 24 hours.
And now let's move on.
So we want to simplify the output.
Now we want to keep it as a simplified.
We can simply hover over on it.
And you can see that it means that whether to return a simplified version of the response instead of
the raw data.
So we want a simplified version.
Now this is JavaScript code added by the author of this workflow.
You can expand it by simply clicking on this little button.
So this script generates a Gmail search query to find emails from this specific email address.
And received after yesterday in a specific format.
But you don't need to know how to write this code.
You can simply Just ask any LLM like ChatGPT or Claude.
All right, let's move on.
The next note is called aggregate node.
You can simply find it just by searching aggregate.
It's a we can use it to combine a field from many items into a list in a single item.
So in that case, it organizes the fetched email data by extracting fields like sender, receiver,
CC and previous snippet.
So let's open it.
It aggregates all item data into a single list.
You can switch to individual fields.
We also want to output data in field.
We include a specific fields.
The fields we want to include a ID from two cc See snippet.
So all the data fetched from your emails and that's basically it.
Now let's move on to the next node which is message model node.
This is where the magic happens because here we are using LM to summarize our emails and combine all
the fetched emails into a summary.
Here, as you can see, this is a message model.
So we can use it to message LMS in that case OpenAI models.
You can find it by simply searching for OpenAI.
And message model as a text action.
Here you can configure it and specify all the parameters.
But for now let's remove it because we have already configured this node in our workflow.
So let's open it.
And as you can see here.
As a resource we have text.
As operation we want to message a model.
But we can classify text for relations.
We can make a custom API calls.
But let's leave it for now.
Here we can choose LM we want to message to.
So in that case we are using GPT four mini which is very cost effective and very fast.
But you can easily switch to other llms like GPT 3.5 turbo, GPT four, GPT four or GPT four.
Oh.
Oh 1st May.
Basically you have access to all OpenAI's models.
Then as a message, we have a text.
We can simply expand it and make it bigger.
To switch to expression by clicking on this button here you can see how everything is structured.
So how the prompt looks like.
Go through this image summary and identify all key details mentioned.
Any specific issues to look at and actions items and use this format to output.
In this prompt we ask LLM.
So in that case GPT for all to use this format to output.
All the information.
So when we fetch all the emails, GPT four will summarize all these emails and use this JSON format
to structure the email we are going to receive as a summary.
So it's a summary of emails with point one, two and three.
We have actions, we have names.
And of course as the input data, we have all the emails fetched from the last 24 hours in a JSON format
as well.
Finally we have the Gmail node again.
So this time this node sends summarized email directly back to you.
So let's open it.
And your Gmail account should still be connected.
You have resource as a message, but you can also select label, draft or treat.
We want to send an email.
So we use send operation.
Here you can specify what email address you want to.
You want the email sent to.
So let's say I'm going to provide my email.
Now here is a subject.
We have the same code as in the previous node, so let's expand it.
As you can see and you also have a time zone.
As you can see this is the same code.
So here we specify the format we want to receive email in.
And we also have a time zone.
So now let's close it.
And when I scroll down you see that the email type we have HTML.
That's why in the message field we provide HTML structure.
But you can easily switch to text.
But remember to change the structure of the message as well.
So let's open it.
So this is the HTML of the message.
So basically thanks to this HTML code we receive beautifully formatted email with our summary.
You don't need to know how to write from scratch.
You can just simply copy and paste it.
Or you can always use ChatGPT or any other large language model to help you understand it.
Let us close it for now.
Here you have option to append an attribution, which basically means that at the bottom of the email
you will see information that the email was sent by an A-10.
But we don't need that.
Now let's test this workflow.
So let's press on Test Workflow button.
And now, as you can see, it stops at the edge image node because it fetches fetches image from the
past 24 hours starting from right now.
So if no new emails arrived in the last minute, there is nothing to summarize yet.
So to check this functionality and see how the how it goes through, just simply click on the second
node, go to settings.
And toggle this option.
To always output data.
And now when you click this workflow again.
You can see that it was successfully executed.
And now when I go to my email inbox you can see that it's working.
And I got in my summary but I, I didn't get any.
content because I didn't receive any email in the last couple of minutes.
So now let's go back to our workflow and let's open this node.
And as you can see here.
When I switch to JSON.
In the output section we see that the email was sent.
You have ID, threat id and label IDs and so on.
So now the last step is to make our workflow active.
Let's confirm it.
And now every single day at 7 a.m., I should receive a summary of my emails from the last 24 hours.
Beautifully formatted as you have seen.
It will look like that.
But with the actual summary of emails and actions.