WEBVTT

00:00.240 --> 00:05.200
In this video I will show you how I built this inbox manager that actually sorts my emails with only

00:05.200 --> 00:05.840
one click.

00:05.840 --> 00:12.280
I just need to click on this workflow and then actually my email is successfully sorted inside the newsletter.

00:12.600 --> 00:17.320
Also, I will have for you the other version that actually sorts your emails.

00:17.320 --> 00:24.080
So for example, if you have the emails in the past, you can sort your entire inbox at once.

00:24.560 --> 00:26.040
Because let me tell you something.

00:26.040 --> 00:30.080
If you have an inbox that is loaded with many different emails as mine.

00:30.080 --> 00:33.320
So for example, I've got over 3000 emails.

00:33.320 --> 00:38.400
Sometimes it's really hard to sort actually, and take these emails that are really important.

00:38.400 --> 00:43.840
So, you know, I've got a lot of notifications, I've got a lot of newsletters and there I can miss

00:43.840 --> 00:44.920
something out.

00:45.200 --> 00:48.360
That's why in this video we'll build this entire project.

00:48.360 --> 00:53.080
I will give you the free JSON template and also will build it from scratch.

00:53.080 --> 00:54.400
So you will see how it works.

00:54.400 --> 01:01.350
And again, with only one click, you can sort your entire inbox and also sort incoming emails whenever

01:01.670 --> 01:04.310
you receive an email on your Gmail.

01:04.710 --> 01:09.710
And for the simplicity, I included all of the instructions along with the free template to download

01:09.710 --> 01:12.830
inside our 100% free community on school.

01:12.990 --> 01:15.870
So there we've got our core students.

01:15.870 --> 01:21.430
There are other people interested in AI, so you can go over to the classroom and click on the Inbox

01:21.430 --> 01:22.030
manager.

01:22.230 --> 01:24.950
So inside you've got the prompt, you've got the system message.

01:25.070 --> 01:29.070
Also our template you can download right here.

01:29.190 --> 01:32.910
And when you do this you can click on these three dots import from file.

01:33.110 --> 01:35.510
And there pick your inbox manager.

01:35.950 --> 01:40.550
And inside actually you've got your automation already set up.

01:40.630 --> 01:42.990
So in general again um yeah.

01:43.030 --> 01:46.910
Go over here because we'll be using these instructions in this project.

01:47.230 --> 01:49.350
However, with all that being said let's get started.

01:49.350 --> 01:56.030
Let me click on Ctrl Z and undo this entire action and create this project from start to finish.

01:56.550 --> 02:00.820
So first things first, we'll be using Gmail as a trigger.

02:01.060 --> 02:02.500
So on message received.

02:02.500 --> 02:06.940
Whenever we've got a message we would like to trigger this entire automation.

02:07.100 --> 02:11.700
And then what we can do we can choose actually the pool times.

02:11.700 --> 02:14.540
So as you can see here we've got a mode which is every minute.

02:14.540 --> 02:19.900
So every minute it checks for any emails we have, um, you know inside our Gmail.

02:20.060 --> 02:26.580
However I don't recommend this approach because in this case you run out from your credits inside and

02:26.580 --> 02:27.500
I then very fast.

02:27.540 --> 02:27.980
Okay.

02:28.340 --> 02:35.380
So for this purpose I will I would like to trigger this automation every 15 minutes if we have the new

02:35.380 --> 02:35.980
message.

02:36.140 --> 02:37.900
So I can pick the custom.

02:38.020 --> 02:40.460
And then we've got cron expression.

02:40.900 --> 02:43.180
For this case we need to provide a specific code.

02:43.180 --> 02:51.780
If you're not familiar with the cron um you can go over for an example and type in cron expression every

02:51.820 --> 02:53.460
15 minutes for an example.

02:54.140 --> 02:58.850
And there you've got cron cron job every 15 minutes.

02:59.730 --> 03:01.770
And here you've got specified formats.

03:02.450 --> 03:03.730
So we can just copy it.

03:04.210 --> 03:09.890
Go over here, paste it there and it triggers every 15 minutes.

03:09.930 --> 03:12.650
Also there you've got it explained how it works.

03:12.650 --> 03:13.810
So you can just read it.

03:13.810 --> 03:21.450
So in general if you for example, want to run it every five minutes just instead of 15, type five

03:21.570 --> 03:28.090
or just, you know, go over to ChatGPT and ask for the specific code or just type inside, you know,

03:28.130 --> 03:29.290
type inside.

03:29.450 --> 03:35.730
Um, the Google I would like to trigger, um, you know, automation with the cron every five minutes

03:35.730 --> 03:39.530
or so, then, um, it will give you the exact code.

03:39.690 --> 03:41.610
However, this is a quick notification.

03:41.610 --> 03:47.610
Also, as I see here, I forgot to uncheck the simplify button because what it does, it simplifies

03:47.610 --> 03:48.570
our email.

03:48.610 --> 03:53.710
However, for this case for our agent we want to have the entire email, all of the variables and so

03:53.710 --> 03:54.190
on.

03:54.190 --> 03:58.110
So we can disable that and again fetch test event.

03:58.150 --> 04:01.950
Also we'll have more, you know more variables to choose.

04:01.990 --> 04:03.150
And it's nice.

04:03.310 --> 04:06.470
So again what it does we check every 15 minutes.

04:06.470 --> 04:07.910
If we have the new email.

04:08.430 --> 04:15.430
The next step inside our automation will be to filter because we want to check if the email has already

04:15.470 --> 04:16.910
a label or not.

04:17.110 --> 04:21.270
Otherwise, if it has a label like we don't want to process.

04:21.750 --> 04:30.990
Um, so in general what we do, we go over to the value and there we pick the labels zero here, this

04:30.990 --> 04:33.550
one variable and we um, yeah.

04:33.630 --> 04:34.150
Check.

04:34.670 --> 04:36.630
Um, does not contain them.

04:36.630 --> 04:41.150
So it does not contain the label, the word label.

04:41.990 --> 04:43.630
So we test the step.

04:43.750 --> 04:48.590
And as you can see item is kept and we don't have items discarded.

04:49.510 --> 04:56.260
Now we can go back to canvas and it's the time for our AI agent that will manage all of the stuff.

04:56.260 --> 04:58.380
So in general, we'll do all of the things.

04:58.420 --> 04:58.860
Okay.

04:59.500 --> 05:04.660
And here what we need to do, we need to provide a prompt we can go over simply to our document here

05:04.860 --> 05:07.660
and copy this entire text.

05:07.660 --> 05:10.780
So here inside we've got the topic description and sender.

05:11.540 --> 05:13.740
Um so in general we can go over there.

05:13.860 --> 05:16.900
Also when it comes to the subject, um, let me show you.

05:17.660 --> 05:19.100
And here you've got the subject.

05:19.100 --> 05:25.660
So I dragged and dropped this entire variable for um, let me delete it for the text.

05:25.820 --> 05:27.340
Um, I have here.

05:27.380 --> 05:29.860
Where do I have the text I have here the text.

05:29.860 --> 05:32.260
So again, you can simply do this.

05:33.100 --> 05:38.580
Um, however, even you can copy that from, um, you know, from our community, um, from our free

05:38.580 --> 05:39.260
document.

05:39.540 --> 05:41.740
Um, nevertheless, it works by this way.

05:41.740 --> 05:49.100
So we've got again the topic description sender and what we want to do, we want to add the system message.

05:49.490 --> 05:53.650
We will now actually define how this chatbot should behave.

05:53.930 --> 05:57.930
So also inside here we've got our system message.

05:58.290 --> 06:01.290
And very shortly I will explain what it does.

06:01.290 --> 06:03.570
So let's move to expression.

06:03.570 --> 06:08.570
So your role you're an intelligent ML assistant responsible for sorting incoming messages.

06:08.570 --> 06:13.730
Your task is to analyze the content, subject and sender of each email and assign it to the appropriate

06:13.730 --> 06:14.450
category.

06:14.490 --> 06:15.090
Categories.

06:15.090 --> 06:20.690
Categories for sorting, priority, business, newsletter, administrative, personal notifications,

06:20.690 --> 06:21.490
and spam.

06:21.930 --> 06:23.730
You can change these categories okay.

06:23.770 --> 06:30.090
You can provide your very own I don't know, um, I just thought like these categories will be proper.

06:30.210 --> 06:35.170
However, again you can add some categories and later on like modify your entire automation.

06:35.170 --> 06:36.490
You can change the names.

06:36.490 --> 06:41.970
However, as usual, if you are building this automation together with me, I encourage you to actually

06:42.170 --> 06:44.690
do it first together with me and then change it.

06:44.690 --> 06:50.280
So first you check if it works or not and then you've got the, you know, point of view, how it should

06:50.280 --> 06:50.680
work.

06:51.080 --> 06:53.400
Nevertheless, we've got the instructions for each email.

06:53.400 --> 06:55.320
Analyze the content, subject and sender.

06:55.360 --> 06:58.960
Assign it to the appropriate category at label with the category.

06:58.960 --> 07:05.560
If you are unsure, do not label the message response formats we've got always return the result in

07:05.560 --> 07:09.400
JSON format, so we just get only the category.

07:10.160 --> 07:11.480
And now what we can do.

07:11.920 --> 07:15.000
Um, we can go over here and add the model.

07:15.000 --> 07:16.600
So let's go over back to canvas.

07:16.960 --> 07:22.120
Um, I'm choosing OpenAI chat model which is GPT four or mini.

07:22.400 --> 07:23.320
It's cheap.

07:23.360 --> 07:24.000
It's good.

07:24.120 --> 07:24.920
Uh that's it.

07:24.920 --> 07:25.400
Okay.

07:25.640 --> 07:26.880
Um, you can choose other models.

07:26.880 --> 07:28.000
You've got a lot of them.

07:28.240 --> 07:30.800
Um, you know, actually, we've got some problem for now, however.

07:30.840 --> 07:31.400
Whatever.

07:31.680 --> 07:34.680
Um, yeah, I need to connect different OpenAI account.

07:34.960 --> 07:42.640
Um, so here you've got, for example, GPT four four, um, 4.1 mini nano, which is pretty, you know,

07:42.800 --> 07:43.440
pretty cheap.

07:43.440 --> 07:46.110
Also cheaper than for mini, Romine, however.

07:46.390 --> 07:46.910
Um, yeah.

07:46.950 --> 07:47.790
Pick your model.

07:48.350 --> 07:53.950
Additionally, for this agent, we need to go over there and require specific output format.

07:54.270 --> 07:56.710
So we would like to provide the output parser.

07:56.830 --> 07:57.670
And why?

07:58.070 --> 08:05.070
Um, because we want to actually indicate the entire, um, form of the response to make it even.

08:05.150 --> 08:05.670
Um, yeah.

08:05.710 --> 08:11.710
To make it even more correct for this case, from here we need to provide this entire data.

08:11.710 --> 08:16.150
So let's copy it and let's provide inside our output parser.

08:16.510 --> 08:17.190
That's correct.

08:17.190 --> 08:20.030
We've got output parser and their email label.

08:20.030 --> 08:22.070
So this will be the variable name.

08:22.230 --> 08:25.230
And in the variable we should have the specific category.

08:25.870 --> 08:26.790
After we do this.

08:26.790 --> 08:28.150
For now let's run it.

08:29.870 --> 08:35.590
So as you can notice it shows the newsletter label for our email which is pretty nice.

08:35.590 --> 08:41.630
We only wanted this word to return okay, so decide which label it is.

08:42.550 --> 08:44.620
And even now let me actually.

08:44.780 --> 08:44.980
Um.

08:44.980 --> 08:45.300
Yeah.

08:45.340 --> 08:47.820
Change, um, change the names of that.

08:48.620 --> 08:56.180
So here, label checker, rename it, um, there for an example.

08:56.860 --> 08:58.260
Give a label.

08:58.620 --> 08:59.300
That's nice.

09:00.020 --> 09:06.500
And there is a time for the switch option that allows us to actually process with different actions

09:06.500 --> 09:09.900
based on, um, you know, the response from our model.

09:10.340 --> 09:16.300
So we choose the switch and there the value one is our email label.

09:16.700 --> 09:20.780
And we check if it's equal, um, our categories we want to get.

09:20.780 --> 09:22.580
So first we've got priority.

09:23.500 --> 09:28.300
Then what we do rename output and then we name it as priority.

09:28.780 --> 09:32.620
With big letter we add routing rule.

09:32.620 --> 09:36.980
So there again we go over and we provide email label.

09:37.420 --> 09:41.760
And then we check it for um there we've got Personal.

09:42.120 --> 09:42.960
So here.

09:43.000 --> 09:43.720
Personal.

09:45.040 --> 09:45.560
Rename.

09:45.600 --> 09:46.080
Rename.

09:46.120 --> 09:46.520
Output.

09:46.520 --> 09:46.960
Label.

09:46.960 --> 09:48.080
So personal.

09:48.360 --> 09:49.000
All right.

09:49.440 --> 09:52.240
Another road will be for notifications.

09:52.360 --> 09:59.280
So again we take email label notifications notifications.

09:59.880 --> 10:06.880
And remember actually to type these names actually these words with small letters.

10:07.160 --> 10:13.680
Because here we've got actually newsletter newsletters that start that starts with the small letter

10:13.720 --> 10:16.240
also is typed in with the small letters.

10:16.640 --> 10:24.320
Um so yeah that's why we are using renamed output variable to just provide big letters notifications.

10:24.440 --> 10:30.600
So now actually what I need to do, I need to fulfill, um, you know, provide other routing rules

10:30.840 --> 10:33.840
for uh, for other different labels.

10:33.920 --> 10:39.870
So here when I open my system message, I've got a newsletters, administrative personal Sonal notifications

10:39.870 --> 10:40.670
and spam.

10:41.790 --> 10:42.550
So I've done it.

10:42.590 --> 10:43.510
It looks like this.

10:43.550 --> 10:44.550
And all it does again.

10:44.590 --> 10:45.950
Actually, whenever we have.

10:45.990 --> 10:47.430
For example newsletters.

10:47.710 --> 10:48.390
Um, yeah.

10:48.430 --> 10:49.550
Here label.

10:49.830 --> 10:52.150
It goes with this specific path.

10:52.150 --> 10:53.470
So we've got newsletters.

10:53.950 --> 10:57.390
If the email is priority it goes with this path.

10:57.390 --> 11:00.950
And we just store this email in the priority label.

11:01.510 --> 11:09.550
And for each kind of route we need to and for each path each route we need to add the Gmail step.

11:09.830 --> 11:12.110
So in general we need to add Gmail.

11:12.110 --> 11:14.630
And we want to add label to message.

11:15.390 --> 11:18.310
And here we just execute previous notes.

11:18.870 --> 11:24.710
So there as you can notice we don't have a message because our message was um yeah categorized to the

11:24.710 --> 11:25.590
newsletters.

11:25.830 --> 11:27.470
So let's go over here.

11:27.510 --> 11:31.070
Pick again Gmail add label to message.

11:31.950 --> 11:34.110
And there we've got the message ID.

11:34.550 --> 11:40.940
So for this case we can scroll down or even collapse For an example, this node and there take the id

11:40.940 --> 11:42.260
from the Gmail trigger.

11:42.260 --> 11:45.660
So we've got message id and here even we've got the problem.

11:45.660 --> 11:48.700
So for this case what we can do to solve it type first.

11:48.700 --> 11:50.740
So it takes the first message.

11:50.780 --> 11:52.980
And we have inside our inbox.

11:53.380 --> 11:57.460
And this often occurs when we have multiple items.

11:57.700 --> 12:01.940
So yeah like if you have that on the red highlighted on the red.

12:02.180 --> 12:07.780
And just provide the first and it works, you actually indicate that, hey, take the first email from

12:07.780 --> 12:09.940
the inbox, the latest.

12:10.220 --> 12:14.380
And for that so what we have and we can rename it as the priority.

12:15.300 --> 12:17.700
Priority okay.

12:17.740 --> 12:21.940
We can rename it and then choose the label which is priority.

12:22.180 --> 12:25.740
And however before what's very important we need to go over to our email.

12:25.740 --> 12:27.380
So let me go to my email.

12:27.660 --> 12:32.900
I used other email for this case and there already I provided my labels.

12:32.900 --> 12:37.050
So I've got administrative business newsletter notifications personal priority.

12:37.410 --> 12:39.570
And when I was creating this automation for you.

12:39.610 --> 12:43.090
However, if you want to add the label, click here and add it.

12:43.370 --> 12:47.090
So there for an example, let's say um, I don't know health.

12:47.250 --> 12:48.050
It's not related.

12:48.090 --> 12:51.290
However, you know, that's how you add the label.

12:51.970 --> 12:56.810
And when you add your labels you go you go over there and choose.

12:56.810 --> 12:57.890
We've got the priority.

12:57.930 --> 12:59.050
You choose priority.

12:59.530 --> 13:03.930
We test the step and it should be classified to our priority.

13:03.930 --> 13:05.650
So it worked for sure.

13:06.330 --> 13:11.090
And we need to do the stuff for all of the, you know, for all of the for all of the paths.

13:11.090 --> 13:18.290
So what we can do, we can click here, click Ctrl D to duplicate and just provide all of the nodes

13:18.290 --> 13:19.330
for each path.

13:21.210 --> 13:26.450
So we've got 123456, seven, seven, um different labels.

13:26.450 --> 13:28.930
So we've got um, actually six items.

13:28.930 --> 13:30.370
Let's provide another one.

13:31.290 --> 13:31.930
Uh, okay.

13:32.330 --> 13:39.120
And as you could notice here inside our Gmail, we don't have there in the labels the spam.

13:39.120 --> 13:44.920
And this is why actually it's due to we have the spam already inside our inbox.

13:44.920 --> 13:47.760
So we haven't provided the label, which is spam.

13:47.800 --> 13:48.760
Yeah right there.

13:48.800 --> 13:53.040
We'll be using this spam label for this case.

13:53.040 --> 13:59.320
What I can do, I can simply connect all of these to my automation, change the name.

13:59.360 --> 14:01.280
Actually, let me go over here.

14:01.280 --> 14:02.440
I can change the name.

14:02.440 --> 14:05.160
So firstly we've got what we firstly had.

14:05.160 --> 14:05.840
Let's see.

14:06.440 --> 14:09.600
Um, firstly we had um the priority.

14:09.600 --> 14:11.280
This is the priority okay.

14:11.720 --> 14:13.320
So we've got the priority.

14:14.960 --> 14:16.080
Let's rename it.

14:16.120 --> 14:20.160
Actually we need to firstly um yeah this one changed to the newsletter.

14:20.720 --> 14:21.520
Um, yeah.

14:21.520 --> 14:26.240
So actually it's um, you need to do it by this way newsletters.

14:27.880 --> 14:33.710
However, afterwards and when it's set up, um, you can use it for a long time.

14:33.990 --> 14:35.790
So you've got priority there.

14:35.790 --> 14:39.190
You can see you've got you've got message ID that is proper there.

14:39.190 --> 14:42.270
You can't choose it because it didn't choose this path.

14:42.270 --> 14:43.950
It wasn't the priority message.

14:43.950 --> 14:46.590
So we only have the data inside the newsletters.

14:46.630 --> 14:49.230
However we copy this, um, note.

14:49.230 --> 14:52.350
So now we can use the variable right there.

14:52.590 --> 14:55.670
And only what we need to do is to change the label.

14:55.830 --> 15:00.310
So here we have the priority um, there in the newsletters.

15:00.350 --> 15:06.990
And we had um right there, um, the priority, however we have the newsletter right there.

15:07.030 --> 15:12.150
What we have, um, this is the personal so we can rename it as personal.

15:12.870 --> 15:15.390
Very, very simply personal.

15:15.910 --> 15:16.470
Okay.

15:16.670 --> 15:19.270
And there just change the label to personal.

15:19.470 --> 15:21.390
It's simple as that.

15:21.390 --> 15:22.590
So we have personal.

15:22.750 --> 15:24.750
So now let me change all of these.

15:25.950 --> 15:32.610
So this is how you create the entire automation to sort your emails into specific labels, and I think

15:32.610 --> 15:33.450
it's really useful.

15:33.490 --> 15:37.130
A lot of us have like, mess inside our inbox for sure.

15:37.170 --> 15:39.570
Me so yeah, that's how it works.

15:39.610 --> 15:44.570
And with this single kind of automation, you can sort your emails.

15:44.970 --> 15:52.970
However, I said at the beginning and I showed the other automation that sorts your inbox and old messages.

15:53.410 --> 15:59.330
And in general, it's pretty straightforward to create because what you do, you copy all of these steps.

15:59.570 --> 16:04.970
So all of these notes and then only what you do you you provide the trigger which is different, which

16:04.970 --> 16:08.330
is on click you get messages from the Gmail.

16:08.330 --> 16:09.930
So let me show you how it looks like.

16:09.970 --> 16:13.130
Also remember you can download the full template.

16:13.130 --> 16:15.450
So here you will be able to see how it works.

16:15.730 --> 16:18.130
You know you can just set it up by this way.

16:18.170 --> 16:20.690
Nevertheless let me guide you through that very quickly.

16:20.890 --> 16:24.610
So in general inside the Gmail we get many emails.

16:24.610 --> 16:25.930
The limit is 15.

16:25.930 --> 16:28.320
So at the like at once.

16:28.320 --> 16:38.240
We get 15 emails and then what we do, we provide a filter and again we check if the email has has already

16:38.280 --> 16:39.520
a label or not.

16:39.680 --> 16:41.520
And now let me show you how it works.

16:41.600 --> 16:45.040
So in my account I have like these numbers.

16:45.040 --> 16:49.560
So in the newsletter I've got five emails and notifications I've got nine.

16:49.560 --> 16:51.080
And the priority I've got one.

16:51.600 --> 16:54.360
And however if I click let me go over here.

16:54.360 --> 17:01.560
If I click on Test Workflow now it takes 15 emails and it will sort everything.

17:01.960 --> 17:05.920
When I zoom up you can see like we've got five items already.

17:06.080 --> 17:09.960
Um, given like the category for them, 1011.

17:10.280 --> 17:16.240
So just it creates 15 different, um, you know, categories.

17:16.240 --> 17:19.760
It sorts our emails into 15 different labels.

17:20.480 --> 17:25.400
So as you can see we've got 13 notifications and two newsletter.

17:25.400 --> 17:26.550
So let's check it.

17:26.910 --> 17:28.150
Let's go over here.

17:28.150 --> 17:31.310
Let's refresh the page and that we have it.

17:31.350 --> 17:33.590
We've got notifications newsletter.

17:33.710 --> 17:35.390
So this automation works.

17:35.710 --> 17:42.310
And in general feel free to change actually the amount of um yeah of getting the emails.

17:42.310 --> 17:47.150
You can actually I don't know modify it to 100 for 120.

17:47.190 --> 17:48.910
Remember it will take more time.

17:48.910 --> 17:53.030
Nevertheless you've got more items you know like sorted at once.

17:53.150 --> 17:58.350
So for example, let me pick 50 for now and let's see how it works.

17:58.350 --> 17:59.630
So test workflow.

18:00.270 --> 18:04.230
So it takes 50 latest emails for us.

18:05.070 --> 18:07.790
Um and yeah our chat.

18:08.030 --> 18:10.510
So our agent will sort everything up.

18:10.910 --> 18:16.950
And I think it's great automation for me it's really worth to use because for an example like here in

18:16.950 --> 18:19.190
one click you can sort your entire inbox.

18:19.590 --> 18:21.510
Uh, for now, thank you for watching this material.

18:21.510 --> 18:24.950
I hope you enjoyed it and I will see you in the next video.
