Workflows enable users to define a series of steps to guide Cascade through a repetitive set of tasks, such as deploying a service or responding to PR comments.

These Workflows are saved as markdown files, allowing users and their teams an easy repeatable way to run key processes.

Once saved, Workflows can be invoked in Cascade via a slash command with the format of /[name-of-workflow]

How it works

Rules generally provide large language models with guidance by providing persistent, reusable context at the prompt level.

Workflows extend this concept by providing a structured sequence of steps or prompts at the trajectory level, guiding the model through a series of interconnected tasks or actions.

To execute a Workflow, users simply invoke it in Cascade using the /[workflow-name] command.

You can call other Workflows from within a Workflow!

For example, /workflow-1 can include instructions like “Call /workflow-2” and “Call /workflow-3”.

Upon invocation, Cascade sequentially processes each step defined in the Workflow, performing actions or generating responses as specified.

How to create a Workflow

To get started with Workflows, click on the Customizations icon in the top right slider menu in Cascade, then navigate to the Workflows panel. Here, you can click on the + Workflow button to create a new Workflow.

Workflows are saved as markdown files within the repository root of .windsurf/workflows/ and contains a title, description, and a series of steps with specific instructions for Cascade to follow.

Workflow files are limited to 12000 characters each.

Generate a Workflow with Cascade

You can also ask Cascade to generate Workflows for you! This works particularly well for Workflows involving a series of steps in a particular CLI tool.

Example Workflows

There are a myriad of use cases for Workflows, such as:

/address-pr-comments

This is a Workflow our team uses internally to address PR comments:

1. Check out the PR branch: `gh pr checkout [id]`

2. Get comments on PR

 bash
 gh api --paginate repos/[owner]/[repo]/pulls/[id]/comments | jq '.[] | {user: .user.login, body, path, line, original_line, created_at, in_reply_to_id, pull_request_review_id, commit_id}'

3. For EACH comment, do the following. Remember to address one comment at a time.
 a. Print out the following: "(index). From [user] on [file]:[lines] — [body]"
 b. Analyze the file and the line range.
 c. If you don't understand the comment, do not make a change. Just ask me for clarification, or to implement it myself.
 d. If you think you can make the change, make the change BEFORE moving onto the next comment.

4. After all comments are processed, summarize what you did, and which comments need the USER's attention.

/git-workflows

Commit using predefined formats and create a pull requests with standardized title and descriptions using the appropriate CLI commands.

/dependency-management

Automate the installation or updating of project dependencies based on a configuration file (e.g., requirements.txt, package.json).

/code-formatting

Automatically run code formatters (like Prettier, Black) and linters (like ESLint, Flake8) on file save or before committing to maintain code style and catch errors early.

/run-tests-and-fix

Run or add unit or end-to-end tests and fix the errors automatically to ensure code quality before committing, merging, or deploying.

/deployment

Automate the steps to deploy your application to various environments (development, staging, production), including any necessary pre-deployment checks or post-deployment verifications.

/security-scan

Integrate and trigger security vulnerability scans on your codebase as part of the CI/CD pipeline or on demand.