Using Workflow Timers

Quick links in this article:

What are timers used for?

In Gnatta, timers can be used to schedule flows, so that you can trigger a specific set of actions at a later point in time. Specific examples include:

  • Automatic nudges and prompts in-chat, to make sure a chat is active or signpost before closing

  • Automatic chases to third parties - such as sending an email to a courier for an update if nothing is received within X days

  • Automatically reopening an interaction and assigning it to an agent if we’ve promised the customer we’ll be doing a follow-up in X hours or days

Timers are creating using the Start Timer action in the flow builder. If you’ve never used one before, we’d recommend you start with a template, or by following the use case outlined below!

Key points about timers

Timers schedule other flows

Timers must be pointed at a flow - this is how you tell Gnatta what to do when the timer elapses. When the duration of the timer elapses, the flow it is linked to will be triggered (unless the timer is interrupted by a new event and an End Timer action!).

Therefore, it’s usually recommended to set up the flow you’re trying to schedule first, so that you can select it in your timer flow.

Timers are a method of scheduling things elsewhere, rather than causing a delay in the current flow. To create a pause in your flow, you might consider using a custom JavaScript action: Actions | JavaScript

Storing and stopping your timer

We recommend storing your timer on the interaction in a custom data field (by using Update Interaction after Create Timer - see example below!), so that you can stop it as necessary. You might want to stop a timer for a variety of reasons. Typical examples include:

  1. The customer has responded, so you no longer want to send an in-chat prompt saying ‘Are you still there?’

  2. The tracking status has changed to ‘Delivered’, so you don’t want to chase the courier for an update.

  3. The customer has gotten in touch before your follow-up timer elapsed, so you no longer need it.

If you don’t store your timer, it’ll still exist and the flow it is connected to will still be triggered - you just won’t be able to stop it!

Use case: automating in-chat prompts

In this example, we’re going to use a timer to prompt customers for a response if we don’t receive a message within 60 seconds after the agent sends their message. With multiple chat prompt timers working together, a conversation might look like this:

Customer Hi, please can you check my order

Agent Of course! Please can I take your order number?

[First Prompt Timer Starts]

Automated Are you still there?

[Second Prompt Timer Starts]

Automated As I haven't heard from you, this chat will be closed in 60 seconds. If you still need help, please send a message.

[Close Chat Timer Starts]

Automated This chat is now being closed. Please start a new chat if you still need assistance.

[Chat Closed]

When the customer responds, you could use a Response Received event with a Stop Timers flow to end any current timers and stop the prompts from sending or the chat from closing.

Using timers like this means you can keep your agent radars filled up with actively progressing chats, and they won’t need to do any manual prompting or signposting before closing a chat the customer has abandoned.

To set this kind of scenario up, we’re going to take the following steps:

  1. Create an autoresponse flow ready to be triggered when the timer elapses

  2. Create a field in which to store the timer, so it can be stopped

  3. Create the timer and map it to the flow in a Start Timer action

  4. Use Update Interaction to store it against the interaction

  5. Create a Stop Timer flow to interrupt your prompt if a new response is received.

Create an autoresponse flow

First, you’ll need to create your automated message in a separate flow, so that you can point your timer at it later. Go to the builder, start a new flow, and add a new Send Autoresponse action containing your prompt. Be sure to give your flow a useful name like ‘Auto-Prompt - [your message summary]’.

image-20240701-115407.png
Set up your automated message in a separate flow

Save and publish your automated message flow.

Create a field to store your timer

Create a field to store your timer by going to Settings > Advanced > Dynamic Data and adding a new field with the type set to Timer (which tells Gnatta the value will be a timestamp).

create a timer field.gif
Creating a new timer field in the ‘Advanced’ section of your domain configuration

Set your timer

We’re going to go back to the builder now, and using Select Template, pick ‘Simple Timer’.

In the Start Timer action, we’re going to point it to the autoresponse flow we created earlier, and set the duration to 60 seconds (or any duration you prefer). Note that we’re also setting the Output Name to StillThereTimer so we can reference it in the next action.

Submit your changes on the Start Timer action, and click into the Update Interaction action. Here, we’re going to store the output (StillThereTimer) in the custom data field we created. This will store the remaining duration of the timer in that field, so we can check and stop it later.

  1. Go to ‘Preset data’ on the Update Interaction action

  2. Find and select the timer field you created earlier

  3. Open the ‘Explore’ menu

  4. Under ‘Suggested’, select the output name you defined earlier (StillThereTimer).

  5. Click submit.

Gnatta will now store the remaining duration of the timer in that field, ready for you to reference it later if you need to.

You can now save and publish your flow. Your timer is set! For this use case, we’d recommend attaching this flow to a Message Sent event connected to the Chat queue that you’d like to use the prompts on.

Listen for customer responses

Next, you’ll want to set up a Stop Timer flow on a Response Received event, mapped to the same Chat queue. This means when the customer sends a message, you can stop the prompt timer so the ‘Are you still there?’ message isn’t sent.

First, navigate back to the builder and create a new flow with an End Timer action. Because this flow will be attached to a different event than the timer (which should be on a Message Sent event) you won’t be able to use the Output Name of StillThereTimer that you defined above - you’ll need to tell Gnatta to check your timer field instead.

Set up your End Timer action like this:

  1. Click into the End Timer action

  2. Click ‘Explore’ to open the contextual data explorer

  3. Search for Interaction Data (Interaction.Data) and select it. This will show you a list of your custom data fields

  4. Select your timer field from this list

  5. This will insert something like Interaction.Data[dc6ff0c2-1c1d-471b-bd04-483c5e81db45] into your action. This is a unique GUID for your custom field!

  6. Click Submit

  7. Save and Publish your flow

  8. Attach your flow to the relevant Response Received event

This flow will now listen for customer replies, and when it receives one, it’ll check for an active timer and stop it before the automated response is sent. As soon as the agent sends a new message, the original prompt timer will be restarted, and the loop will continue!