How to Create a Workflow

Follow

Contents

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 case articles.

Getting Started

To get started, access the Workflows Builder either by navigating to the Workflows section of your BetterCloud for G Suite top bar…

How_To_Create-0.png

…or by selecting Workflows from the left nav in BetterCloud, and NEW from the dropdown menu below.

How_to_Create_1.png 

This will take you to the Workflows Builder, where you can begin to construct your workflow.  

How_To_Create-2.png

A workflow is constructed by stringing a series of 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 the events, conditions, and actions comprising your current workflow configuration appear
    • Workflow Notifications - where you can enable the option to send a notification with the status of the workflow once a workflow completes
  • Properties - where you configure individual conditions and actions
  • Setup - where you can save, activate or delete your workflow

How_To_Create-3.png

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 (though conditions are not required if the workflow is already appropriately scoped by the event).

  • 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.

WHEN__IF__THEN.png

If you know what you’re looking for, you can search within each category. The list will automatically filter as you go.

How_To_Create-4.gif

Adding WHENs

Let’s select a WHEN (or event).

For example, let’s select “User’s Org Unit Changes”.

How_To_Create-13.png

For more information about an item, help text is presented at the bottom of the selector.

Click the "+" icon or click on the event’s name to add it to the workspace.

How_To_Create-14.png

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’s Org Unit membership changes”, so we will likely want to specify what Org Unit we want to scope the trigger by.

You can also use most alerts as WHEN events. Because alerts can be scoped by additional conditions that may not be available in the Workflow Builder, they can often provide a more granular trigger for your workflows. System alerts will show up in the Workflow Builder by default. Once you create a custom alert it will also show up in the Alerts section of the library for use as a WHEN event.

Please note: Workflows that use alerts as their WHEN event will only run when the alert triggers after the Workflow has already been published. For more on using an alert as a Workflow event, please refer to this documentation.

Adding IFs

Let’s select an IF (or condition), to scope this event further.

Let’s add “Org Unit”, so that we can define which Org Unit should trigger this workflow.

How_To_Create-6.png

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.

 Image_2019-09-30_at_4.24.28_PM.public.png

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.

Adding THENS

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 the Product Team org unit. Let’s select “Add To Group”.

How_To_Create-7.png

The workspace is updated with your selection.

Image_2019-09-30_at_4.27.40_PM.public.png

Notice the text indicating the target user.

Every action has at least one target that will need to be filled in. In many cases you will just want to have the workflow target the user who met the triggering conditions. This user can be specified by opening the “{{“ dynamic fields menu, and selecting the user option under “Event”, as in the gif below.

How_To_Create-8.gif 

For more about using dynamic fields, please refer to this documentation.

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.

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.

 Image_2019-09-30_at_4.26.38_PM.public.png

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 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 completely. Please note: workflows that stop cannot pick up where they left off at a later date. They must either be re-triggered or run on-demand in order for the additional actions to be taken.

Skip:

Skip_Action_in_WF.png

Stop:

Stop_WF_Action.png

Workflows that contain skipped actions that fail will display as "Complete with Errors": NEW_Workflow_Results_Page.png

A workflow will only be marked as failed if it was unable to complete. The Workflow report will show you which actions were skipped:

NEW_Workflow_Report.png

Now let’s give this workflow a name.  

Name and describe your workflow

At the top of your workspace, you can name your workflow.

Name_and_Describe_WF_.png

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.

Workflow_Settings.png

A workflow settings modal will pop-up. Enter a description and click Apply. This description will appear on the Workflows Manager page.

Enabling Notifications

The Workflow Notifications feature can be configured to send an email whenever a Workflow completes, updating whoever you'd like with the status and a direct link to the results. They can be set to send for 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.

Updated_WF_Email_Notifications_Page.png

Once the Workflow has completed, the selected users should see this in their inbox:

How_to_Create-10.png

You can also view the status of the completed Workflow in the Workflow Report, as well as who received the email notification:

WF_Report_withe_email_notification.png

Saving your Workflow

Now that your Workflow is configured, click Save to save it in draft form.

Saving_WF_update.png

A status message will appear at the top of the Workspace.

Status_at_the_top_of_the_Workspace.png

Workflows are saved as “drafts” until they’re activated by clicking "Publish". Saving a workflow doesn’t activate it, though it does cause it to appear in Action Engine to be run on-demand. This allows you to reconfigure and save changes to a workflow, and review it later before letting it run automatically on your domain.

Now that we’ve built our first workflow, let’s test it.

See How To Test a Workflow for next steps. 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request