WEBVTT

00:00.120 --> 00:01.160
Look, I hear you.

00:01.200 --> 00:02.680
Yesterday was grueling.

00:02.680 --> 00:03.960
We got through a lot.

00:04.000 --> 00:08.760
The integrations were perhaps slightly more than you bargained for, but we got it done.

00:08.760 --> 00:09.440
We're through it.

00:09.440 --> 00:11.640
And today it's redemption day.

00:11.680 --> 00:14.160
Today is going to be putting this into action.

00:14.160 --> 00:18.080
We're going to build our first proper business project in Nw10.

00:18.120 --> 00:21.880
The kind of thing that you could be building yourself for your clients.

00:21.880 --> 00:25.040
You could be building it as part of building an AI agency.

00:25.360 --> 00:27.560
This is where things happen.

00:27.560 --> 00:30.080
This is where we have commercial value.

00:30.120 --> 00:31.320
Let's get into it.

00:31.360 --> 00:33.840
First, just some quick recapping.

00:33.840 --> 00:36.920
One of the first things we covered yesterday was JSON.

00:36.960 --> 00:40.080
Again, something I imagine most of you are pretty familiar with.

00:40.360 --> 00:42.680
If not, hopefully you got some intuition.

00:42.680 --> 00:44.320
You're going to be seeing a lot of JSON.

00:44.520 --> 00:46.280
It shouldn't worry you in the least.

00:46.320 --> 00:50.000
You understand now that it is just a set of key value pairs.

00:50.000 --> 00:55.240
Something colon, something where those things can be strings or numbers or booleans, or in fact,

00:55.280 --> 01:02.930
as you later discovered, it can be lists or more objects or other things to null up Uh, then Jason

01:02.930 --> 01:07.410
contains objects which are also known as dictionaries, which have curly braces.

01:07.410 --> 01:10.530
And then there's key colon value, comma key colon value.

01:10.730 --> 01:14.010
And it can have an array which has square brackets around it.

01:14.170 --> 01:16.410
And that arrays can contain objects.

01:16.410 --> 01:23.970
Objects can contain objects, and you can compose bigger objects of more objects, lists and strings

01:23.970 --> 01:25.730
and numbers and so on.

01:25.730 --> 01:31.650
And you get very used to seeing JSON all over the place with the trademark curly braces, and seeing

01:31.650 --> 01:37.330
the sort of structured information that JSON allows you to represent of large objects that composed

01:37.330 --> 01:38.690
of smaller objects.

01:38.810 --> 01:39.410
All right.

01:39.450 --> 01:41.370
That was JSON in four steps.

01:41.370 --> 01:47.010
And then we looked at expressions in Nw10 that often when you're putting in a value, you can choose

01:47.010 --> 01:53.650
between having like a fixed fixed value to it, like it just is a piece of text, or it can be an expression,

01:53.650 --> 02:00.010
which means it's something that's more dynamic and that gets evaluated and is replaced by some fixed

02:00.010 --> 02:00.530
value.

02:00.770 --> 02:04.690
And you can you can toggle between expressions and fixed they.

02:04.730 --> 02:07.210
These expressions are surrounded in double curlies.

02:07.330 --> 02:10.210
A single curly is sort of part of a JSON block.

02:10.250 --> 02:17.890
Double curlies means we have an expression and you can use this shortcut dollar sign JSON, which means

02:17.890 --> 02:24.050
I want to grab the data that's coming in from the prior node in JSON format.

02:24.050 --> 02:25.730
And we use it a couple of times.

02:25.730 --> 02:27.530
And so hopefully that's clicking with you.

02:27.570 --> 02:29.770
You see what it means to put dollar JSON.

02:29.770 --> 02:32.850
And there is like a little catch to this that I'm going to talk about later.

02:33.650 --> 02:39.210
And you also saw I used the dot to to select keys in your JSON.

02:39.210 --> 02:46.570
So if you have a JSON object like this person here, this is Alice whose age is 30 and who has an address.

02:46.570 --> 02:53.490
And that address is itself a JSON object in there, then you could say something like JSON name and

02:53.490 --> 02:59.850
get Alice, or you could drill in and go JSON address city, and you're selecting the address field

02:59.850 --> 03:01.050
and then the city field.

03:01.050 --> 03:02.660
And of course you're getting New York.

03:02.700 --> 03:07.420
And there are a couple of expressions that were used during yesterday's integrations.

03:07.420 --> 03:12.620
We use that that trick of if you if you don't want to get the data that's coming in into this node,

03:12.620 --> 03:17.700
but you want to look back at one of the previous nodes in the workflow and take its data, then you

03:17.700 --> 03:18.980
can use this this approach.

03:18.980 --> 03:26.500
Here you say dollar node and then in square brackets you put the name of that node and then dot JSON

03:26.500 --> 03:28.260
to grab its JSON.

03:28.620 --> 03:33.020
And you'll get more familiar with with why it looks that way later.

03:33.020 --> 03:35.980
And for now, I would just sort of keep keep that in mind.

03:36.020 --> 03:37.220
You don't need to memorize this.

03:37.220 --> 03:39.020
You can always look it up at the time.

03:39.020 --> 03:41.980
But but get some some get the gist of what it looks like.

03:42.300 --> 03:47.980
And then there's that other the other thing we use to turn a blob of JSON into some text, because we

03:47.980 --> 03:54.340
wanted to pass it into an LLM, and we use that json.stringify approach that you see right there.

03:54.340 --> 03:56.860
As I say, don't don't memorize these.

03:57.020 --> 03:59.420
It's just just good to get the gist.

03:59.460 --> 04:03.590
Be ready to sort of look, look this up at the time and use it when you need to.

04:03.630 --> 04:04.830
You know that there's a way.

04:04.830 --> 04:10.990
And then yesterday we we, uh, we got into authentication, uh, about connecting to to third parties

04:10.990 --> 04:12.310
and saying who we are.

04:12.550 --> 04:15.950
And that involves setting up the credentials in N810.

04:15.990 --> 04:17.670
And there are these different approaches.

04:17.710 --> 04:22.270
There's the simple one, which is just when you have an API key, we love it when it's that simple,

04:22.310 --> 04:24.710
you're just connecting to something like OpenAI.

04:24.830 --> 04:30.630
You don't need to authenticate for a particular account, just that your your API key, your whole connection

04:30.630 --> 04:31.470
with OpenAI.

04:31.510 --> 04:37.270
You get the key, you put it in the credentials section, and then you get that green box to say that

04:37.270 --> 04:39.070
it's connected and you're done.

04:39.510 --> 04:47.670
And then the sort of medium difficult approach is when we're using OAuth two, the proper way to authenticate

04:47.670 --> 04:48.670
with a third party.

04:48.950 --> 04:50.870
But a lot of it has been pre-configured.

04:50.870 --> 04:53.110
And so it's relatively straightforward.

04:53.110 --> 04:57.270
And this is what we did with Google Sheets and Google Mail two days ago.

04:57.270 --> 04:58.310
And it was really simple.

04:58.350 --> 04:59.670
You just sort of clicked to connect.

04:59.670 --> 05:03.110
Up came a pop up, we authenticated and it was done.

05:03.110 --> 05:05.030
So that was pretty easy too.

05:05.390 --> 05:11.670
And then the hard way is full on OAuth two, which is how you build a proper integration with a third

05:11.670 --> 05:14.670
party when you're authenticating as a particular user.

05:14.670 --> 05:17.670
And you typically it involves dealing with setting up scopes.

05:17.670 --> 05:21.550
You remember scopes with slack, we had to set up the different scopes we'd have access to.

05:21.590 --> 05:24.510
You get like an OAuth two token that we had to put in.

05:24.670 --> 05:26.710
And there was another part to it too.

05:26.710 --> 05:29.910
There were these webhooks, which isn't really to do with with OAuth two.

05:29.950 --> 05:33.550
That's just a different kind of integration that we did as well.

05:33.590 --> 05:35.390
And we'll talk about that next.

05:35.390 --> 05:37.710
So I kind of snuck this in there yesterday.

05:37.950 --> 05:39.230
Uh, webhooks.

05:39.230 --> 05:44.390
And some of you have probably encountered these many times before, but it may be new to to to some.

05:44.710 --> 05:46.030
So here's the story.

05:46.030 --> 05:51.750
We have a node in an it an and we've connected that node to a third party.

05:51.790 --> 05:54.470
We've connected it to something like slack.

05:54.710 --> 05:59.230
And we use an endpoint, an API endpoint which is a web address.

05:59.390 --> 06:03.120
And we make an HTTP, a web call to that end point.

06:03.120 --> 06:07.000
And this is basically it's like a request response kind of interaction.

06:07.000 --> 06:08.560
We make a request to slack.

06:08.600 --> 06:12.120
We get back a response in order to carry out an action.

06:12.120 --> 06:15.320
So it's a it's a node which is which is an action node.

06:15.320 --> 06:19.960
And we're making a request to slack to, to take, take care of that action, which in this case is

06:20.000 --> 06:21.480
like post a slack message.

06:21.920 --> 06:24.480
Well, that handles that kind of interaction.

06:24.480 --> 06:29.880
But there is, of course, another kind of interaction which isn't request response based.

06:29.880 --> 06:35.640
It's when we want slack to tell us to tell Nan that something has happened.

06:35.760 --> 06:40.400
A user has made a message, and that is where webhooks come in.

06:40.400 --> 06:41.760
So here's how it works.

06:42.120 --> 06:46.320
N810 wants to be able to be notified when something has happened.

06:46.320 --> 06:49.680
And so we use exactly the same pattern, kind of in reverse.

06:49.720 --> 06:55.600
We say to a third party system like slack, hey, look, if you want to update us that something has

06:55.600 --> 07:02.600
happened, then we want you to call a particular URL and then URL that we've set up.

07:02.840 --> 07:08.610
And you can just make a web request to that URL, and that will notify us that something has happened.

07:08.610 --> 07:14.050
And when you do that, when you expose an endpoint that someone else can call, that's known as a webhook,

07:14.090 --> 07:17.730
because it's like you've got you've got like a, like a hook that someone can, can call out to.

07:18.050 --> 07:20.250
And, and so that is what happens.

07:20.250 --> 07:26.170
We have said to slack, hey, this is a web address that you can call to tell us that there's an incoming

07:26.170 --> 07:26.770
message.

07:26.970 --> 07:33.850
And in N810 we I got that webhook, that URL, there was a field where we could collect that webhook,

07:34.010 --> 07:39.490
and then we took that webhook and we pasted it into slack in a particular section, which was where

07:39.530 --> 07:44.410
slack has the configuration to say when a message comes in or on a particular kind of event.

07:44.530 --> 07:48.890
When that event happens, I will call whatever URL you give me.

07:48.890 --> 07:55.210
So slack doesn't know that it's N810 or slack knows is that when a message comes in and as it happens,

07:55.210 --> 08:01.290
we set it up so that when a particular bot name was mentioned at that moment, slack would just call

08:01.290 --> 08:02.370
that endpoint.

08:02.370 --> 08:08.610
And so this this is, is to be a trigger, which is of course how it's set up in MN as a trigger is

08:08.610 --> 08:15.130
to trigger that an event has happened in a system like slack, and it will then call the webhook that

08:15.130 --> 08:15.930
you give it.

08:15.930 --> 08:18.450
And the webhook is set up in N810.

08:18.970 --> 08:20.170
So hopefully that makes sense.

08:20.210 --> 08:25.930
Webhooks are things that you set up so that the outside world can notify you when something has happened,

08:25.930 --> 08:28.930
and they are quite simply endpoints that someone will call.

08:28.970 --> 08:34.330
Make a web request to your endpoint to trigger that something has happened that you need to know about.

08:34.490 --> 08:39.610
And as I always like to say, if you're left in any doubt about how it works, what that means, just

08:39.610 --> 08:40.650
just get the gist.

08:40.650 --> 08:42.210
We're going to be doing this a lot.

08:42.210 --> 08:45.370
And so every time we do it, I feel like it's going to solidify a bit more.

08:45.530 --> 08:49.930
And by the end of it, by the end of the three weeks, you'll be super comfortable with with making

08:49.970 --> 08:54.450
HTTP calls to endpoints and receiving an HTTP call to a webhook.

08:54.650 --> 08:58.530
These these things are super common and they'll become clear in time.

08:58.570 --> 08:59.290
All right.

08:59.330 --> 09:01.450
So now just a little bit of new material.

09:01.610 --> 09:04.170
And then we get to the project.
