WEBVTT

00:00.040 --> 00:00.240
What?

00:00.240 --> 00:03.360
You're probably about ready to kill me from how hard this is being with slack.

00:03.360 --> 00:04.440
And we're only halfway.

00:04.600 --> 00:06.160
But this is about as hard as they get.

00:06.160 --> 00:09.400
And I tell you, once you've done a few of these integrations, they get easier and easier.

00:09.440 --> 00:14.520
You, like, build the basic building blocks of these integrations, and they're often quite similar.

00:14.800 --> 00:17.800
Okay, we're back now in N810.

00:17.840 --> 00:22.040
We're looking at the slack trigger node, which is exactly where we left it.

00:22.200 --> 00:26.520
And we've put in the channel ID we've got everything set up here.

00:26.560 --> 00:28.760
There's there's one thing that's left to do.

00:28.800 --> 00:30.520
You remember when we were in slack?

00:30.560 --> 00:31.760
We left something blank.

00:31.920 --> 00:35.960
It's where we were setting up the the part that tells slack.

00:35.960 --> 00:39.200
How does it call when a message comes in?

00:39.400 --> 00:44.560
And the way we do that is on this screen, there's this little collapsed swizzle here called webhook

00:44.600 --> 00:46.960
URLs and webhooks.

00:47.000 --> 00:55.040
These are the things which external systems can call into to trigger n810 and tell N810 something has

00:55.040 --> 00:55.680
happened.

00:55.680 --> 01:03.210
And it's a webhook we have to use now for for slack to inform N810 that a message has arrived and actually

01:03.570 --> 01:04.250
gives us two.

01:04.290 --> 01:07.130
It gives us one to be used for testing and one for production.

01:07.130 --> 01:07.930
And we're going to start.

01:07.930 --> 01:09.810
You can see you can toggle between them here.

01:09.810 --> 01:12.370
We're going to start by looking at the test one.

01:12.370 --> 01:15.130
And you click here to copy it into the clipboard.

01:15.330 --> 01:18.970
And just before we go back to slack again that's what we're going to do.

01:19.010 --> 01:24.370
I just want you to press this execute step button so that this is starting to listen.

01:24.370 --> 01:25.730
It's listening right now.

01:25.730 --> 01:27.410
It's listening for this webhook.

01:27.650 --> 01:30.530
And now we're going to go back to slack and give it a try.

01:30.690 --> 01:31.650
And here we go.

01:31.690 --> 01:33.730
We're at slack right now.

01:34.050 --> 01:40.450
And I am now going to to come to the event subscriptions page.

01:40.850 --> 01:46.770
And I realize I know I set this up before I forgot to press the save changes button down there, which

01:46.770 --> 01:48.530
is really easy to do with slack.

01:48.530 --> 01:52.090
So we're going to have to fill in this page again and be careful of that.

01:52.090 --> 01:53.770
I've done that many times okay.

01:53.770 --> 01:55.850
We're going to turn enable events on.

01:55.890 --> 01:56.810
We're going to change.

01:56.850 --> 01:58.340
Subscribe to bot events.

01:58.340 --> 01:59.660
This is the thing I did before.

01:59.700 --> 02:02.260
We're going to put in here a app mention.

02:02.260 --> 02:03.100
That's the one.

02:03.100 --> 02:03.820
There it is.

02:04.020 --> 02:06.100
And now the request URL.

02:06.100 --> 02:09.740
I'm going to press paste to paste in that webhook.

02:10.020 --> 02:10.820
And look at that.

02:10.820 --> 02:15.700
It says verified and it only says verify because I've got that trigger running.

02:15.700 --> 02:18.620
And if you don't it's going to say yellow not verified.

02:18.620 --> 02:20.180
And it's a right bore.

02:20.340 --> 02:24.340
And all I can do is tell you to keep trying until verified comes on.

02:24.340 --> 02:29.780
But it took me many times to get verified to appear, and now you press save changes and that's done.

02:29.820 --> 02:30.340
Success.

02:30.340 --> 02:34.940
We've hooked up the slack trigger part of the story okay.

02:35.340 --> 02:39.380
And now we're going to go back to my workflow.

02:39.580 --> 02:45.820
So we do now have this this working hopefully so that in slack we could be now sending messages.

02:45.820 --> 02:48.340
Well next up we're going to do the usual stuff.

02:48.340 --> 02:50.620
We're going to put on an AI agent at least.

02:50.620 --> 02:52.620
If nothing else we're getting really good at this.

02:52.860 --> 02:55.300
We will give it an open AI model.

02:55.820 --> 02:57.390
Open OpenAI chat model.

02:57.510 --> 03:00.390
For now, we're not going to worry about memory or tools.

03:00.390 --> 03:03.150
We just want to worry about what goes on the other side of this.

03:03.190 --> 03:04.510
We want it to be slack.

03:05.750 --> 03:07.030
And here we go.

03:07.030 --> 03:12.110
And we're going to want it to put basically to be able to, uh, to do a message.

03:12.230 --> 03:15.270
We're going to want it to, to to send a message.

03:15.430 --> 03:16.550
That's what we want.

03:16.710 --> 03:17.710
Here we are.

03:17.950 --> 03:18.470
Okay.

03:18.510 --> 03:20.870
So we're going to connect with with slack.

03:21.390 --> 03:23.710
We are going to have a resource be a message.

03:23.710 --> 03:25.510
The operations should be send.

03:25.710 --> 03:28.070
We're going to send the message to a channel.

03:28.310 --> 03:30.110
The channel we're going to pick an ID.

03:30.110 --> 03:34.470
And I've just gone and copied that channel ID again from slack pasting it in there.

03:34.510 --> 03:36.190
That's the same channel ID.

03:36.430 --> 03:38.830
It's a simple text message.

03:39.110 --> 03:39.750
Okay.

03:39.790 --> 03:40.670
That's done.

03:41.030 --> 03:45.270
Now you can probably guess that the message text is where we're going to have some problems, because

03:45.270 --> 03:49.910
we're going to want to have some sort of expression based on the data right here.

03:50.110 --> 03:53.150
And you may or may not remember what that JSON looks like.

03:53.190 --> 03:54.030
See if you can.

03:54.150 --> 03:56.840
But for now, let's just put the word bananas.

03:56.840 --> 03:58.840
Let's have it be a fixed string.

03:59.080 --> 04:03.240
Let's now go back and give this thing a whirl.

04:03.280 --> 04:03.720
Okay.

04:03.760 --> 04:07.560
First up I'm going to press Execute Workflow so that it starts waiting for an event.

04:07.600 --> 04:09.320
I'm going to go back over to slack.

04:09.480 --> 04:11.480
Let's make this slack window a bit smaller.

04:11.480 --> 04:12.680
So we get to see all this.

04:12.840 --> 04:18.520
And basically in slack I'm going to message the bot itself and say hi there.

04:18.600 --> 04:20.920
Press enter and keep fingers crossed.

04:20.920 --> 04:22.440
And oh it ran.

04:22.480 --> 04:25.520
There was a problem but it ran okay.

04:25.560 --> 04:26.120
The trigger worked.

04:26.120 --> 04:30.600
If the trigger didn't work for you, you have to go through and check everything really carefully,

04:30.920 --> 04:32.280
but hopefully it did.

04:32.320 --> 04:39.400
Hopefully we just got slack to send a webhook into our workflow.

04:39.640 --> 04:40.960
Okay, onwards.

04:40.960 --> 04:45.040
So our workflow had an error and the error was no prompt specified.

04:45.040 --> 04:50.160
And that's familiar because we had that before when we were were working with a slightly simpler integration,

04:50.280 --> 04:51.760
uh, with, with telegram.

04:52.000 --> 04:54.170
So if I double click on it, you can see what's happening.

04:54.170 --> 04:55.570
It's exactly the same thing.

04:55.810 --> 05:00.770
It thinks it's trying to connect to a chat trigger node and it's looking for JSON chat input.

05:00.770 --> 05:02.650
But that's not what we're getting from slack.

05:02.650 --> 05:04.010
And so it's confused.

05:04.130 --> 05:05.330
So we know what to do.

05:05.370 --> 05:06.730
We don't want this.

05:06.730 --> 05:13.490
We want to change this to define below, giving us the opportunity to say, hey, how do you unpack

05:13.610 --> 05:14.690
this JSON?

05:14.730 --> 05:16.930
Pluck out the thing that you want this.

05:16.930 --> 05:21.970
Hi there and put it in here in order to to select that as the message.

05:22.330 --> 05:23.650
So there's a few things we could do here.

05:23.650 --> 05:30.010
We could just drag this and drop it here and get a bunch of, of this sort of um, description, this

05:30.010 --> 05:33.090
expression which drills in to find this.

05:33.090 --> 05:35.410
But actually that's not what I want to do.

05:35.770 --> 05:43.410
What I want to do is I want to, to give all of this JSON as it is, as JSON to our AI agent and say,

05:43.410 --> 05:45.370
hey, we've got this message from slack.

05:45.490 --> 05:47.850
You're smart enough to know how to read JSON.

05:47.890 --> 05:52.220
Please respond to this fully understanding what's going on here?

05:52.340 --> 05:53.780
So that's that's what I'm going to say.

05:53.780 --> 06:01.220
I'm going to put as the prompt here, please respond to this message from slack.

06:02.020 --> 06:04.220
And then I'm going to put a couple of empty lines.

06:04.220 --> 06:08.260
And then I want to shove in this JSON as it is.

06:08.700 --> 06:14.780
So unfortunately if I just type now something like I put an expression and I just do dollar JSON when

06:14.780 --> 06:21.540
I do that, what gets put here is some sort of funny JavaScript object object thing, because this is

06:21.540 --> 06:27.900
JSON, it's not text and I don't know if you remember, but I mentioned that there's a way to turn JSON

06:27.900 --> 06:33.460
into a text version of that JSON and you just, you know, I'll show it to you.

06:33.500 --> 06:37.420
It's you type json.stringify, which is a special thing.

06:37.580 --> 06:42.900
And then you put this in brackets like that and bam, as soon as I've done that.

06:42.900 --> 06:45.980
And this is just one of those things, you can always look it up if you ever need to know it.

06:46.100 --> 06:51.230
Now the message going to the LLM is please respond to this message from slack.

06:51.390 --> 06:55.110
And then there is a bunch of JSON shoved in there.

06:55.430 --> 06:57.950
Okay, now you could also do it the way I showed you before.

06:57.950 --> 06:58.830
You could give it a try.

06:58.870 --> 06:59.790
See what happens.

06:59.790 --> 07:01.350
But I want to do it this way.

07:01.390 --> 07:05.550
And it's useful to let the LLM unpack the JSON.

07:05.590 --> 07:06.750
Let's see how it does.

07:06.790 --> 07:07.270
Okay.

07:07.310 --> 07:11.230
So press escape to come back here I press the execute button to start things going.

07:11.270 --> 07:16.310
I go back to slack and I'm going to repeat this this same message a second time.

07:16.550 --> 07:17.790
Let's do that again.

07:18.030 --> 07:19.270
Let me paste that in.

07:19.310 --> 07:19.590
Send.

07:19.630 --> 07:20.270
Hi there.

07:20.670 --> 07:22.910
And it's all running over here.

07:22.910 --> 07:23.670
Stuff is happening.

07:23.670 --> 07:27.070
We've got some ticks and it came back with bananas.

07:27.310 --> 07:28.710
Okay, okay.

07:28.750 --> 07:30.110
We did a round trip.

07:30.310 --> 07:33.270
It was all brilliant with one small caveat.

07:33.310 --> 07:38.110
Just a small, small thing, which is that we just got the hard coded word bananas.

07:38.270 --> 07:44.430
So the final, the final piece of the puzzle is to make it actually respond from our AI agent.

07:44.630 --> 07:45.670
Let's do that now.

07:45.790 --> 07:48.510
So back we are here in slack.

07:48.670 --> 07:55.670
I'm double clicking on send a message up it comes and we don't want the message text to be the word

07:55.710 --> 07:56.590
bananas.

07:56.790 --> 07:57.990
What do we want?

07:58.030 --> 08:02.070
Well, first up, we want to change this from being fixed to being an expression.

08:02.070 --> 08:04.190
And now do you remember how we do this?

08:04.230 --> 08:06.110
Do you remember how you do the expression?

08:06.150 --> 08:07.150
See if you can remember.

08:07.870 --> 08:14.510
And of course, the cheat is simply to drag from here and drop it here and you'll see exactly what it

08:14.510 --> 08:14.870
is.

08:14.870 --> 08:18.910
It's dollar JSON output, just as it was with telegram.

08:18.950 --> 08:24.630
We're collecting the output of the JSON that's coming in and taking, taking, taking the thing that

08:24.630 --> 08:26.230
is at the key output.

08:26.230 --> 08:32.630
And so at this point I can now press escape, I can come back here and we can give this a try.

08:32.670 --> 08:32.950
Okay.

08:32.990 --> 08:37.950
So I press Execute workflow I have the thing running I go back to slack I'm going to paste one more

08:37.950 --> 08:38.390
time.

08:38.390 --> 08:39.030
Hi there.

08:39.150 --> 08:41.550
Press enter see what happens.

08:41.550 --> 08:42.830
Yes I see things are running.

08:42.870 --> 08:43.710
Things are running.

08:43.710 --> 08:44.390
Hi there.

08:44.390 --> 08:45.670
How can I assist you today?

08:46.310 --> 08:47.280
We did it.

08:47.320 --> 08:49.440
We just had a round trip to slack.

08:49.440 --> 08:51.760
We used Oauth2 for the credentials.

08:51.760 --> 08:52.920
For the authentication.

08:52.920 --> 08:58.280
We set up a webhook so that slack could could send that message in to NHSN.

08:58.280 --> 09:00.160
And we got the round trip coming back.

09:00.160 --> 09:03.440
And we even used expressions as a way of hooking everything up.

09:03.760 --> 09:04.880
It held together.

09:05.280 --> 09:06.120
We did it.

09:06.120 --> 09:07.320
Congratulations.

09:07.560 --> 09:12.920
There is one more thing left to do, and that is to push this to production and to deploy to production.

09:12.920 --> 09:14.720
There's one more hoop we have to jump through.

09:14.720 --> 09:16.920
And that is, of course, to change the webhook.

09:17.320 --> 09:18.720
You remember the slack trigger.

09:18.760 --> 09:19.840
Double click on this.

09:20.120 --> 09:27.920
In this there is the setting here which is telling us where should slack call to to update this this

09:27.920 --> 09:28.440
trigger.

09:28.760 --> 09:30.320
And it's set to a test URL.

09:30.360 --> 09:33.760
Right now I want to look at the production URL.

09:33.760 --> 09:35.520
This is the production URL.

09:35.560 --> 09:37.360
That's the test one that we already hooked up to.

09:37.400 --> 09:38.840
This is the production one.

09:38.840 --> 09:40.360
Click to copy the URL.

09:40.360 --> 09:44.040
So I click and that's been copied to the clipboard okay.

09:44.280 --> 09:47.890
Now I'm just going to press the execute step button to have this thing running.

09:48.010 --> 09:49.970
I'm going to go back to slack.

09:50.490 --> 09:53.370
We are going to go to event subscriptions.

09:53.370 --> 09:54.210
Here it is.

09:54.250 --> 09:56.210
We're going to press the change here.

09:56.210 --> 09:57.850
We want to change the URL.

09:57.970 --> 10:01.050
This is the URL that slack calls when a message comes in.

10:01.130 --> 10:01.930
Change.

10:02.090 --> 10:02.810
What's the new.

10:02.850 --> 10:04.290
This is the previous one.

10:04.290 --> 10:07.890
We go to the new one and we paste the new URL in there.

10:07.890 --> 10:09.290
It doesn't have tests anymore.

10:09.570 --> 10:11.810
And then I'm didn't respond.

10:12.010 --> 10:12.410
Aha.

10:12.770 --> 10:15.890
Now I realize of course I made a little mistake there.

10:15.930 --> 10:17.930
We don't want to do this.

10:17.970 --> 10:22.810
In order for this production URL to run, we actually have to publish this properly.

10:22.850 --> 10:26.570
We're going to have to come back here and publish it into production.

10:27.010 --> 10:30.810
Just before I do that, I might add in a date node as well.

10:30.810 --> 10:31.650
Just why not?

10:31.650 --> 10:32.210
Let's do this.

10:32.210 --> 10:35.330
This is our new favorite thing to do get the current date.

10:35.370 --> 10:37.370
We will put that in there as well.

10:37.370 --> 10:43.780
And now with that in mind I'm going to publish this publish Publish.

10:44.060 --> 10:44.860
Off it goes.

10:44.860 --> 10:47.180
It is now running in production.

10:47.180 --> 10:49.580
So now we'll come back here again.

10:49.740 --> 10:50.820
Back to slack.

10:51.020 --> 10:54.180
We will retry this and it's verified.

10:54.180 --> 10:55.020
It works.

10:55.020 --> 10:56.580
We've deployed to production.

10:56.580 --> 10:59.060
So this webhook was received.

10:59.060 --> 11:03.420
So now don't forget to press save changes I always forget to press save changes.

11:03.420 --> 11:04.860
It says success.

11:05.140 --> 11:06.420
Has it been successful?

11:06.700 --> 11:07.500
Let's give it a whirl.

11:07.500 --> 11:08.780
Let's find out okay.

11:08.780 --> 11:09.620
We're going to go back.

11:09.660 --> 11:13.860
This is this is showing the production deployed uh workflow.

11:13.860 --> 11:18.380
We're going to go back to slack now and I'm going to, uh, send our usual.

11:18.420 --> 11:19.020
Hi there.

11:21.420 --> 11:22.980
And we'll see what happens.

11:22.980 --> 11:25.100
There's no nothing going on around here.

11:25.100 --> 11:27.100
And we get back from production.

11:27.140 --> 11:27.700
Hi, there.

11:27.700 --> 11:29.020
How can I help you today?

11:29.300 --> 11:32.580
Well, this time we are going to we're going to send this message again.

11:32.580 --> 11:43.430
But we're going to ask, of course, for the current date, what's the current date And see how it does.

11:45.470 --> 11:46.510
Off it goes.

11:46.750 --> 11:48.150
The current date December 15th.

11:48.190 --> 11:50.870
Yes, it used the date tool correctly.

11:51.070 --> 11:52.590
Everything is working.

11:52.790 --> 11:59.230
We have been able to just do a round trip with N810 in production from slack.

11:59.470 --> 12:02.710
It felt like quite a palaver, but we got it done.

12:02.710 --> 12:04.590
And I hope that you did too.

12:04.950 --> 12:07.790
All right, I'll see you for the wrap.

12:07.790 --> 12:08.510
So there you have it.

12:08.550 --> 12:10.030
We did three integrations.

12:10.070 --> 12:12.470
The push pushover was quite simple.

12:12.510 --> 12:17.270
Telegram was and slack was quite hardcore, but we got through them all.

12:17.310 --> 12:18.230
They're all working.

12:18.230 --> 12:20.310
I hopefully you picked a couple of them and did it too.

12:20.350 --> 12:26.070
Most important, you've got a better sense of things like OAuth two of using webhooks as the way that

12:26.070 --> 12:28.270
slack was able to send in that message.

12:28.430 --> 12:34.710
And you've got your first experience writing expressions, and even at looking back at a prior node

12:34.710 --> 12:36.510
and using Json.stringify.

12:36.670 --> 12:38.790
So just some insights to different pieces.

12:38.790 --> 12:43.240
And it honestly, it doesn't matter if you wouldn't know how to go in and do this yourself right now,

12:43.240 --> 12:47.800
because we're going to do lots of these and over time you'll get more and more confident, and you can

12:47.800 --> 12:50.920
always check out the docs for any of these integrations.

12:50.920 --> 12:52.160
And they're pretty good.

12:52.160 --> 12:55.120
And it's been a big day, but the day is done.

12:55.160 --> 13:01.120
We work with data, we did a bit of expressions and then we built three robust integrations.

13:01.120 --> 13:07.600
Communicating one was a one way communication with pushover and then two two way integrations with telegram

13:07.760 --> 13:08.720
and with slack.

13:08.720 --> 13:12.480
And you saw that idea of the trigger and then the pushing back to the platform.

13:12.480 --> 13:13.960
So much got done.

13:14.000 --> 13:15.280
Fantastic.

13:15.280 --> 13:18.840
Well, tomorrow is when we actually build a business project.

13:18.840 --> 13:24.000
And once you've made once you've put these integrations in place, using them is so easy.

13:24.040 --> 13:25.120
It's wonderful.

13:25.120 --> 13:29.400
So if today was a little bit grueling, I hope to make up for it tomorrow.

13:29.520 --> 13:31.320
And I will see you then.

13:31.520 --> 13:38.640
And just take a moment to recognize your 27% of the way through building your expertise.

13:38.800 --> 13:39.600
See you tomorrow.
