Workflows - User Guide

The guide below will advise on how to use, set up and maintain your Bluewater workflows

What is a Workflow?

The purpose of a workflow is to take the burden of manual tasks away from our customers. A workflow consists of three components: WHEN an event happens, IF the conditions are met, THEN the action will be performed.

 
 

WHEN an Event Happens

 

A workflow is executed when a specific event happens. For example, a workflow can be executed when a service is created. Customers can specify which events will lead to the execution of their workflows. We have events available for the creation, updating, and deletion of the most commonly used objects:

  • Service

  • Device

  • User

  • Cost Centre

  • Billing Account

  • Order

  • Approval Rule

  • Approval

We have also introduced events for some special scenarios that customers are interested in:

Service Billed
When a service appears in a bill we have received.

Report Month Incremented
When a bill for a new month, under the key account if applicable, is received by Bluewater.

Pre-Bill Data Usage Exceeded
When a service or pool has used more data, pre-bill, than the configurable percentage.

Device Purchase Date Exceeded
This is the only time-based trigger we have; all others are event-based.
It occurs when a device is older than a configurable age, based on the purchase date.

Number of Triggers

Customers are given a number of free workflow triggers. Whenever the event of a workflow happens, e.g. a service is updated, it counts as one trigger, regardless of the conditions.

IF the Conditions are Met

A lot of times, customers are only interested in certain types of records, e.g. only service records with the status “Activated.” In this case, customers can define the conditions for their workflows. The workflows will be executed whenever the event happens, but will stop if the conditions are not met.

What conditions you can define depends on the trigger you selected. You can create a condition based on the values of the object that triggered the workflow. We call these Trigger Attributes, e.g. property values of the service created. You can find most of the properties after you expand the Entity in the Attribute field.

If the event is about updating an object, you can find the before and after images of the object as Old Entity and New Entity. You can also use the Trigger Attributes in the value of the condition, so that you can compare the old and new values. For example, when a service is updated, you can check if the service’s user has changed with this condition.

Customers can use Logic Groups to group their logic, just like using brackets in a formula. This provides greater flexibility than what is typically available in many other workflow engines, for example:

(Status equals “Activated” AND Billing Status equals “Billed”)

You cannot combine both AND and OR conditions within the same Logic Group. For example, the following is not allowed:

Cross Mark (Status equals “Activated” OR Status equals “Awaiting Cancellation“ AND Billing Status equals “Billed”)

This is only allowed outside a Logic Group, for example:

(Status equals “Activated” OR Status equals “Awaiting Cancellation“) AND Billing Status equals “Billed”

THEN Take the Action

After an event occurs and the conditions are met, the required action can be performed. Bluewater supports two types of actions.

Webhook Action

 
 

This is a powerful action that allows the workflow to call an external API. It can be an API the customer built for data synchronization or one provided by software such as ServiceNow. The call can be made to any type of API, but it is typically a POST request with a custom message in application/json format sent to a URL provided by the customer.

The Trigger Attributes mentioned above can also be used in the body content, allowing customers to pass details about the object of interest.

Below are some examples of how API calls can be used to integrate with popular software.

▶ Run Test

After saving the workflow with a webhook action, customers can run a test to ensure they can receive the call on their end. Since there is no object to trigger this event, the Trigger Attributes will be presented as something like }.

 

Send a Slack message

  1. Create a Slack App on the customer side

    1. Go to https://api.slack.com/messaging/webhooks and click the button “Create your Slack App”

      1. Choose “From scratch”

      2. Provide a name

      3. Choose your Workspace

    2. Go to Incoming Webhooks

      1. Toggle to On

      2. Click “Add New Webhook to Workspace”

      3. Choose a channel

      4. The Webhook URL is available for the Target URL

  2. Go to Bluewater Workflow to create a workflow with the above values pre-populated

    1. Fill in the Target URL with the URL you got from the above step

    2. Modify the “text” to fulfil your need

    3. Click Save and Run Test

Property

Value

Method

Post

Target URL

(From 1.b.iv above)

Body Type

Custom

Body Media Type

application/json

Body Content

{
"text": "Hello, world."
}

 

Send a Microsoft Teams message

Please refer to Create & Send Actionable Messages - Teams for the official guidelines.

  1. Go to Microsoft Teams on the customer side, to the channel or chat you want to receive the message.

    1. I will use chat for this example

    2. Click “…” > Workflows

    3. Search for and select the template “Post to a chat when a webhook request is received”

      1. You can change the user who will post the message

    4. Click Next, and this chat will be pre-populated with the Details of this workflow

    5. Click Add Workflow, and you can find the URL to send messages to this chat

  2. Go to Bluewater Workflow to create a workflow with the above values pre-populated

    1. Fill in the Target URL with the URL you got from the above step

    2. Modify the “text” under “TextBlock” to fulfil your need

    3. Click Save and Run Test

      1. You can see the results in the Teams Workflows > 28-day run history

 

Property

Value

Method

Post

Target URL

(From 1.e above)

Body Type

Custom

Body Media Type

application/json

Body Content

{ "type":"message", "attachments":[ { "contentType":"application/vnd.microsoft.card.adaptive", "contentUrl":null, "content":{ "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", "type":"AdaptiveCard", "version":"1.2", "body":[ { "type": "TextBlock", "text": "For Samples and Templates, see [https://adaptivecards.io/samples](https://adaptivecards.io/samples)" } ] } } ] }

Create a Service NOW ticket

Please refer to How to Integrate Webhooks Into ServiceNow for the official guidelines.

There should be an easier way with IntegrationHub > Webhooks, below is how you can do it with the free version.

  1. Go to ServiceNow, to the channel or chat you want to receive the message.

    1. Go to System Web Services > Scripted Web Services > Scripted REST APIs

    2. Click New

    3. Enter name and id, the id will become part of the URL

    4. Click Submit

    5. Go back to the API you have just created, go to Resources and click New

    6. Fill in the details below and click Submit

    7. Your service now URL plus the Resource Path of the Resource becomes your API URL

 

Property

Value

Name

e.g. create-incident

HTTP method

POST

Script

Depending on your use case, below is one example taking two parameters short_description and description to create an incident

(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {     var body = request.body.data;     var incident = new GlideRecord('incident');     incident.initialize();     incident.short_description = body.short_description || "Webhook Triggered Incident";     incident.description = body.description || "No description provided";     incident.insert();     response.setStatus(201);     response.setBody({ result: "Incident Created" }); })(request, response);

Require Authentication

You can turn it off while testing and add it back later on

 
2. Go to Bluewater Workflow to create a workflow with the above values pre-populated
    1. Fill in the Target URL with the API URL you got from the above step

    2. Modify the “short_description” and “description” to fulfil your need

      1. You can even add more properties as long as your scripted API supports

    3. Click Save and Run Test

Property

Default Value

Method

Post

Target URL

(from step 1 above)

Body Type

Custom

Body Media Type

application/json

Body Content

{
"short_description": "New Incident via Webhook",
"description": "Webhook triggered this ticket"
}

Send an Email Action

 

Instead of relying on an instant messaging tool to receive the notification through a webhook action, customers can also choose to receive an email.

An email can be sent to any email address, but it must be from a fixed list of email addresses. Customers can also use the Trigger Attributes in the subject and content of the email, allowing them to include details about the object of interest.

 

What is a Workflow Template?

 

We understand that setting up a workflow from scratch can be overwhelming. To help, we have pre-selected a few common use cases and created templates for them. After selecting your workflow template, some key parts of the workflow are pre-filled to save you time. However, there are still some properties that need to be filled in before the workflow can be created. If the action is a Webhook, customers will also need to complete the necessary preparations on their side.

If you find workflows powerful but are unsure where to start, you can find inspiration in the workflow templates as well.

Please note that you can modify any part of the template. If your team doesn’t use Slack, feel free to change the action to "Send an Email."

 

The Meaning of All Triggers

 

Trigger Category

Trigger

Meaning

Triggering Entity

Billing

Pre-Bill Data Usage Exceeded

A service or data pool has exceeded the configured usage threshold in terms of percentage, before the bill is issued.

The workflow will not be triggered twice for the same service or pool within the same range and bill date. For example, if a service is notified for exceeding 100%, it will not be notified again until the next billing cycle.

All workflows with the "Pre-Bill Data Usage Exceeded" trigger will be activated when necessary, counting as a single execution. The workflow will only proceed if the data falls within the configured range.

Pre-Bill Data Usage

 

Service Billed

Bluewater has received the billing data for a service for the latest month.

This applies only to the latest month, meaning the recalculation will trigger at most one additional time for the current month, but not for any previous months.

This also means you cannot build a workflow for historical billing data. Workflows are designed for the future, not the past.

Service Bill Summary

 

Report Month Incremented

Bluewater has received the billing data for a key account for the latest month.

The portal now displays the data for this new report month.

Report Month

 

Billing Account Created

A bill for a new billing account is processed, and the billing account is created.

Billing Account

 

Billing Account Deleted

 

Billing Account

 

Billing Account Updated

When a new bill for a billing account is processed, the last bill date will be updated.

A billing account can also be updated for other purposes.

Billing Account

Organization Data

Cost Centre Created

A cost centre refers to any individual node in the cost centre tree.

Cost Centre

 

Cost Centre Deleted

 

Cost Centre

 

Cost Centre Updated

 

Cost Centre

 

User Created

 

User

 

User Deleted

 

User

 

User Updated

 

User

Asset

Device Purchase Date Exceeded

The device is at the configured age, e.g., 2 years old, based on the Purchase Date.

Device

 

Device Created

 

Device

 

Device Deleted

 

Device

 

Device Updated

 

Device

 

Service Created

 

Service

 

Service Deleted

 

Service

 

Service Updated

 

Service

Ordering

Approval Created

An approval record is created when a cart is determined to require approval.

Approval

 

Approval Updated

It will be updated each time an approver clicks approve or reject.

Approval

 

Approval Rule Created

 

Approval Rule

 

Approval Rule Deleted

 

Approval Rule

 

Approval Rule Updated

 

Approval Rule

 

Order Created

An order is created when approval is not required or when the corresponding shopping cart is approved.

Order

 

Order Updated

 

Order

Use Cases

The best use cases are already presented as templates. A working workflow is just a few clicks away.

Get notifications via email or your preferred messaging tools, like Slack, using simple API calls.

New Report Month

You're expecting your key bills to arrive but aren't sure if they have. CONNECT will notify you as soon as they are received.

Monitor Pre-bill Data Usage

Concerned about services or pools consuming too much data? CONNECT notifies you when usage exceeds your customizable threshold, so you can take control before it’s too late.

You can monitor pre-bill data usage of pool, shared services and non-shared services. You can even set up multiple alerts each for different thresholds.

Health Checks for Billed Services

Tired of manually checking your bills for issues after they arrive? CONNECT performs a health check and notifies you of problems like services still billed after cancellation, unused services, or unallocated costs, so you don’t need to log in just to review reports. Stay ahead with notifications for:

  • Cancelled still Billed

  • Potentially Redundant Services

  • Unallocated Costs

You can monitor many more service billing metrics beyond those suggested by templates. Here are just a few:

  • High-cost services – Flag any services exceeding a set amount or track call charges only.

  • Over-budget services – Get alerts when costs exceed your budget.

  • Monthly service cost variations – Monitor percentage changes from last month.

  • Excessive data usage – Detect services consuming too much data.

  • Credits applied (Coming soon) – Track when a credit is issued.

  • Unusual call patterns (Coming soon) – Get notified of excessive domestic or international calls.

Refresh Fleet Devices

Prefer to refresh your fleet gradually throughout the year instead of a single overhaul? Let us know the age threshold for replacing devices, and we’ll notify you when it’s time.

Device Re-assignment

We don’t have a template for this, but you can easily create your own. When a device’s user is updated, an email is sent to both the old and new users. If there’s an error in the update, they can notify you.

Kick off Offboarding

CONNECT can send an email when a user is marked as inactive to initiate the offboarding process or send an email to remind them to return their devices. The process becomes even easier when users are automatically marked as inactive through data synchronization.