Configure flows

This page shows you how to configure flows after you’ve added them to your WVS project. Flows have attributes and input variables that you can configure to change the flow’s properties or behaviors. Some configurations are required for a flow to work, while others are optional.

Configure triggering conditions

By default, the flows that you add to your projects are triggered every time there’s a change to the project repository. You can further restrict the conditions for triggering a flow by changes to specific branches, files, or configure manual triggering.

Trigger on branch changes

To configure a flow to run when there’s a change to specific branches of your repository, run the following command:

wvs flow set branch <FLOW_NAME> <BRANCH_NAME>

Replace the following:

  • <FLOW_NAME> with the name of the flow.
  • <BRANCH_NAME> with the name of the branch to trigger the flow.

This command sets the branch attribute of a flow. This attribute is empty by default, which means that changes to any branch triggers the flow.

Example: To trigger the flow DebugBuild when there’s a change to branch main, dev, or stable, run the following command:

wvs flow set branch DebugBuild main dev stable

Add a branch

If you have a list of branches already configured to the branch attribute and want to add more branches, you can specify the --add flag with the flow set branch command:

wvs flow set branch <FLOW_NAME> <NEW_BRANCH> --add

Replace <NEW_BRANCH> with the name of the branch that you want to add.

Remove a branch

If you want to remove a branch from the list of branches configured in the branch attribute, you can specify the --delete flag with the flow set branch command:

wvs flow set branch <FLOW_NAME> <OLD_BRANCH> --delete

Replace <OLD_BRANCH> with the name of the branch that you want to remove.

Trigger on file changes

To configure a flow to run when there’s a change to specific files or specific sections of your repository tree, run the following command:

wvs flow set change <FLOW_NAME> <PATH>

Replace <PATH> with the path of the file or directory to trigger the flow.

This command sets the change attribute of a flow. This attribute is empty by default, which means that changes to any file or directory triggers the flow.

Example: To trigger the flow DebugBuild when there’s a change to main/source directory, run the following command:

wvs flow set change DebugBuild main/source

Use wildcards

You can use wildcards to specify patterns that match to files or directories in the flow set change command. The command uses the standard glob syntax.

Add files or directories

If you have a list of files or directories already configured to the branch attribute and want to add more, you can specify the --add flag with the flow set change command:

wvs flow set change <FLOW_NAME> <NEW_PATH> --add

Replace <NEW_PATH> with the path to the file or directory that you want to add.

Remove files or directories

If you want to remove a branch from the list of branches configured in the branch attribute, you can specify the --delete flag with the flow set branch command:

wvs flow set branch <FLOW_NAME> <OLD_BRANCH> --delete

Replace <OLD_BRANCH> with the name of the branch that you want to remove.

Trigger manually

You can manually trigger a flow by configuring a trigger string for the flow and including the trigger string in a commit message. To configure a trigger string for a flow, run the following command:

wvs flow set manualTrigger <FLOW_NAME> "<TRIGGER_STRING>"

Replace the following:

  • <FLOW_NAME> with the name of the flow.
  • <TRIGGER_STRING> with the string value that you want to use to manually trigger the flow. Trigger strings use the standard go regex syntax. If you want to include special characters, you need to escape them to get your expected results.

You can’t manually trigger disabled flows.

Example: To configure the trigger string -doBuild for the shippingBuild flow, you run the following command:

wvs flow set manualTrigger shippingBuild "-doBuild"

Disable automatic triggering

Automatic triggering for flows is enabled by default. You can disable automatic triggering for a flow so that it is only triggered manually. To disable automatic triggering for a flow, run the following command:

wvs flow set manualOnly <FLOW_NAME> true

Replace <FLOW_NAME> with the name of the flow.

If you want to enable automatic triggering, replace the value of true in the command with false.

Restrict automatic updates

When you add a flow from the flow registry to your project, WVS adds the most recent version of that flow and automatically applies updates when they’re available. However, when you’re nearing the final stages of your project, we recommend that you restrict automatic updates for your flows to within a version range or lock it to a specific version. This way, you don’t get unexpected behaviors with your flows.

Version format and behavior

Flow versions are standardized in the form vA.B.C, where A is the major version number, B is the minor version number, and C is the patch number. The following table shows the impact that each version number update may have.

Version number Description Update impact
Major version Introduces significant functionality May not be backwards compatible and require additional configuration.
Minor version Minor releases that are backwards compatible with the previous version. May change behaviors and require additional configuration.
Patch Fixes bugs or improves existing functionality. Does not change behaviors or require additional configurations.

Lock flows to a specific version

To keep your flow locked to a specific version, run the following command:

wvs set defref <FLOW_NAME> <VERSION>

Replace the following:

  • <FLOW_NAME> with the name of the flow.
  • <VERSION> with the version number that you want to keep the flow locked to.

Example: To keep the shippingBuild flow locked to v1.4.2, you run the following command:

wvs flow set shippingBuild defref v1.4.2

Keep flows within a version range

To restrict automatic updates to patches only, you can specify the version number in the flow set defref command as_ vA.B.x_. To restrict automatic updates to minor versions and patches, specify the version number as vA.x.x.

Example: Using the previous example of the shippingBuild flow, the commands are as follows:

Patches only:

wvs flow set ShippingBuild defref v1.4.x

Minor versions and patches only:

wvs flow set ShippingBuild defref v1.x.x

Configure a display name

To give your flows a user friendly and descriptive name, you can configure a display name for the flows. Display names are used in the WVS Web Client and in reports that are generated by the flow, but are not used in configurations.

To create a display name for a flow, run the following command:

wvs flow set displayName <FLOW_NAME> "<DISPLAY_NAME>"

Replace the following:

  • <FLOW_NAME> with the name of the flow.
  • <DISPLAY_NAME> with the display name that you want to give the flow. Display names can include spaces and special characters.

Example: To give the shippingBuild flow a display name of UE Shipping Build, you run the following command:

wvs flow set displayName shippingBuild "UE Shipping Build"

Configure input variables

Some flows have input variables that need to be configured before the flow can work. To check which flows still need to have its input variables configured, see Validate flow configurations. You can configure input variables by running the following command:

wvs flow set variable <FLOW_NAME> <VARIABLE_NAME> <VALUE>

Replace the following:

  • <FLOW_NAME> with the name of the flow.
  • <VARIABLE_NAME> with the name of the variable that you want to configure.
  • <VALUE> with the value that you want to assign the variable.

Example: If you want to configure the OUTPUT_NAME input variable to MyOutputFile.zip for the flow zipTheBuild, you run the following command:

wvs flow set variable zipTheBuild OUTPUT_NAME MyOutputFile.zip

Connect flows

Two flows are considered connected when the output of one flow becomes the input of another flow. In this case, the flow producing the output is called the predecessor and the flow receiving that output as input is called the follower.

To connect flows, run the following command:

wvs flow connect <PREDECESSOR> [<OUTPUT>] to <FOLLOWER> [<INPUT>]

Replace the following:

  • <PREDECESSOR> with the name of the predecessor flow.
  • <OUTPUT> with the predecessor’s output variable. Optional if the predecessor produces only one output variable.
  • <FOLLOWER> with the name of the follower flow.
  • <INPUT> with the follower’s input variable. Optional if the follower has only one input variable.

Example: If you want to connect the build flow myBuild to the deploy flow myDeploy, run the following command:

wvs flow connect myBuild to myDeploy

Next steps