Orchestrating complete workflows
1. Orchestrating complete workflows
Hey everyone! In the previous video we learnt about adding rules and memories in Windsurf that helped us give more context and enforced boundaries. Now, it’s time to look at Workflows in Windsurf.2. Workflows in Windsurf
Workflows enable users to define a series of steps to guide Cascade through a set of tasks such as deploying a service or reviewing a PR. This feature is used for repetitive tasks that we want Cascade to run through via a series of steps.3. Workflows in action
Let’s see this in action. From the customization settings we click Workflow, and, just like with rules, we can set global and workspace workflows. In our Daily Journal app example we want to add the code and commit all the old or new changes to a repository, so we’ll be defining a workflow for it. First things first, let’s create a new repo on our GitHub. For that we head over to repo.new giving our repository a name, setting the privacy and then clicking the create repository button. Next, in our Cascade panel, we’ll set a workspace workflow just for this project. We give it the name `push-changes-to-github`. Then we’ll give a description of the workflow : “Add code and commit changes to repository for Daily Journal App”4. Workflows in action
In the content section, we add a YAML workflow that automates the addition of code and commits the new changes to a git repository. This workflow breaks down the task into steps, including generating code for new features and committing them with a descriptive message. Let’s break down the workflow we added: It will generate code for new features. We then use `git add .` to stage all file changes, including new, modified, and deleted files. We then commit staged files with a descriptive message summarizing updates.5. Workflows in action
We then push everything to our GitHub repository. Here, we’ll add the remote repository specified in the GitHub repo, so Windsurf can push the code to it. Upon saving this workflow, we’ll see a `.windsurf/workflow` folder created with a push-changes-to-github.md file in it with all the details to run the workflow. To run this workflow, we’ll be typing `/` and will get the workflow list that we’ve defined. We choose the push to GitHub workflow that will trigger it and then run that in write mode.6. Workflows in action
Windsurf will do everything from initializing the git repository, to staging all the files, committing them with a commit message and finally pushing the code to the repository. We’re done. If we check our GitHub repository we’ll be able to see all the code of our app inside it. Workflows are really helpful as they let us automate complex tasks step-by-step, saving time and reducing mistakes by chaining multiple actions—like code generation, testing, and git commits—into a single, repeatable process. We can define as many workflows as we want - they’re like our own shortcuts built right inside Cascade.7. Let's practice!
Let's practice workflows with Windsurf!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.