WEBVTT

00:00.440 --> 00:01.200
Hi there.

00:01.720 --> 00:10.880
In this episode, I'm going to teach you how to build a super practical automation, which is a Gmail

00:10.880 --> 00:12.760
inbox manager and classifier.

00:13.880 --> 00:22.400
So this AI powered email system replies to customers automatically based on the content of their message.

00:23.840 --> 00:27.080
So this automation a automation.

00:30.680 --> 00:31.840
Extract names.

00:32.040 --> 00:36.200
Understand what type of email it is like.

00:38.400 --> 00:41.960
Service requests and consultation.

00:41.960 --> 00:46.680
Request payments and then generate a smart reply.

00:48.920 --> 00:54.880
This way you can respond to leads or customers instantly, even when you sleep.

00:57.600 --> 01:08.940
Also, this automation is going to label all your incoming emails and push them into specific categories.

01:12.500 --> 01:13.980
So you can review them later.

01:16.100 --> 01:23.620
And you can have all emails categorized and you can have all emails organized like that.

01:24.540 --> 01:31.660
This AI automation is very useful because your customers get an immediate reply with the next steps,

01:31.820 --> 01:38.220
which is great customer support, so you can use it for many cases and adapt it to your needs.

01:39.060 --> 01:43.260
This time we are going to build this awesome automation completely from scratch.

01:44.540 --> 01:46.300
So let's create a new workflow.

01:46.660 --> 01:48.060
All right so let's get started.

01:48.460 --> 01:50.660
So first we are going to create a workflow.

01:52.860 --> 01:59.190
So this is AI automation is going to read incoming emails understand what the email is about.

01:59.710 --> 02:02.870
As always, every automation starts with a trigger node.

02:03.390 --> 02:06.590
In that case, we want to connect our Gmail account.

02:06.630 --> 02:08.870
So let's search for Gmail.

02:10.310 --> 02:17.310
You can do it by adding a new node on app event and search for Gmail.

02:19.630 --> 02:22.550
Or the second way is to add first step.

02:24.950 --> 02:27.990
On app event and search for Gmail.

02:30.230 --> 02:30.950
Scroll down.

02:31.990 --> 02:32.830
Choose this one.

02:35.310 --> 02:40.950
So our automation will activate on message received.

02:44.190 --> 02:48.550
Now make sure to connect your Gmail account here if you haven't done it before.

02:49.790 --> 02:57.770
Just go to the How to set up credentials section and you will find a separate tutorial on how to do

02:57.770 --> 02:58.050
it.

02:58.410 --> 03:08.130
You can simply if you are using a cloud or a cloud version of N810, you can just create a new credential

03:08.130 --> 03:11.930
and sign in with Google and then hit save.

03:14.530 --> 03:20.770
If you are using self-hosted version of N810, you need to do manual setup.

03:21.210 --> 03:30.650
You can also find a tutorial on how to find API keys, uh, in the How to Setup credentials section.

03:34.490 --> 03:42.210
Now, the shortest polling interval for Gmail is every minute, and that's perfect for this use case.

03:42.890 --> 03:47.530
But if you if you like you can change it to every hour every day.

03:48.370 --> 03:56.470
So basically this node will check your Gmail inbox In that interval.

03:59.830 --> 04:02.110
As event we want to leave it as it is.

04:02.110 --> 04:03.190
So message received.

04:03.470 --> 04:05.110
I think there is no other option here.

04:06.630 --> 04:13.710
And also disable simplify response because we want to get the full email data.

04:15.230 --> 04:15.430
All right.

04:15.430 --> 04:17.150
So now this node is configured.

04:17.190 --> 04:19.310
Now let's add next node.

04:23.150 --> 04:28.590
So now we want to extract data from the emails.

04:29.790 --> 04:33.270
So we need to add information extractor node.

04:33.670 --> 04:35.750
So let's search for information extractor.

04:38.750 --> 04:47.630
Now once you successfully connected your Gmail account to N810 you can give it a test to get some data

04:47.630 --> 04:48.630
into our flow.

04:49.750 --> 04:55.720
So it will fetch The last emails from your Gmail inbox.

04:57.040 --> 04:58.320
So let's test the workflow.

05:01.480 --> 05:03.960
As you can see, workflows executed successfully.

05:03.960 --> 05:05.440
Now let's open this node again.

05:08.240 --> 05:11.600
And as you can see we received some data in a JSON.

05:11.680 --> 05:13.960
You can see it in a JSON format.

05:17.440 --> 05:18.400
Or in schema.

05:20.440 --> 05:26.640
So use schema format in order to drag and drop variables and objects.

05:29.320 --> 05:32.400
So now we want to extract the sender's name.

05:33.120 --> 05:38.920
So in the reply we can use this name as a dynamic variable.

05:39.520 --> 05:42.600
So we can create personalized emails.

05:43.480 --> 05:48.600
And our AI automation will use the first name of the sender's.

05:52.260 --> 05:56.620
So let's search for information extractor.

05:57.700 --> 06:03.780
And in this step will also connect LM to give it some intelligence.

06:10.620 --> 06:11.300
Is this one.

06:14.060 --> 06:19.620
Now before we configure this node let's quickly add the LM.

06:19.980 --> 06:23.660
So it will be the brain of this node.

06:23.700 --> 06:26.940
And actually of this automation.

06:29.060 --> 06:32.500
So here you can add different large language models.

06:37.420 --> 06:44.460
We are going to use OpenAI GPT four mini because it's cost effective and very fast.

06:45.540 --> 06:47.060
So let's search for OpenAI.

06:49.630 --> 06:50.710
Personalized model.

06:52.790 --> 07:02.950
I already connected mine OpenAI account to my N810 instance, so it's saved and I can use it in every

07:02.950 --> 07:03.630
workflow.

07:05.470 --> 07:11.390
If you don't know how to do it, go to how to set up credentials section and you will find a separate

07:11.430 --> 07:12.190
tutorial.

07:14.310 --> 07:23.150
Where I show you how to find an API keys in an OpenAI API platform account.

07:26.310 --> 07:31.470
Here you can switch between different OpenAI models.

07:33.710 --> 07:38.470
As you can see, you have GPT 3.5 turbo.

07:40.710 --> 07:49.610
GPT four and GPT four roaming, etc. you also have embeddings, model and Audio models.

07:51.810 --> 07:53.530
Let's stick with GPT three.

07:56.330 --> 07:58.130
Now let's configure this node.

08:01.650 --> 08:06.890
So we want to extract the sender's name right.

08:08.010 --> 08:12.810
So in order to do that we have to add new attribute and give it a name.

08:14.610 --> 08:16.970
So send the name.

08:18.690 --> 08:19.930
The type will be string.

08:21.210 --> 08:22.970
You don't need to change anything here.

08:25.130 --> 08:26.450
And as a description.

08:29.650 --> 08:35.290
Basically description helps the AI understand what we are asking it to look for.

08:35.690 --> 08:37.850
And we are giving it a specific task.

08:38.650 --> 08:43.130
So in that case you want it to extract.

08:46.670 --> 08:48.270
And the sender's name.

08:55.070 --> 08:55.910
From this email.

09:00.150 --> 09:10.590
And if no name is found, because sometimes people don't, uh, use their name in greetings.

09:11.150 --> 09:12.190
In the greetings.

09:13.750 --> 09:14.110
So.

09:16.390 --> 09:22.390
To avoid any potential issues, we can guide our, um.

09:24.630 --> 09:26.350
Model to return.

09:29.310 --> 09:31.790
An empty string.

09:35.310 --> 09:35.950
Great.

09:38.390 --> 09:43.670
Now, in the text field, we are going to provide the body of the email.

09:44.390 --> 09:51.600
So GPT four mini will be able to go through this email body and extract the sender name.

09:52.800 --> 09:56.960
So let's search for a text variable.

09:58.040 --> 10:00.160
So let's scroll down.

10:01.160 --> 10:03.280
Actually it's somewhere here.

10:03.840 --> 10:06.240
Yes you can see text.

10:06.240 --> 10:08.520
So this is the actual content of the email.

10:09.720 --> 10:14.640
So you can simply drag this variable and drop it like that.

10:16.280 --> 10:17.400
You can also.

10:19.560 --> 10:25.200
Do it manually by typing two curly braces.

10:27.160 --> 10:31.560
And I will suggest you it automatically.

10:32.640 --> 10:34.760
So you can use JSON.

10:35.560 --> 10:42.240
Then dot and you can find text.

10:44.860 --> 10:45.380
Great.

10:48.180 --> 10:56.980
So the last thing we need to configure in this node is the system prompt, which is simply means giving

10:57.020 --> 11:02.260
clear instructions to the AI on how it should behave and what to focus on.

11:02.540 --> 11:07.500
In that case, what to focus on when extracting the information.

11:07.940 --> 11:15.100
And you can add system prompt in Information extractor node by adding option.

11:18.860 --> 11:22.740
And here we have default prompt.

11:23.900 --> 11:26.020
You are an expert extraction algorithm.

11:26.220 --> 11:28.340
Only extract relevant information from the text.

11:28.340 --> 11:32.100
If you don't know the value of attribute, ask to extract.

11:32.420 --> 11:36.660
You may omit the attribute value so we can leave it like that.

11:38.220 --> 11:39.620
So now let's uh.

11:41.620 --> 11:46.160
But if you wish, you can also modify this prompt.

11:46.840 --> 11:47.800
For example.

11:50.160 --> 11:51.760
I can add something like.

11:54.000 --> 11:56.480
Going to paste it right here.

11:59.000 --> 12:00.960
You are an advanced extraction tool.

12:01.320 --> 12:04.320
Only pull out the relevant details from the text.

12:04.560 --> 12:11.680
If you are unsure about the value of any requested attribute, leave it as an empty string.

12:14.000 --> 12:15.280
Both will work just fine.

12:15.960 --> 12:18.360
So now let's close this node and let's move on.

12:20.720 --> 12:22.080
Now let's hit save.

12:24.200 --> 12:27.040
And let's give it a test so you can see the output.

12:31.680 --> 12:32.360
Great.

12:32.720 --> 12:33.800
So let's open it.

12:35.480 --> 12:36.280
As you can see.

12:38.760 --> 12:43.970
The sender name of my last email is Damien because I've sent email to myself.

12:44.730 --> 12:46.570
Okay, so it's working perfectly fine.

12:47.970 --> 12:49.610
Now let's add another node.

12:52.530 --> 12:59.010
Now we need to add a bit of logic because sometimes people don't stay emails by showing their name.

12:59.410 --> 13:02.850
So we want to account for that possibility too.

13:03.250 --> 13:07.690
So let me show you how to handle this by using an if node.

13:08.290 --> 13:09.890
So let's search for if node.

13:15.170 --> 13:19.770
And then we can as you can see then we can.

13:22.410 --> 13:25.170
Route items to different branches.

13:25.650 --> 13:26.970
So true and false.

13:29.650 --> 13:31.210
So let's configure this node.

13:32.770 --> 13:41.830
So in this node we want to check if the new email includes the sender's name, so you can simply drag

13:41.830 --> 13:47.910
and drop the sender name variable over here.

13:50.550 --> 13:57.830
And you want to change the condition from is equal two to string and is not empty because we want to

13:57.830 --> 14:04.270
check if the sender name variable includes the sender name or not.

14:04.270 --> 14:12.190
So in other words, if our, uh, email body includes the sender name or not.

14:12.950 --> 14:14.950
So in that case we are going to use this one.

14:16.710 --> 14:17.070
All right.

14:17.070 --> 14:18.230
That's it for this one.

14:21.310 --> 14:22.310
Let's just move it here.

14:23.310 --> 14:26.470
As you can see you have two branches true and false.

14:27.830 --> 14:37.960
So if our email includes the sender name we are going to do something.

14:39.360 --> 14:43.480
Otherwise we are going to a different path.

14:44.440 --> 14:46.400
So if the eye on the name.

14:48.560 --> 14:52.120
It will go down the true path.

14:53.120 --> 14:55.960
If it didn't, it will go down the false path.

14:57.320 --> 14:58.880
So let's handle both cases.

15:00.640 --> 15:04.640
So we want to create an introduction message based on the name.

15:06.160 --> 15:14.960
So for the true path let's add set node to set items to variables.

15:16.240 --> 15:19.880
You can modify and add them using this node as well.

15:22.160 --> 15:29.720
And now let's we can leave manual mapping as it is originally.

15:31.920 --> 15:32.880
By default.

15:34.120 --> 15:40.100
And now we are going to create a new variable called intro.

15:44.140 --> 15:51.220
And actually we can test the steps so we can get some data so we can easily drag and drop variables.

15:54.620 --> 15:57.060
As you can see we have input data.

15:58.380 --> 15:59.660
We can output data.

16:00.660 --> 16:02.020
Here we have configuration.

16:04.700 --> 16:06.940
So now let's.

16:09.260 --> 16:14.060
So now as a intro let's use the sender name.

16:17.540 --> 16:18.420
Okay great.

16:20.820 --> 16:22.300
So that's it for this node.

16:24.020 --> 16:27.260
Now let's handle the second case.

16:28.860 --> 16:37.840
If the I didn't find the sender name in the email, so click Add note.

16:39.200 --> 16:40.600
Let's search for set note again.

16:45.280 --> 16:50.560
Let's create a variable.

16:53.160 --> 16:54.360
The same name.

16:54.360 --> 16:55.200
So intro.

16:59.920 --> 17:10.640
But in that case, because we don't know the name of the sender, we want the AI to reply by just saying

17:10.640 --> 17:13.000
hi at the beginning of the email.

17:18.640 --> 17:19.360
All right.

17:22.120 --> 17:22.640
Perfect.

17:22.640 --> 17:27.880
Now I'm going to show you a cool tip which can save you a lot of time and API calls.

17:28.520 --> 17:37.570
I'm going to record a separate lesson About this method, but it's very handy.

17:37.570 --> 17:43.570
So in every node, almost in every node you can pin data.

17:44.050 --> 17:52.970
So when I have tested workflow previously I got some data into the flow.

17:52.970 --> 17:53.370
Right.

17:53.690 --> 17:55.570
So this is the last email I received.

17:56.370 --> 17:58.130
And here you can pin this data.

18:00.490 --> 18:05.570
So you don't need to fetch the new email which arrives after this one.

18:05.610 --> 18:08.090
You can use this one to test our workflow.

18:08.370 --> 18:15.370
You can use this data to test our workflow and build on top of that.

18:15.370 --> 18:23.690
So if as a trigger node, you make API calls to a third party service to a third party platform which

18:23.690 --> 18:29.930
is paid, it can takes a lot of API credits.

18:30.490 --> 18:30.970
And.

18:33.310 --> 18:35.510
Over time can cost you a lot of money.

18:36.710 --> 18:39.950
So this method can save you a lot of time and money.

18:41.750 --> 18:44.150
Also, you can pin data.

18:46.790 --> 18:48.190
In let's say.

18:50.270 --> 18:51.030
This node.

18:54.070 --> 19:01.070
And when we add more nodes you can test your workflow starting from this node.

19:01.710 --> 19:07.790
So it can save you a lot of time because we don't need to trigger our workflow.

19:10.830 --> 19:12.110
By the trigger node.

19:12.950 --> 19:14.470
We can test it from this step.

19:16.390 --> 19:16.670
All right.

19:16.670 --> 19:17.710
So now let's move on.

19:22.870 --> 19:23.310
Perfect.

19:23.350 --> 19:31.400
Now we have two versions of the introduction depending on the on whether a name was fond or not.

19:32.440 --> 19:41.040
So the next step is to bring the flow back together so we can use a merge node to match the paths.

19:41.520 --> 19:43.440
So let's search for merge node.

19:48.720 --> 19:53.920
Let's connect the second set node to the merge node.

19:54.680 --> 19:55.680
The second input.

19:56.880 --> 19:58.200
Now let's configure this node.

20:03.440 --> 20:04.360
As a mode.

20:04.480 --> 20:07.120
As you can see how input data should be merged.

20:07.160 --> 20:08.200
We want to combine.

20:08.200 --> 20:11.440
So we want to merge matching items together.

20:13.200 --> 20:13.720
Right.

20:15.800 --> 20:19.920
Now we are going to keep the setting as matching fields.

20:19.920 --> 20:29.020
Because both of our set nodes, the one with the name from the email I sent to myself and the one we,

20:29.060 --> 20:32.060
uh, thought have a field called intro.

20:32.740 --> 20:34.540
And that's what we are merging.

20:35.260 --> 20:38.860
So now the values themselves won't actually match.

20:39.540 --> 20:45.700
One might say they're adaptive at gmail.com and the other just high.

20:46.500 --> 20:52.620
So to make sure the merge node keeps whichever value is available, we need to switch the option to

20:54.540 --> 20:55.540
keep not matching.

20:55.540 --> 21:01.780
So that way only the the one that worked gets passed through and the workflow continues with the correct

21:01.780 --> 21:02.340
greeting.

21:03.420 --> 21:05.500
So let's switch to keep node matches.

21:08.500 --> 21:15.820
And also you want to drag and drop the intro value to this field.

21:17.300 --> 21:18.500
So the fields to match.

21:20.780 --> 21:23.060
As you have specified in the set nodes.

21:25.900 --> 21:26.340
See.

21:28.800 --> 21:33.480
So you have the same name in both set nodes.

21:39.440 --> 21:41.040
And now when you test the workflow.

21:45.760 --> 21:51.280
As you can see we ended up with the intro data at gmail.com.

21:53.880 --> 21:55.320
So it went through this path.

22:01.640 --> 22:07.120
Because we actually managed to extract the the sender name.

22:09.080 --> 22:16.800
Now before we add the node to classify the emails, let's organize the data we'll need later.

22:17.640 --> 22:21.680
So the next node will be that node again.

22:24.840 --> 22:33.650
And now we are going to add variables to help AI to reply to emails.

22:35.810 --> 22:40.090
So first we need message ID.

22:41.570 --> 22:44.170
So we'll be able to reply to the email.

22:48.410 --> 22:52.290
And let's rename it to message ID.

22:53.690 --> 22:59.970
Also let's rename the note itself to in data.

23:03.530 --> 23:05.050
We also need the thread id.

23:06.810 --> 23:08.810
So again from the Gmail trigger note.

23:12.850 --> 23:17.650
And the last one we also need the email body.

23:18.730 --> 23:20.570
So the actual content of the email.

23:22.370 --> 23:30.550
So that email trigger note fetches all the emails from our Gmail inbox, so it should be somewhere here.

23:32.670 --> 23:33.430
In this note.

23:33.430 --> 23:37.950
So yeah, as you can see we have a text here.

23:38.830 --> 23:40.430
So let's simply drag and drop it.

23:41.990 --> 23:42.430
Great.

23:42.430 --> 23:42.950
Awesome.

23:43.670 --> 23:44.550
So that's it for this note.

23:44.590 --> 23:46.110
Now we can classify the emails.

23:50.510 --> 24:00.990
Right now we want to use AI to figure out what the email is about and classify, um, emails based on

24:01.030 --> 24:02.110
the email body.

24:03.350 --> 24:06.110
So there is a dedicated node for this operation.

24:06.950 --> 24:11.590
It's called a text classifier.

24:14.230 --> 24:14.670
Yep.

24:17.150 --> 24:26.650
And actually it is easy to add this node from here, rather than from the this main plus button, but

24:26.650 --> 24:28.330
we can simply connect it like that.

24:30.250 --> 24:30.770
All right.

24:30.810 --> 24:36.410
Now we need to add the large language model so as a brain for this node.

24:37.930 --> 24:41.810
So to add AI capabilities.

24:42.530 --> 24:44.650
So we are going to use OpenAI again.

24:47.970 --> 24:50.570
And we want to use the same model as in the previous node.

24:52.610 --> 24:54.810
So let's keep it simple like that.

24:57.490 --> 25:03.170
Then we want to provide the actual text we want to classify.

25:04.490 --> 25:10.450
So the body email which is uh which as you can see.

25:13.530 --> 25:16.570
We close in the text variable.

25:21.180 --> 25:26.500
So we are looking for a text field and we need to drop it like that.

25:27.700 --> 25:28.700
Okay, great.

25:32.660 --> 25:38.180
Now we are gonna add categories with short descriptions like in this example.

25:40.580 --> 25:41.860
So add category.

25:46.060 --> 25:49.380
And the first one will be service request.

25:59.260 --> 26:00.420
And the description.

26:04.100 --> 26:12.940
Sorry this one questions about services offered or availability.

26:13.540 --> 26:15.060
We're just going to copy and paste it.

26:18.780 --> 26:25.200
Now let's jump into my gmail inbox and create libraries so it will be easier for you to visualize.

26:25.200 --> 26:26.840
Visualize how it works.

26:29.400 --> 26:35.600
Now we are inside my Gmail inbox, so let's add the corresponding labels so the AI can classify our

26:35.600 --> 26:36.120
emails.

26:36.920 --> 26:39.160
So the first one was a.

26:44.200 --> 26:49.160
Service requests consultation requests also in payments and others.

26:51.400 --> 26:52.760
So let's do it one by one.

26:55.640 --> 26:57.520
So the first one is service requests.

26:59.240 --> 27:00.640
Service requests.

27:06.680 --> 27:10.720
You can also change the color of the label.

27:10.920 --> 27:14.720
So let's say you want it to be green.

27:15.360 --> 27:16.920
The next one consultation.

27:24.300 --> 27:25.180
Requests.

27:28.060 --> 27:31.420
And I want this one to be read.

27:34.900 --> 27:35.620
Payments.

27:44.300 --> 27:45.260
And others.

27:53.940 --> 27:54.300
Right.

27:54.300 --> 27:54.780
Awesome.

27:54.820 --> 27:56.020
Let's go back to 2010.

28:05.260 --> 28:08.020
So the first one was services requests.

28:09.300 --> 28:13.300
Now let's add consultation request.

28:26.910 --> 28:28.310
And as a description.

28:42.870 --> 28:45.110
Or follow up meetings.

28:47.750 --> 28:48.750
Let's expand it.

28:49.030 --> 28:49.470
Yep.

28:53.030 --> 28:53.990
The next one.

28:59.990 --> 29:00.630
Payments.

29:10.830 --> 29:12.070
Questions about invoices.

29:12.070 --> 29:13.550
Payments or refunds?

29:15.090 --> 29:20.370
Of course, you can create your own descriptions and your own categories.

29:20.930 --> 29:23.970
It's completely up to you what categories you want.

29:29.810 --> 29:33.010
So we have here questions about invoices payments or refunds.

29:34.330 --> 29:35.650
And the last one orders.

29:46.770 --> 29:50.450
So emails that don't clearly fit into the other categories.

29:52.290 --> 29:52.610
All right.

29:52.650 --> 29:53.130
Awesome.

29:57.010 --> 30:01.050
Now we need to add the system prompt to guide AI.

30:01.970 --> 30:03.690
What exactly we want to achieve.

30:05.530 --> 30:06.770
You can leave it as it is.

30:08.970 --> 30:09.810
I like it.

30:12.130 --> 30:20.540
So the next step is to add Gmail nodes to apply labels to the incoming emails based on how they have

30:20.540 --> 30:21.460
been classified.

30:21.740 --> 30:26.020
So for example, if an email is classified as a service request.

30:30.060 --> 30:30.700
Like here.

30:32.940 --> 30:37.340
We want to add the service request label to it in Gmail.

30:37.340 --> 30:37.740
Right.

30:38.140 --> 30:43.220
So since we have already created these labels in Gmail, you should be able to select them directly

30:43.220 --> 30:43.940
in the node.

30:44.580 --> 30:47.420
So let's add Gmail node.

30:49.820 --> 30:52.700
And we want to add label to message.

30:53.980 --> 30:56.860
And when we connect the correct Gmail inbox.

30:57.500 --> 31:00.740
So in my case it will be this one.

31:01.540 --> 31:06.020
The label we just created in our Gmail inbox should pop up here.

31:09.740 --> 31:12.480
So this one is a service request.

31:12.480 --> 31:12.880
Right?

31:14.480 --> 31:14.800
So.

31:18.120 --> 31:18.640
Let's.

31:18.920 --> 31:19.160
Yeah.

31:19.200 --> 31:19.720
It's here.

31:21.800 --> 31:22.120
All right.

31:22.120 --> 31:22.560
Great.

31:23.280 --> 31:26.040
Now we need to add message ID.

31:26.680 --> 31:30.520
So let's go back to our team data node.

31:31.320 --> 31:38.880
And you have closed the message ID in this field in this variable.

31:39.240 --> 31:40.320
So let's copy it.

31:45.560 --> 31:46.680
And paste it here.

31:49.760 --> 31:56.680
I've sent an email to myself asking about automation services.

31:56.720 --> 31:59.880
Now please go ahead and send an email to yourself.

32:00.400 --> 32:05.760
And that could be classified as a services request just like I did.

32:06.200 --> 32:12.300
And this will let you test if the AI is classifying the email correctly and help us get some data into

32:12.300 --> 32:12.780
the flow.

32:14.740 --> 32:16.340
And now you can test the workflow.

32:21.660 --> 32:23.580
Alright, we have some bot requests.

32:25.620 --> 32:26.860
Okay, so let's fix it.

32:27.620 --> 32:30.300
Let's drag and drop the message ID.

32:35.020 --> 32:36.580
Variable from here.

32:40.740 --> 32:41.740
Right now should work.

32:42.060 --> 32:43.340
Let's give it another test.

32:49.380 --> 32:49.580
Yeah.

32:49.580 --> 32:54.300
As you can see, we successfully fetch the last email I've sent to myself.

32:56.260 --> 33:08.300
And when I go to and when I check my Gmail inbox, I can see that my last email was labeled correctly.

33:08.830 --> 33:09.870
Services request.

33:10.390 --> 33:12.110
I'm interested in automation services.

33:12.750 --> 33:17.710
Now we need to do exactly the same thing for the rest of the labels, a.k.a. categories.

33:18.230 --> 33:20.230
So let's go to our N810.

33:22.670 --> 33:25.510
Let's add another Gmail note.

33:28.950 --> 33:30.190
At label to message.

33:30.670 --> 33:33.150
This is the action we want to perform.

33:39.630 --> 33:44.870
Now I need to connect my product Gmail account.

33:47.150 --> 33:53.390
And the label we want consultation request.

33:56.910 --> 33:59.470
So let's find it here.

34:00.310 --> 34:06.310
And as the message ID let's copy it.

34:11.690 --> 34:22.930
By the way, the message ID we grabbed from the hidden data node and paste it into this node was not

34:22.930 --> 34:32.850
working properly because I didn't switch to the expression mode, but it is exactly the same name we

34:32.850 --> 34:36.250
specified in this node.

34:36.490 --> 34:37.210
As you can see.

34:42.570 --> 34:50.130
So first we need to switch to the expression node and then after dollar sign JSON dot.

34:52.610 --> 34:54.410
We need to provide the name of the variable.

34:59.010 --> 35:02.770
So now let's do the same for the payments.

35:07.230 --> 35:07.910
Gmail.

35:08.270 --> 35:09.510
Add label to message.

35:11.790 --> 35:14.750
Connect the correct Gmail account.

35:18.590 --> 35:19.390
Payments.

35:23.750 --> 35:24.630
Expression.

35:26.270 --> 35:29.950
You can also type it manually so.

35:30.910 --> 35:32.350
Double curly braces.

35:33.270 --> 35:34.070
JSON.

35:37.270 --> 35:40.030
Message ID.

35:47.190 --> 35:47.590
Yep.

35:52.510 --> 35:53.590
And the last one.

35:56.150 --> 35:56.910
Others.

35:56.910 --> 35:57.350
So.

36:01.190 --> 36:05.640
Gmail Action label to message.

36:14.640 --> 36:15.400
Others.

36:16.920 --> 36:17.720
Expression.

36:18.240 --> 36:19.600
You can also expand it.

36:26.080 --> 36:26.760
JSON.

36:29.160 --> 36:30.120
Message ID.

36:35.240 --> 36:35.760
Great.

36:40.320 --> 36:41.720
Now let's rename this node.

36:50.200 --> 36:52.600
So this is service requests.

37:01.940 --> 37:02.660
Perfume.

37:04.180 --> 37:07.780
This one is consultation requests.

37:18.860 --> 37:20.860
Is going to be payments.

37:29.980 --> 37:30.820
And the last one?

37:30.820 --> 37:31.340
Others.

37:44.140 --> 37:47.500
I'm going to send three separate emails.

37:49.660 --> 37:51.220
So we can test all of them.

37:52.540 --> 37:53.940
So the first one will be.

37:55.300 --> 38:00.300
So in the first one we want to request a consultation then.

38:02.470 --> 38:09.150
Ask some questions about payments and some email unrelated to to the three.

38:10.310 --> 38:18.310
I sent a few test emails to this address to make sure each category gets picked up properly.

38:18.990 --> 38:20.030
So let's have a look.

38:24.990 --> 38:28.070
However, I have a question about a recent invoice I received.

38:28.070 --> 38:29.710
Can you confirm the payment status?

38:30.470 --> 38:32.230
We should classify it as a payment.

38:34.990 --> 38:36.150
We have partnership.

38:38.750 --> 38:40.350
It was moved to others.

38:41.030 --> 38:42.190
Can we have a quick chat?

38:43.070 --> 38:44.590
So interested in consultation.

38:45.950 --> 38:48.190
And I'm interested in automation services.

38:49.670 --> 38:49.990
They.

38:49.990 --> 38:53.470
I classify this image as a service request.

38:55.350 --> 39:02.610
So as you can see, all the images were labeled correctly and sorted into the corresponding categories

39:02.610 --> 39:03.410
we created.

39:04.010 --> 39:06.450
You can check right here.

39:08.370 --> 39:08.970
Order.

39:12.090 --> 39:14.530
And payment and service request.

39:15.570 --> 39:16.970
Okay now let's go back to ten.

39:17.690 --> 39:18.690
And let's create.

39:19.650 --> 39:26.610
Now the last step to complete this setup and fully automate our email flow is to send a replay to new

39:26.610 --> 39:27.170
emails.

39:27.410 --> 39:33.970
So we want the AI to respond right away, even if a simple message confirming that we get back to the

39:33.970 --> 39:34.930
customer soon.

39:35.250 --> 39:39.170
So that alone can make a big difference in the customer experience.

39:40.250 --> 39:43.170
So again we need to use Gmail node.

39:44.490 --> 39:45.690
Let's search for Gmail.

39:51.290 --> 39:54.650
But this time we want to reply to a message.

39:54.650 --> 39:57.650
So going to be this this action.

39:57.650 --> 39:57.710
Dissection.

40:01.750 --> 40:04.630
Make sure you are connected to the same Gmail account.

40:07.150 --> 40:10.030
As the resource we have message as operation Reply.

40:12.270 --> 40:15.630
We want to change email type to text.

40:18.790 --> 40:22.790
Now here we want to include the actual message.

40:23.750 --> 40:25.830
But first let's add message ID.

40:27.950 --> 40:30.350
So it will be the same as in the previous node.

40:34.790 --> 40:35.590
Let's copy it.

40:40.870 --> 40:44.070
Let's switch to expression and paste here.

40:45.870 --> 40:46.190
All right.

40:46.190 --> 40:46.510
Great.

40:47.070 --> 40:54.470
Now I'm going to paste the message I have prepared earlier and show you how it looks like.

40:54.870 --> 41:00.080
So let's switch to the expression and then expand it.

41:01.840 --> 41:06.680
So for the services request I want I to reply like that.

41:07.600 --> 41:09.440
Thank you for reaching out to adaptive AI.

41:09.960 --> 41:13.280
We are excited to learn about your needs and how we can assist you.

41:13.680 --> 41:18.600
Your inquiry has been received and a member of our team is reviewing the details.

41:18.840 --> 41:23.560
We'll get back to you within the next 24 hours with more information.

41:23.720 --> 41:29.560
In the meantime, feel free to explore our website or additional details about our services and contact

41:29.720 --> 41:30.960
with us via WhatsApp.

41:32.600 --> 41:34.360
And we look forward to connecting with you.

41:34.360 --> 41:35.240
Best regards.

41:35.280 --> 41:38.920
Damien, the founder and CEO at adaptive AI.

41:39.120 --> 41:43.440
You also want to include the intro as a dynamic variable.

41:45.760 --> 41:49.560
It should be included in the Clean Data node.

41:50.000 --> 41:50.760
Is this one.

41:52.240 --> 41:53.800
So let's drag and drop it like that.

41:55.220 --> 41:55.900
Perfect.

41:57.500 --> 41:58.540
Now we can close it.

41:59.860 --> 42:01.060
And our message is ready.

42:03.740 --> 42:08.380
So I'm going to show you the messages for the for the rest of the categories.

42:10.940 --> 42:13.300
So let's add Gmail note again.

42:16.660 --> 42:17.860
Reply to message.

42:21.820 --> 42:22.980
You also need to switch email.

42:23.020 --> 42:27.340
Type to text and paste message ID.

42:33.500 --> 42:36.380
Don't forget to switch to the expression mode.

42:37.860 --> 42:38.620
Place it here.

42:42.740 --> 42:43.780
Switch expression.

42:46.380 --> 42:49.860
Also, I'm not sure if I switch to expression in this one.

42:50.860 --> 42:51.220
Yep.

42:52.220 --> 42:52.580
Okay.

42:52.620 --> 42:53.020
So.

42:54.360 --> 42:59.440
I'm going to expand it and paste the actual message.

43:00.560 --> 43:02.040
So this one is slightly different.

43:03.520 --> 43:08.920
To schedule your consultation, please reply to this email with your preferred date and time, or use

43:08.920 --> 43:11.400
our online booking link here.

43:11.840 --> 43:13.320
And I've included my.

43:14.000 --> 43:15.840
I've included the link to my calendar.

43:16.840 --> 43:20.880
Once we receive your preferred time, we'll confirm the appointment or suggest alternative options if

43:20.880 --> 43:21.200
needed.

43:21.200 --> 43:25.800
If you have any specific topics you'd like to discuss during the consultation, feel free to include

43:25.800 --> 43:26.960
them in your reply.

43:28.440 --> 43:29.600
And the last one?

43:32.040 --> 43:33.080
And the last one.

43:33.520 --> 43:36.120
So let's search for Gmail.

43:36.400 --> 43:37.280
Note again.

43:38.840 --> 43:41.920
Gmail reply to a message.

43:44.600 --> 43:48.160
Collect the correct Gmail account.

43:50.280 --> 43:53.010
Email type you want text.

43:56.210 --> 43:57.490
Copy the message ID.

43:57.530 --> 43:59.730
You can also type it manually if you want.

44:00.690 --> 44:03.570
Don't forget to switch over to expression.

44:06.770 --> 44:07.610
Okay, great.

44:10.330 --> 44:13.090
Switch message to the expression mode.

44:14.330 --> 44:15.330
Expand it.

44:16.090 --> 44:19.450
So this is the message I want my automation to send.

44:19.450 --> 44:25.050
If someone has any questions about payments, refunds or anything similar.

44:25.410 --> 44:29.810
So thank you for contacting us regarding your payment billing inquiry.

44:30.050 --> 44:33.810
You have received your message and are working to address your request.

44:34.090 --> 44:39.530
A member of our team will get back to you within two working days to provide the necessary information

44:39.530 --> 44:40.570
or assistance.

44:41.290 --> 44:42.530
This matter is urgent.

44:42.530 --> 44:43.930
Please call us directly at.

44:43.970 --> 44:53.310
Thank you for your patience and for choosing adaptive AI and sign of the Let's rename these nodes so

44:53.310 --> 44:55.950
it's clear what each one is doing.

44:56.630 --> 45:00.350
It will make the workflow easier to understand and maintain later.

45:01.150 --> 45:04.390
So this one um.

45:04.910 --> 45:05.790
Reply to.

45:11.110 --> 45:11.630
Services.

45:11.630 --> 45:12.350
Requests.

45:21.550 --> 45:26.510
This one replies to the consultation requests.

45:40.190 --> 45:40.950
And this one.

45:45.750 --> 45:47.830
Reply to payment.

45:47.830 --> 45:47.960
And.

45:50.440 --> 45:51.800
Related questions.

45:57.680 --> 46:05.600
If you don't want the AI to reply to emails classified as other.

46:05.960 --> 46:08.680
Since we don't really know what the request is about.

46:08.880 --> 46:13.400
Also, just so you know, you can add a human in the loop feature to this system.

46:13.640 --> 46:19.920
That means the automation will generate a draft response and wait for your approval before sending it.

46:20.080 --> 46:24.280
I will show you how to set that up in one of the next lessons.

46:25.000 --> 46:27.000
All right, that's it for this tutorial.

46:27.360 --> 46:32.160
This is a great example of a simple but powerful AI automation that can save you a lot of time.

46:33.480 --> 46:36.480
And of course, you can tweak it however you like.

46:36.920 --> 46:41.800
I just prompt you to add more categories, etc..

46:42.960 --> 46:47.120
Thank you for spending time with me and see you in the next lesson.
