Before we begin, it’s worth noting that creating a workflow for the first time may be daunting. It might be hard to think through exactly what you want to automate. To help you generate some ideas and get you started, please take a look at our use cases and templates article.
To get started, access the Workflows Builder by navigating first to the Workflows section of your BetterCloud for G Suite top bar.
When you have reached the new BetterCloud app, select Workflows from the left nav, and NEW from the dropdown menu below.
This will take you to the Workflows Builder, where you can begin to construct your workflow.
A workflow is constructed by stringing “mad lib” statements together: when something happens, if it meets these criteria, then do these specific actions.
The Workflow Builder is divided into four sections:
- Selector - where you select events, conditions, and actions for your workflow
- Workspace - where your selector criteria are placed, to build your workflow, and where your workflow is given a name
- Workflow Notifications - where you can enable the option to send a notification once a Workflow completes with the status of the Workflow.
- Properties - where you configure individual conditions and actions
- Setup - where you can save, activate or delete your workflow
First, the selector is where you add events, conditions, and actions to the workspace.
A workflow typically consists of one event, one condition, and a few actions.
- An event (when) is something that triggers a workflow to start
- A condition (if) is scope that is added to an event
- An action (then) is something a workflow does
To keep things simple as we go, we'll refer to these as WHEN, IF, and THEN (instead of events, conditions, and actions).
Review available events, conditions, and actions by clicking WHEN, IF, and THEN.
If you know what you’re looking for, you can search within each category. The list will automatically filter as you go.
Let’s select a WHEN (or event).
For example, let’s select “User Moved to Org Unit”.
For more information about an item, help text is presented at the bottom of the selector.
Click the "+" icon to add an item to the workspace.
WHENs are generally very broad. They can be further scoped by IFs (conditions).
Notice in our example that the workflow will be triggered when “Any user is added to any org unit”.
Let’s select an IF (or condition), to scope this event further.
Notice the available options are “Org Unit” or “User”.
Let’s add “Org Unit”, so that we can define which Org Unit should trigger this workflow.
The workspace is updated with your selection. Notice the red text indicates that you must configure the condition.
Click select org unit.
The Properties section on the right side of the window will now present configuration options for this condition.
Let’s enter and select a specific org unit.
Notice the workspace text will update from red to blue, indicating no further action is needed.
Our example workflow will now trigger when any user is added to the “Product Team” org unit.
Now let’s add a THEN.
Let’s select a THEN (or action), to put this workflow to work.
Perhaps we want users added to a specific group when they’re added to an org unit. Let’s select “Add users to group”.
The workspace is updated with your selection.
Notice the blue text indicating the target user.
Every action has a target. The target defines the scope of an action. It sets to whom or to what the action will be performed against.
Where possible, targets will be automatically detected. In our example, we’re creating a workflow that triggers whenever a user is added to the “Product Team” org unit. So when we add an action that targets users (“add user to group”), the user is automatically targeted. This means the action will dynamically add to groups whomever is added to the org unit.
This is indicated in the Properties panel in the Target of Action section.
Notice the target is dynamically selected. You have the option to change this to someone or something specific.
For our example, we'll leave it as-is.
However, we still need to set the group. Let’s select our “Product” group since we’re working with users added to the “Product” org unit.
There’s more we could do, by adding more THEN statements from the selector, but our workflow is technically complete. Now whenever anyone is added to the “Product Team” org unit, they will automatically be added to the “Product” group.
Skip/stop on failure
For any given actions that your workflow can take, you can decide what the workflow as a whole should do, if an action fails. Every action now includes two possible modes: "Skip" and "Stop". If an action in the middle of a workflow fails to complete successfully, the workflow can either "skip" this action and continue with additional actions, or "stop" the workflow in its tracks, allowing you to manage the situation before the workflow takes any further actions.
Workflows that contain skipped actions will display as "Complete with Errors":
A workflow will only be marked as failed if it was unable to complete. The Workflow report will show you which actions were skipped:
Now let’s give this workflow a name.
Name and describe your workflow
At the top of your workspace, you can choose to simply name your workflow.
If you would like to provide a more detailed description of your workflow, click the gear icon next to the workflow's title. a slide-out view to the right will provide you with the ability to add a description to your workflow.
A workflow settings modal will pop-up. Enter a description and click Apply. This description will appear on the Workflows Manager page.
The Workflow Notifications feature can be configured to send an email whenever a Workflow completes with the status and a direct link to the results. This applies for all instances that complete with any status, or for individual statuses such as ones that complete successfully, complete with errors, are stopped manually, or fail to complete.
Once the Workflow has completed, the selected admin should see this in their inbox:
You can also view the status of the completed Workflow in the Workflow Report and who received the email notification:
Saving your Workflow
Now that your Workflow is configured, click Save to save it in draft form.
A status message will appear at the top of the Workspace.
Workflows are saved as “drafts” until they’re activated, by clicking "Activate"; saving a workflow doesn’t activate it. This allows you to reconfigure and save changes to a workflow, and review it later before letting it run on your domain.
Now that we’ve built our first workflow, let’s activate it.
See How To Activate a Workflow, for next steps.