WEBVTT

00:01.960 --> 00:06.480
In this lecture, we're going to take a look at another interesting functionality that windsurf has

00:06.720 --> 00:08.960
and that is called workflows.

00:08.960 --> 00:13.200
You can easily find workflows right here in the windsurf settings.

00:13.600 --> 00:18.120
So clicking on the settings will reveal here memory and rules.

00:18.480 --> 00:22.640
And I click here on manage I'm going to find here workflows.

00:23.320 --> 00:24.920
So what is workflow.

00:24.960 --> 00:30.880
You can think of these workflows like a bookmark for a set of actions that you want to take.

00:31.120 --> 00:36.480
Like for example deploying pretty much whenever you find yourself writing the same prompt and going

00:36.480 --> 00:41.400
over a series of steps over and over, you should consider creating a workflow instead.

00:41.400 --> 00:43.360
So let's take a look at a very simple example.

00:43.360 --> 00:48.720
To create a workflow, I'm going to click here on workflow and this is going to create a new file.

00:48.720 --> 00:51.760
I'm going to name the workflow Experimental Change.

00:53.240 --> 00:54.320
Press enter.

00:54.320 --> 00:58.040
And this is going to be created here in the workflows directory.

00:58.400 --> 01:02.280
And we can provide a description and also the content.

01:02.600 --> 01:07.480
So for the description I'm just going to give the experimental change name.

01:08.080 --> 01:13.860
And let's say that We want to use a workflow when we want to try some experiments.

01:14.140 --> 01:16.780
So for each experiment, we want to create a new git branch.

01:17.260 --> 01:19.740
We want to implement the changes that are requested.

01:19.780 --> 01:22.380
And also we want to commit those changes to GitHub.

01:22.620 --> 01:28.260
Maybe this is not the best workflow, but I just wanted to show you a relatively realistic example.

01:28.260 --> 01:30.820
So I'm going to go ahead and save these changes.

01:31.180 --> 01:34.700
And this is the interesting part because we need a way to call this workflow.

01:35.300 --> 01:39.700
And this is actually done directly from the prompt right here below.

01:40.180 --> 01:42.580
So I'm going to write here a forward slash.

01:42.580 --> 01:47.180
And you're already going to see here experimental change appearing so I can select it.

01:47.860 --> 01:52.540
Or as an alternative just in case you're wondering what is this thing here.

01:53.100 --> 01:56.100
This is also a way to trigger this.

01:56.340 --> 01:59.260
So you either press that button or use a forward slash.

01:59.740 --> 02:03.460
And now we are going to implement a small change.

02:03.460 --> 02:07.900
So we're going to change the title from my board to my cool board.

02:08.220 --> 02:10.180
And let's see exactly what is happening.

02:11.980 --> 02:15.180
So the first step a branch has been created.

02:16.020 --> 02:17.900
And there are a few commands that we need to run.

02:18.820 --> 02:22.520
The file header has been updated so we can take a look here at the diff.

02:22.560 --> 02:25.760
I'm going to see that the name has been changed.

02:25.800 --> 02:27.880
Unfortunately this is right here in the middle.

02:28.840 --> 02:30.840
And there are a few commands that we need to run.

02:30.840 --> 02:33.240
So we're going to add the changes we're going to commit.

02:34.400 --> 02:36.720
And we're going to also push this change.

02:37.800 --> 02:42.760
Of course we can decide to automate all the git commands so that we don't have to do this manually.

02:43.240 --> 02:45.520
But we're going to get here the information.

02:45.520 --> 02:47.560
This workflow has been done.

02:47.960 --> 02:49.680
So branch has been created.

02:50.080 --> 02:52.360
It has been fetched and checked out locally.

02:53.080 --> 02:54.680
The header has been changed.

02:55.120 --> 02:57.360
This change has been committed and pushed.

02:57.360 --> 03:00.520
And one thing we can take a look at GitHub and see this change.

03:00.800 --> 03:03.080
But this was the main idea of these workflows.

03:03.080 --> 03:06.920
So again whenever you find yourself that you're going through a lot of steps and you're doing this all

03:06.920 --> 03:08.440
the time, it's quite convenient.

03:08.440 --> 03:09.120
You press forward.

03:09.120 --> 03:10.920
Slash can already start that change.

03:11.200 --> 03:11.680
Theoretically.

03:11.680 --> 03:13.200
You don't even need a prompt after that.

03:13.200 --> 03:18.280
So you can store everything right there can be useful if you just want to.

03:18.440 --> 03:24.200
Let's say, for example, have a quick way of committing changes and pushing them or many other use

03:24.200 --> 03:24.720
cases.

03:25.040 --> 03:27.600
And I'm sure you're going to use this feature a lot.
