Skip to main content

Email Workflow

This article provides an overview of the available node types, generic properties of email workflows, and introduces the new designer toolbar, among other topics.

Email workflows can be found by navigating to Email > Workflows using the Graia CCaaS Portal.

tip

New to email workflows? Follow Build your first email workflow, a 20-minute step-by-step tutorial.

Workflow generic properties​

Workflow Name​

The workflow name is a required parameter, as it serves as a selection identifier for a specific channel. See the naming best practices.

Idle timeout​

Idle timeout, by default, is set to 1440 minutes (24 hours). If there is no activity for the specified time, the system will automatically close down the conversation.

For example, if the workflow idle timeout is set to 10 minutes and the agent or the customer does not send any messages, the system will automatically close the conversation after the 10 minutes have passed.

The maximum value for the idle timeout parameter is 30240 (21 days). The minimum value is 10 minutes.

When creating a workflow, mind the idle timeout!

Workflow variables​

Define the variables a workflow uses, for example an API key that a JavaScript node sends to your system, on the Variables tab of the Edit workflow details dialog. To open it, click Details in the designer.

  1. Click Add variable.
  2. Enter the Name and the Value.
  3. Select Sensitive if the value must stay secret.
  4. Click OK, then save the workflow.

To remove a variable, click the delete icon under Actions.

Sensitive variables work like this:

  • The value is hidden while you type it. Until you save the workflow, the eye icon shows it.
  • Once the workflow is saved, the value can't be read back in the portal: the Value field only shows asterisks. The value isn't stored in readable form, logged or shown in reports.
  • A sensitive variable is only passed to the JavaScript and Custom integration nodes that list it under Exposed sensitive workflow variables.
  • To turn Sensitive off for a saved variable, you have to enter a new value. Click the undo icon to keep the saved value and the variable sensitive.
  • When you clone the workflow, its variables are cloned too, but sensitive variables lose their values. Enter them again in the clone.

Workflow designer​

After you've provided the generic properties for a workflow and clicked "Create," you enter the workflow designer. This is where you build and customize your workflow to meet your specific needs.

Node types​

Jump to a node:

Start and end

NodeWhat it does
Start Here nodeThe starting point of every workflow.
End conversationEnds the workflow.

Reply and wait

NodeWhat it does
Send replySends an automatic reply using an email template.
ForwardForwards the email to another address.
Wait for customer replyPauses the workflow for a set time, for example to send reminders.

Route the email

NodeWhat it does
Check opening hoursRoutes based on the channel's opening hours.
Check queue stateChecks a queue before sending the email to it.
QueuePuts the email in a queue for agents.
Evaluate Customer IntentRoutes based on the email's subject line, content or both.
SwitchRoutes based on conditions on conversation, customer or other data.
SamplingSends a set percentage of emails down a different path.

AI and language

NodeWhat it does
Conversational botLets an AI bot handle the email.
CategorizerApplies a category from a categorization rule, after a Conversational bot.
Detect customer languageDetects the language of the customer's last email.
Set customer languageSets the customer's language for translation and other language services.

Data and integrations

NodeWhat it does
Extract dataPulls values out of the subject or body using regular expressions.
Set dataStores workflow data for use later in the workflow.
JavaScriptRuns your own JavaScript code.
Custom integrationHands the conversation over to a third-party system.

Start Here node​

The "Start Here" node is the default starting point in your workflow. It serves as the initial step from which your workflow begins. To use this node, click on the black dot and drag it in any direction to open a context menu. From this menu, you can choose other available nodes to build and customize your workflow.

Categorizer​

Use this node after a Conversational Bot, to apply one of the categories in the linked categorization rule. Alternatively, apply categories manually.

  • Categorization rule: select a categorization rule created in your tenant. Graia CCaaS will attempt to match one of its categories to the initial message.

  • Manual categorization: set this toggle to be able to select a Main and a Secondary category from the selected categorization rule in case your flow needs specific categories applied.

    Note that for manual categorization, you can only have a single categorization node on any given flow branch.

Outputs:

  • Success: One of the category-subcategory pairs was associated to the conversation.
  • Uncategorized: For automatic categorization, in case the system failed to match any category in the linked categorization rule.

The node also creates the following workflow properties, that can then be used for example in the Switch node for routing decisions:

  • MainCategory: contains the main category value as the node selected.
  • SubCategory: contains the sub-category value the node selected.

Check opening hours​

This node is responsible for verifying your Channel's opening hours and enables you to make routing decisions based on the verification results. The available outputs are as follows:

Feel free to customize the name of the "Check opening hours" node to suit your needs.

Check queue state​

The Check Queue State node allows administrators to pre-check a queue and perform routing decisions as it has similar outputs as the queue. The benefit is that the customer does not have to navigate through the entire complex flow, but instead can be routed elsewhere based on the result of the check.

Conversational bot​

Use this node to engage your customer with a subject matter expert AI-based conversational bot.

Carefully type the Instructions for the bot. Instructions help it understand its role, responsibilities and tone.

note

Please carefully read and follow the bot instruction guidelines. This is critical for proper bot operation.

Optionally use one or more preconfigured external custom service integration APIs that can offer additional insight, deliver precise information, or execute external tasks. Select them from the Integrations dropdown. You can select any number of preconfigured integrations, the bot will consider all.

Associate an available Knowledge base to the bot. This can dramatically enhance the relevance and contextual quality of its responses.

Results in AI technology are not absolute, every outcome has a confidence level associated internally. Because it is inconvenient and time consuming to sort out misunderstandings in an email exchange, you can designate at what Knowledge base confidence threshold (optional) – shown once a knowledge base is selected – you consider the outcome of the KB result to be low enough for the node to be considered failing. You can then remedy this in other parts of the flow by sending the conversation to human queue, or to another, maybe more relevant bot, etc.

Select an appropriately created Email template for the bot to use in its response back to the customer. The template can contain any data replacement fields (e.g. to add customer details) but must contain the #BotResponse field so the bot response is inserted to the response email.

Use the Enable draft mode toggle to avoid sending the response from the bot back to the customer directly. Instead, connect the relevant Email Draft Created output to an agent queue for human revision and dispatching (see what the agent sees). Use this feature to assess the quality of your overall bot setup, the instruction prompts, your linked KBs and any integrations. When satisfied with the quality and reliability of the bot responses, change this to the normal operational mode (disable the toggle) for the bot response messages to be sent directly to your customers.

Draft mode is a human review of the bot's replies, not a replacement for Agent Assist. Drafts are built from the selected email template only, so add any branding, such as your signature, to that template.

The node will use the language in the email template matching the customer email (in case a Detect Customer Language node was used earlier) or the one marked as fallback.

Advanced configuration:

  • Enforce Knowledge Base search: shown once a knowledge base is selected. Turn it on to make the bot search the knowledge base before it answers, instead of deciding for itself whether to.

  • Temperature: use this to control consistency and predictability of the texts the bot generates. A value of zero provides maximum consistency, while a value of 1+ provides maximum creativity and randomness. On a general level, keep it lower and test any increase extensively.

  • Max output token count: a circuit breaker to control the maximum amount of text generated by the bot. Setting it too low will abruptly cut the result text. Test any change extensively.

  • Customer history control: A slider to determine how many past messages will be used by the bot as a context window. Set this to a lower value to ensure the bot remains focused on the current questions and discards context from X messages ago, or set this to a higher value to increase the context window and ensure the bot remembers X messages. Please note that a higher context window may increase your consumption cost.

  • History mode: Conversation uses only the current email conversation as history, Thread the entire email thread.

  • Attachment handling: controls if, and how the bot considers attachments added to the conversation.

    • None: the bot won't process any attachments in the conversation in its operation.

    • Bot: the bot will attempt to process any supported image file attached to the conversation. Note, that it does not process other file types and it processes the attachment of the last customer message only.

    • External system: an external system will process the attachment, sending its result back to the bot. This external system must conform with our attachment external handling API workload, authentication, error handling, etc. This requires additional settings to specify:

      • Attachment processing URL: the URL to send the attachment to for processing.

      • Attachment processing API Key: the API Key the bot will authenticate itself with at the external system (see our Developers Guide link above for details).

  • Fresh start: Allows the bot to start as if there are no messages in the history before reaching this node. This is useful in multi-bot scenarios with different controls in terms of the history. Outputs:

  • Email sent (when draft mode is off): the bot considered its response to the customer message and the result of the optional knowledge base lookup to be high enough in confidence that it actually responded.

  • Email Draft Created (replaces Email sent when draft mode is on): instead of sending the bot's response back to the customer directly, use this to route the conversation into a queue node for human agent revision.

  • Low confidence: The confidence level of the selected knowledge base query result was lower than the set threshold.

  • Failed: The bot could not comprehend or answer the customer request, or lower level technical problems were encountered with the AI model.

  • Optionally define additional outputs by supplying further AI instruction prompts for various business topics this node is not the expert of.

Custom integration​

This node is an exit point from the workflow to a 3rd party solution supporting a custom integration. It requires a URL and an API Key.

Under Exposed sensitive workflow variables, type the name (case sensitive) of each sensitive variable the integration needs, then press Enter or click Add. Sensitive workflow variables that aren’t listed here are not passed to your integration. Sensitive variables the integration returns or updates stay sensitive.

Evaluate Customer Intent​

Use this node to make routing decisions in emails based on their subject line, content, or both. Graia CCaaS scans the subject and content of the email and considers it a match if it contains the specified keyword.

Key points for using this node:

  • Keywords in Groups: Keywords are organized into groups, and these groups represent the outputs of the node. You can specify multiple keywords within a single group, but you're limited to up to 10 groups and 50 keywords.

  • CSV Template: You have the option to download a pre-formatted CSV template where you can enter your keywords and assign them to specific groups.

  • Exact Match Requirement: When scanning the content or subject of the email, the keyword or phrase must be an exact match. For example, if your keyword is "windows 11 upgrade," it will not match "upgrade to windows 11."

  • Multiple Matches: If multiple groups are matched within the content, Graia CCaaS will use the first match as the output. To fine-tune your workflows, you can create multiple evaluator nodes.

  • Subject and Content Matching: When both subject and content options are used together with a single CSV, the subject is evaluated first.

  • CSV Format Rules: The CSV format must not contain question marks, signs, brackets, or any other punctuation. Empty keyword groups or key phrases are not allowed. Repeating the same key phrase within a group or assigning the same key phrase to two different groups is also prohibited.

  • Validation: While the node allows you to upload CSV files, it won't allow you to save them if they are invalid. This ensures that any errors in the CSV can be visually corrected, and error messages are provided when an invalid CSV is uploaded.

By utilizing this node effectively, you can route emails based on specific keywords or phrases found in their subject or content.

warning

We recommend using Notepad++ to handle the CSV file if you plan on using special characters as Excel does not save the Unicode characters.

Detect customer language​

The Detect Customer Language node automatically detects the language of a customer based on the last received customer email message and stores the detected language in a workflow variable. The node detects the language based on the textual content of the email body. If the email contains words from multiple languages, the predominant language is selected.

The detected language can be used together with a Switch node to route workflows by language (e.g. Romanian, English, Hungarian).

Nodes supporting the multi-lingual email templates will use the detected language to generate a reply to the customer, if the template correctly supports the detected language, otherwise, the fallback template language is used.

This node has a single output called Then.

End conversation​

Use this node to wrap up and conclude your workflow. When an email conversation reaches this point, the conversation is closed.

Extract data​

The Extract Data node evaluates the subject, body, or both of an incoming email using configurable regular expression (regex) rules and stores extracted values into workflow variables.

This node enables workflows to automatically capture structured data (e.g. contract IDs, order numbers, references) from unstructured email content.

Matching & Storage Logic:

  • Single Match: If a rule matches once, the extracted value is stored in the specified workflow variable.
  • Multiple Rules: Multiple rules can match during a single execution. Each matched rule stores its result in its own corresponding workflow variable.
  • Multi-Match (Same Rule): If Allow multi-match is enabled and multiple matches are found for the same rule all extracted values are collected, duplicate values are filtered out, remaining unique values are joined using the configured separator, the final concatenated string is stored in the workflow variable.

Outputs:

  • Match: Triggered when at least one rule successfully extracts and stores a value.
  • No match: Triggered when no rules extract or store any value.

Forward​

Forwards the email to the Destination email address, with the channel's own mailbox as the sender. You may include a template that will be appended as the forward message. Attachments from the forwarded email or the template will be included. Variable placeholders will be replaced with their actual values, if available and it will match the language, if correctly defined in the workflow and template, otherwise, fallback language of the template will be used.

Output:

  • Then: Hook any followup nodes here to process the original inbound email further.

JavaScript​

The JavaScript node allows integrators to write JavaScript code directly into the portal using a capable editor. This allows integrators to use the node instead of creating a middleware or Azure Function for simpler operations. The node supports executing JavaScript, it can send HTTP requests, supports reading & writing workflow variables and basic conversation data.

The node properties:

  • A description for the node, use this to explain to other integrators what this node is for.
  • Success output, this is used when the code inside the node is successful and the conversation continues through this path.
  • Fail output, this is used when the code fails for any reason and the conversation goes through this path.
  • Copy Code button, this allows integrators to quickly copy the code inside the node to paste it elsewhere.
  • Edit code, this opens the code editor and allows for writing the code itself and testing it.
  • Exposed sensitive workflow variables: type the name (case sensitive) of each sensitive workflow variable the code needs, then press Enter or click Add. Sensitive variables that aren’t listed here are not passed to the node.

The node keeps sensitive variables sensitive: when the code updates one, for example workflowVariables.apiToken = newToken, the new value stays hidden. A JavaScript node can't create a new sensitive variable. Define it on the Variables tab first, with any placeholder value and Sensitive selected, add it to Exposed sensitive workflow variables, and then set its value in the code.

The code editor is based on the Monaco Editor, also powering VSCode. The system passes data to the node, meaning in the code, you can access the following data:

  • conversation.id - this is the unique ID of the conversation
  • conversation.customerId - this is the unique ID of the customer that is part of the conversation
  • conversation.customerIdentifier - this is the email address or phone number (depending on the media type) used to identify the customer.
  • workflowVariables.{yourVar} - workflow variables configured elsewhere in the workflow.

For testing purposes, you may provide environment data (conversation ID, customer ID, customer identifier) as well as key-value pairs workflow data to be able to test your code without having to initiate a conversation. Simply click Execute Code to test your code, the console will display any information coming from the code as well as the output variables that you can define in your code using the syntax such as workflowVariables.myVar = 'asdf'

Please note that the data provided as environment data as well as the test workflow variables are discarded when leaving the editor, regardless if the code or workflow was saved or not. Be mindful of the execution timeout set by the system.

The Workflow Vars test data doesn’t include the variables from the workflow’s Variables tab. To test code that uses them, click Add under Workflow Vars and type in each variable with a test value.

Send reply​

The Send Reply Node empowers workflow designers to utilize pre-configured email templates for sending automated replies to customers. For instance, if an email is received outside of business hours, an automated response can be dispatched to inform the customer about the operational hours and subsequently route the conversation to a queue.

The node utilizes the appropriate language variant from the linked template, or uses the one designated as fallback.

  • Template Requirement: To use the Send Reply Node, you must have an email template configured. You can refer to the Email Templates section for detailed information on setting up these templates.

  • Handling New Conversations: An auto-reply is dispatched for each new conversation. This means that if a customer's email is currently being handled by an agent, additional emails from the same customer with the same subject (follow-ups) will not initiate a new conversation. In this scenario, no auto-reply will be sent. However, if the agent concludes the conversation, subsequent email replies from the customer will trigger the Send Reply Node as the conversation re-enters the workflow.

By leveraging the Send Reply Node and email templates effectively, you can provide automated responses to customers based on specific criteria, enhancing your email handling processes.

Draft mode​

Turn on Draft mode to have the node prepare the reply instead of sending it. The reply is built from the selected Reply email template and waits for an agent, who sends it as it is, edits it first, or writes a different reply (see what the agent sees). Nothing is sent to the customer until the agent sends it.

Use it when a templated reply needs a human check before it goes out, for example while you test a new template, or for replies that agents usually complete with case-specific details.

Turning on Draft mode replaces the node's Then output with Email draft created. Connect it to a Queue with agents who can review the replies, otherwise the workflow can't be saved. Turning Draft mode off brings back the Then output.

Output:

  • Then (when draft mode is off): Hook up the next node, for example a Queue.
  • Email draft created (replaces Then when draft mode is on): route the conversation to a queue, so an agent can review and send the reply.

Queue​

Used to load the conversation into a queue of agents. The Queue node is the queue itself: you give the queue its name and set its routing mode in the node.

Routing mode​

When creating a queue, you must choose a routing mechanism: automatic or manual. This choice cannot be changed later for a given queue, but you can delete the queue and recreate it with a different routing mechanism.

  • Automatic Queue: The system uses intelligent routing to find the first available skilled agent.
  • Manual Queue: Skilled agents can manually pick items from the queue. Agents assigned to manual queues can view all items in their team's queue, including items in manual queues, in their agent performance dashboard.
  • Hybrid Queue: The system mixes automatic and manual, allowing the system to use intelligent routing to find the first available skilled agents, but also allowing skilled agents to manually pick items from the queue.

When a customer sends several separate emails to the same queue, agents see that the customer has other emails waiting. In manual and hybrid queues they can also pick all of them at once (see what the agent sees).

Queue parameters​

Outputs​

  • Agent Disconnected: Define next actions for when the agent closes the task, such as survey questions.
  • Size Limit Reached: Define actions for when the maximum queue size is reached.
  • No Agent Logged In: Define actions for when no agents are logged in across the tenant.
  • No Staffed Agent Logged In: Check if there are agents with proper attribute assignment as well as workitem thresholds logged in to handle conversations from this queue, if not, define next action.
  • No available staffed agent: Check if the staffed agents for this queue are also available, if not, define next action.
  • EWT Limit Reached: Define actions for when the estimated wait time limit set on the queue is reached.

Queue entry logic​

Before a conversation enters the queue, the following checks are performed to reveal whether it needs to be bypassed altogether. These checks are associated to specific outputs, and are executed in this order:

  1. No Agent Logged In: Check if any agents are logged in across the tenant. If yes, proceed to the next check; otherwise, use this output.
  2. No Staffed Agent Logged In: Check if the logged-in agents are skilled and have the appropriate work-item thresholds. If yes, proceed to the next check; if not, use this output.
  3. No Available Staffed Agent Logged in: Check if the staffed agents are also available, if yes, proceed to the next check, if not, use this output.
  4. Max Queue Size: Check if the conversation would exceed the specified limit. If yes, use this output; if not, proceed to the next check.
  5. Estimated Wait Time Limit: Check if the current wait time is higher than the specified limit, if yes, use the output flow; if not, then the conversation enters the queue.

Set data​

Set Data node allows you to set workflow data and re-use it later, for example in a Switch node. Useful for future integrations.

Set customer language​

This node specifies the customer language and the associated language providers for the various language services. For email, specifically, this is useful to enable the Email translation feature.

Select a Customer language profile from the list. The node displays the features the selected profile offers.

note

In case the Email translation feature is not enabled in the selected profile, but the flow actually routes the email conversation to an agent who does not know the customer's language, then there will be a language discrepancy and the conversation will likely fail.

Outputs:

  • Then: A generic output, use it to hook up the next node.

Feature support:

  • Email Translation: Will set the language, the translation engine and the email translation feature for the current path, enabling email translation between the agent and the customer if the languages set for the agent in their profile configuration do not match the language from the set customer language node.

Please note that if multiple set customer language nodes with the same or similar functionalities exist on a given workflow path, the last node encountered by the customer will be taken into consideration.

Switch​

The Switch node enables workflow designers to assess specific properties or fields of various categories of data (e.g. conversation or customer details, etc.), establish conditions for them and make routing decisions based on the result of these.

Upon creating the node, you first designate which categories of data it will offer properties from. This can be set only once and will not be changeable later on for the given node.

The available data sources to load properties from:

Data sourceDescription
Workflow dataData fields set through the Set Data node, via custom integrations, conversational bots.
Customer detailsCustomer record properties in case the customer of the conversation is identified by the time this node gets activated.
Customer languageIn case the flow handles conversations in different languages.
Calendar eventsEvents scheduled in the tenant calendar.

You can define up to 9 workflow conditions, and each condition will have its corresponding output. Additionally, there is a default output option provided.

This node can be effectively paired with the Set Data node, and you also have the option to utilize custom fields defined per tenant or business unit.

  • Outputs:

    • Each condition property has its own output, allowing you to determine the course of action based on these properties.
    • Default: Serves as a failsafe, specifying what should happen if no condition is met.

Sampling​

The Sampling node offers chance-based flow management. You set the sampling percentage and the node "throws the dice" at every conversation to activate its Sampled or Not Sampled outputs based on whether the current conversation hits the set probability or not. This can be used to engage branches of the workflow in a probabilistic manner, for example to offer customer surveys for a portion of the total number of conversations, etc.

Note that the probability is not measured and applied on a defined time scale, the node calculates it in a fully random fashion at every conversation. Therefore Graia CCaaS does not guarantee that the set ratio will be honoured in any particular time frame. It is expected to honour it in general, on large enough number of conversations.

Outputs:

  • Sampled - The conversation falls within the designated sampling rate.
  • Not Sampled - The conversation is not marked for sampling, it falls outside of the designated ratio.

Wait for customer reply​

This node pauses the email workflow for a set wait period, letting you act on expiration for example to send reminders. Incoming replies during the wait can trigger other nodes.

  • Wait timeout: specify the wait time in Days, Hours, Minutes and Seconds with a maximum of 20 days.

Outputs:

  • Reply received: hook up nodes to handle a reply before the timeout expires.
  • Timeout: use this to deal with the expiration of the specified wait time. E.g. send a reminder email message and add another wait node, etc.
note

If nothing should happen when the wait time expires, connect Timeout to End. If Timeout leads back to a queue, directly or through the start of the workflow, the customer's email arrives again as a new waiting task, even though an agent already answered it.

Using the workflow designer​

Workflow containers, the designer toolbar, saving, cloning workflows and nodes, multi-select, deep links to nodes and node search work the same way in voice, chat and email workflows. See Using the workflow designer.

Edit workflow generic properties​

For existing workflows, you may edit their generic properties by clicking a workflow in the list, then using the pen icon on the top left corner of the screen. A modal window, commonly known as a popup, will be shown. Modify your workflow's name or idle timeout, then click OK. Please note that the OK button is not a replacement for Save. You will need to save your workflow by using the dedicated icon located at the top left corner afterward.