Look, I hear you.
Yesterday was grueling.
We got through a lot.
The integrations were perhaps slightly more than you bargained for, but we got it done.
We're through it.
And today it's redemption day.
Today is going to be putting this into action.
We're going to build our first proper business project in Nw10.
The kind of thing that you could be building yourself for your clients.
You could be building it as part of building an AI agency.
This is where things happen.
This is where we have commercial value.
Let's get into it.
First, just some quick recapping.
One of the first things we covered yesterday was JSON.
Again, something I imagine most of you are pretty familiar with.
If not, hopefully you got some intuition.
You're going to be seeing a lot of JSON.
It shouldn't worry you in the least.
You understand now that it is just a set of key value pairs.
Something colon, something where those things can be strings or numbers or booleans, or in fact,
as you later discovered, it can be lists or more objects or other things to null up Uh, then Jason
contains objects which are also known as dictionaries, which have curly braces.
And then there's key colon value, comma key colon value.
And it can have an array which has square brackets around it.
And that arrays can contain objects.
Objects can contain objects, and you can compose bigger objects of more objects, lists and strings
and numbers and so on.
And you get very used to seeing JSON all over the place with the trademark curly braces, and seeing
the sort of structured information that JSON allows you to represent of large objects that composed
of smaller objects.
All right.
That was JSON in four steps.
And then we looked at expressions in Nw10 that often when you're putting in a value, you can choose
between having like a fixed fixed value to it, like it just is a piece of text, or it can be an expression,
which means it's something that's more dynamic and that gets evaluated and is replaced by some fixed
value.
And you can you can toggle between expressions and fixed they.
These expressions are surrounded in double curlies.
A single curly is sort of part of a JSON block.
Double curlies means we have an expression and you can use this shortcut dollar sign JSON, which means
I want to grab the data that's coming in from the prior node in JSON format.
And we use it a couple of times.
And so hopefully that's clicking with you.
You see what it means to put dollar JSON.
And there is like a little catch to this that I'm going to talk about later.
And you also saw I used the dot to to select keys in your JSON.
So if you have a JSON object like this person here, this is Alice whose age is 30 and who has an address.
And that address is itself a JSON object in there, then you could say something like JSON name and
get Alice, or you could drill in and go JSON address city, and you're selecting the address field
and then the city field.
And of course you're getting New York.
And there are a couple of expressions that were used during yesterday's integrations.
We use that that trick of if you if you don't want to get the data that's coming in into this node,
but you want to look back at one of the previous nodes in the workflow and take its data, then you
can use this this approach.
Here you say dollar node and then in square brackets you put the name of that node and then dot JSON
to grab its JSON.
And you'll get more familiar with with why it looks that way later.
And for now, I would just sort of keep keep that in mind.
You don't need to memorize this.
You can always look it up at the time.
But but get some some get the gist of what it looks like.
And then there's that other the other thing we use to turn a blob of JSON into some text, because we
wanted to pass it into an LLM, and we use that json.stringify approach that you see right there.
As I say, don't don't memorize these.
It's just just good to get the gist.
Be ready to sort of look, look this up at the time and use it when you need to.
You know that there's a way.
And then yesterday we we, uh, we got into authentication, uh, about connecting to to third parties
and saying who we are.
And that involves setting up the credentials in N810.
And there are these different approaches.
There's the simple one, which is just when you have an API key, we love it when it's that simple,
you're just connecting to something like OpenAI.
You don't need to authenticate for a particular account, just that your your API key, your whole connection
with OpenAI.
You get the key, you put it in the credentials section, and then you get that green box to say that
it's connected and you're done.
And then the sort of medium difficult approach is when we're using OAuth two, the proper way to authenticate
with a third party.
But a lot of it has been pre-configured.
And so it's relatively straightforward.
And this is what we did with Google Sheets and Google Mail two days ago.
And it was really simple.
You just sort of clicked to connect.
Up came a pop up, we authenticated and it was done.
So that was pretty easy too.
And then the hard way is full on OAuth two, which is how you build a proper integration with a third
party when you're authenticating as a particular user.
And you typically it involves dealing with setting up scopes.
You remember scopes with slack, we had to set up the different scopes we'd have access to.
You get like an OAuth two token that we had to put in.
And there was another part to it too.
There were these webhooks, which isn't really to do with with OAuth two.
That's just a different kind of integration that we did as well.
And we'll talk about that next.
So I kind of snuck this in there yesterday.
Uh, webhooks.
And some of you have probably encountered these many times before, but it may be new to to to some.
So here's the story.
We have a node in an it an and we've connected that node to a third party.
We've connected it to something like slack.
And we use an endpoint, an API endpoint which is a web address.
And we make an HTTP, a web call to that end point.
And this is basically it's like a request response kind of interaction.
We make a request to slack.
We get back a response in order to carry out an action.
So it's a it's a node which is which is an action node.
And we're making a request to slack to, to take, take care of that action, which in this case is
like post a slack message.
Well, that handles that kind of interaction.
But there is, of course, another kind of interaction which isn't request response based.
It's when we want slack to tell us to tell Nan that something has happened.
A user has made a message, and that is where webhooks come in.
So here's how it works.
N810 wants to be able to be notified when something has happened.
And so we use exactly the same pattern, kind of in reverse.
We say to a third party system like slack, hey, look, if you want to update us that something has
happened, then we want you to call a particular URL and then URL that we've set up.
And you can just make a web request to that URL, and that will notify us that something has happened.
And when you do that, when you expose an endpoint that someone else can call, that's known as a webhook,
because it's like you've got you've got like a, like a hook that someone can, can call out to.
And, and so that is what happens.
We have said to slack, hey, this is a web address that you can call to tell us that there's an incoming
message.
And in N810 we I got that webhook, that URL, there was a field where we could collect that webhook,
and then we took that webhook and we pasted it into slack in a particular section, which was where
slack has the configuration to say when a message comes in or on a particular kind of event.
When that event happens, I will call whatever URL you give me.
So slack doesn't know that it's N810 or slack knows is that when a message comes in and as it happens,
we set it up so that when a particular bot name was mentioned at that moment, slack would just call
that endpoint.
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
to trigger that an event has happened in a system like slack, and it will then call the webhook that
you give it.
And the webhook is set up in N810.
So hopefully that makes sense.
Webhooks are things that you set up so that the outside world can notify you when something has happened,
and they are quite simply endpoints that someone will call.
Make a web request to your endpoint to trigger that something has happened that you need to know about.
And as I always like to say, if you're left in any doubt about how it works, what that means, just
just get the gist.
We're going to be doing this a lot.
And so every time we do it, I feel like it's going to solidify a bit more.
And by the end of it, by the end of the three weeks, you'll be super comfortable with with making
HTTP calls to endpoints and receiving an HTTP call to a webhook.
These these things are super common and they'll become clear in time.
All right.
So now just a little bit of new material.
And then we get to the project.