See related

Workflows overview

Last Update: Sep 2024 • Est. Read Time: 4 MIN
To check plan availability, see the pricing page.

Workflows make it easy to automate processes or add custom business logic to take full advantage of the Kustomer platform. Workflows are triggered when events occur in Kustomer or in any connected apps, then use conditional branching to add tags, assign users, create customers, or even make calls to external systems. Workflows allow organizations to eliminate tedious and inefficient manual tasks and augment the data stored in Kustomer to ensure teams have all of the information they need.

Key Features

  • Conditional Branching: Workflows allow complex decision-making through multiple branches. Real-world processes are not necessarily linear, so they shouldn't be limited to a linear flow.
  • Multi-Step Workflows: Unlike many “if this, then that” systems that limit users to a single step, workflows allow a sequence of steps where each step can use the output of any step that ran before it.
  • Extensibility: Workflows are flexible, extensible (via Apps, Hooks, and REST API calls), and can be augmented by Kustomer apps and custom integrations. If there's a business process to automate, then there's a way to achieve it with a workflow.

To make the most of workflows and learn about more advanced workflow features, check out:

Who can access this feature?
User typesAdmins can access the Workflows page.


In this article:

Triggers

A trigger is a defined event that will cause a workflow to run. These can occur from an event inside or outside of Kustomer and are received via a web, form, or email hook. Every trigger event will include data about that event, which is made available to the workflow's condition and action steps. For example, in Kustomer, a trigger would be when a customer, conversation, or message is created or updated.

Conditions

A condition step includes one or more rules the workflow follows after a trigger and determines what action to take next. A trigger will pass along data about the trigger event to a condition step. The condition will use this data to check if the trigger meets the condition's pre-defined set of rules. You can check for more than one condition in a single step using logic operators AND and OR. For example, you may want to create a workflow to run whenever a new conversation is created by a customer via email. To do this you would set a condition to check if the "Message Created" trigger includes a message whose channel is "email", direction is "in", and direction type is "initial-in".

Note: All fields are case-sensitive.

Actions

An action is an event that will run based on the data you define. Standard actions in Kustomer include events that lookup, create, or update conversations and/or customers. For example, you can add an action to a workflow to look up a customer by using the customer ID returned in a message.

Apps

Triggers and Actions can be organized by apps. New apps installed in Kustomer will add additional capabilities to workflows and can be used to interact with any connected systems.

Scheduled workflows

Sometimes you may want to take action a certain amount of time after an event has occurred. Scheduled workflows allow you to delay the execution of a workflow to do things like marking conversations done a week after the last outbound message or sending a survey two days after a conversation is marked done.

Manage workflows

You can manage and create workflows from the Workflows Settings. From this page, you'll be able to manage all of your custom user-created workflows, as well as app-created workflows that are automatically installed by installing Kustomer integrations.

  1. Go to Settings> Platform > Workflows.
  2. Select Add Workflow
  3. Select Custom Workflow to create a new workflow from a blank slate, or Import Workflow to create a workflow template from a JSON file.

Only active custom workflows count toward your plan limit. Use the on/off toggles to activate or deactivate workflows as needed.

Design a workflow

When designing a workflow, it helps to think through when your workflow should run and what your workflow should do.

The when of a workflow translates to a trigger and a condition. Select a trigger and then use a condition step to ensure the event matches your intent.

For example:

  • when a new message comes in
  • when an order status changes from shipped to delivered
  • when a customer is updated in your external admin system

The what of a workflow is a sequence of actions and conditions. Remember that you can use multiple actions in a workflow, so you can make a call to your external system and then make a decision based on the result of that call as to which action you will take next.

For example:

  • send an automated response to a customer and then snooze the conversation
  • check for keywords in a message and tag or assign the conversation
  • sync a customer record with your external admin system

Reference earlier steps in a workflow

When creating workflows, you may want to reference the output of a previous workflow step. For example, here's a workflow where you may want to update the customer associated with a conversation you looked up.

To find the correct customer, you'll need to fill in the ID field with the correct attribute mapping, which can be done in two ways.

First, you can use the drop-down menu to select the customer associated with the Conversation: Lookup step:

Or, you can select the <> icon and enter the attribute mapping manually. When referencing the customer ID from the previous step in this manner, you'll need to use the structure /#steps.id.customer, where id is replaced with the workflow ID step, which can be found by hovering over the blue workflow step number.

To reference the customer from the Conversation: Lookup step in this example, you would put /#steps.iYxqdtG83.customer in the Id(String) field.

Note: When referencing attributes in a workflow manually, the format should be /#steps.id.attributeName where id is replaced with the workflow ID. If referencing a custom attribute, the format is /#steps.id.custom.attributeName. You can find a list of all available attributes and their names on the Klass Settings page.

Common Regex patterns

Regex is a powerful tool to capture specific data within workflows. This article contains some common Regex patterns you can use to capture data. To find new patterns, you can visit their library!

Extract the Email Address from a string

Regex: \S+@\S+\.\S+\b

Concatenate Two Strings

Example Input: {{steps.1.attributes.data.contract.contractNumber}} , {{{steps.6_JOnalVC.custom.contractNumbersStr}}}

Regex: .*

Capture Phone Number

Regex: \+?\d{1,4}?[-.\s]?\(?\d{1,3}?\)?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}

Capture Credit Card Number

Regex: ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\d{3})\d{11})$