Skip to main content

Advanced Workflow reference

Supported CRMs

Bullhorn, Microsoft Dynamics, Oracle NetSuite, Salesforce, ServiceNow, SugarCRM, Tier1 CRM, Zendesk

NOTE: Certain Advanced Workflow features are specific to certain CRMs where indicated.

Supported PBX systems

All phone systems supported by Tenfold. Features may vary by system. For example, some phone systems support attached data while others do not.

Configure workflows in Advanced Workflow

Advanced Workflow lets you define events (triggers) and conditions that cause automated actions to occur in the end user work environment.

This reference is intended for more advanced users who are interested in viewing the capabilities of actions and triggers and using more complex workflow features.

Users who are just getting started with workflow can begin using the Launcher feature to create web page links in the UI. Refer to Configure workflows using Manage Workflows for a detailed explanation of using the more technical workflow feature to create JSON-based configurations.

The parts of a workflow

There are two main parts to any workflow: An action, which tells the app what to do, and a trigger which tells the app when to do it.

In the following example, the trigger (shown in blue) is activated when there is a call (type is onCall) when there is no matching phone number in the CRM.

TriggerPortionWorkflow.png

The action, which is the event the trigger causes the happen, is shown in red. In this case, a URL opens in the user's browser:

ActionPortionWorkflow.png

The rest of this reference explores the capabilities and options of triggers and actions.

Workflow triggers

The top level of the workflow includes the information about the trigger. A trigger is a set of conditions that must happen (such as clicking a link or receiving a call) before the action portion of the workflow can occur.

Tenfold includes the following workflow triggers:

  • webLink

    Adds links with custom labels to the UI. This trigger is the same as the one used to create workflows for Launcher; however, it is possible to go beyond the basic abilities configured in Launcher by using webLink in custom workflows.

  • onCall

    Performs an activity as defined by the action section when a call is received.

  • onFindAgain

    Opens a URL when the user clicks "Find record" above the Search box in the Tenfold UI. Can be combined with parameters in the same way that the webLink trigger can.

    AdvancedWorkflowFindRecord.png
  • onRelatedResource

    Detects when a resource related to Call has changed; runs when Call has no related resource, when a resource has been related with call, or if a related resource is replaced by another resource.

  • resolveMultiMatch

    Performs the defined action when a multi-match call is resolved to a single match.

  • resolveNoMatch

    Performs the defined action when a no-match call is resolved to a single match.

  • onClickCreateRecord

    Performs the defined action when a user creates a new record in the UI.

  • onNoteSave

    Performs the defined action when a user saves note for an interaction.

Required trigger properties

All workflow triggers must include the followign properties:

Table 1. Required trigger properties for all workflows

Name

Supported values

Description

_teams

specific teams configured for the CRM

Teams assigned to the workflow.

   "_teams":[
      
   ],

action

Defines the resulting behavior when the trigger condition is met.

For more information, see Actions.

"action": {
    "type": "<type>",
    ...
 }

id

generated string

Unique identifier of the workflow generated by Tenfold.

IMPORTANT: Do not change this value.

label

user-created string

User-friendly name identifying the workflow.

"label" : "Example Workflow Label",

roles

admin

user

other roles configured for the CRM

User roles that can access the workflow.

   "roles":[
      "user",
      "admin",
      ...
   ]

type

The kind of trigger used in the workflow.

For more information, see Workflow triggers



Workflow actions

The workflow proceeds to the action portion when the conditions for the trigger are met. The action section of the workflow is inside the action {...} of the workflow code.

Tenfold includes the following actions:

  • openCustomUrl

    Opens a URL in a browser tab.

  • openMatchingRecord

    Opens a record in context in the CRM.

  • openParentAccount

    Opens the record for the account which is the parent of the record currently in context.

  • openCrmSearch

    Opens search in the CRM. Support is limited to Salesforce and MS Dynamics.

  • openCrmFlow

    Opens a Salesforce Lightning Flow.

  • openCrmUrl

    Opens a relative URL (only in Salesforce Lightning); uses the Salesforce API to open a specified view.

  • openRelatedResource

    Opens the target resource of the onRelatedResource trigger in the CRM.

  • postCustomMessage

    Integrates Tenfold with a Dynamics custom search page via windows.postMessage().

  • runApex

    Runs a Salesforce OpenCTI method.

  • sendRequest

    Sends an http request. This action can support use cases where it is necessary to make a request to some service on a localhost:port.

Actions define what happens when the conditions for the trigger are met. In the action section of each workflow, there is a type variable which holds the action type. The workflow types and the actions supported by each are listed below.

Table 2. Workflow triggers and the actions they support

Actions

Supported by these triggers

webLink

onCall

onFindAgain

onRelatedResource

resolveMultiMatch

resolveNoMatch

onClickCreateRecord

onNoteSave

openCustomUrl

openMatchingRecord

openParentAccount

openCrmSearch

openCrmFlow

openCrmUrl

openRelatedResource

postCustomMessage

runApex

sendRequest



Properties applicable to all actions

Properties can modify how an action executes or supply required information. Some properties are specific to certain actions. All actions support the following:

Name

Supported Values

Description

waitForCallAttribute

path

The action will wait for the identified call attribute to resolve before executing.

Some IVR integrations provide attached data asynchronously from call events; waitForCallAttribute lets you programmatically execute the action on upon Tenfold receiving the attached data.

"waitForCallAttribute": {
   "path": "attachedData.someField"
}
...

Worfklow actions and properties

openCrmFlow

Opens a Salesforce Lightning Flow.

This action supports the following:

Name

Supported Values

Description

name

string

Flow API name

"name":"<Flow_API_name>"

args

name = Flow variable name

type = the data type of the variable

value = the name of the variable which passes a value to the workflow

Name of a Lightning Flow variable that is configured as "Available for input" in the variables settings.

"args":[
   {
       "name":"<flow_variable_name>",
       "type":"<variable_data_type>",
       "value":"<variable_name>"
   }
],
...

Supports the args property which holds input information for the Lightning Flow.

Example 1. openCrmFlow
{
"id" : "<workflow_id>",
   "type":"onCall",
   "label":"Open Lightning Flow",   
   "roles":[
      "admin",
      "user"
   ],
   "_teams":[
      
   ],
   "callDirection":"Inbound",
   "callType":"External",
   "action":{
      "type":"openCrmFlow",
      "name":"Tenfold_Call_Initiation",
      "args":[
         {
            "name":"input_UUID",
            "type":"String",
            "value":"{callAttachedData.UUI}"
         },
         {
            "name":"input_CCID",
            "type":"String",
            "value":"{callAttachedData.UCID}"
         }
      ]
   },
   "note":"CCC Open Lightning Flow ",
   "display":"global"
}

NOTE: Opening a Lightning Flow requires additional configuration on the CRM side.



openCrmSearch

The action openCrmSearch searches the CRM for information. Applicable to Salesforce and MS Dynamics.

This action supports the following:

Name

Supported Values

Description

searchTemplate

Tenfold variables.

Variables which can be passed to the CRM to use as search parameters.

"searchTemplate": "{<variable_name>}"
...

Supports name and value parameters which can be used with the URL to construct a search query.

Example 2. openCrmSearch
{
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user"
   ],
   "type":"onCall",
   "action":{
      "type":"openCrmSearch",
      "searchTemplate":"{callPhoneNumber}"
   },
   "match":"noMatch"
}


openCrmUrl

Opens a relative URL (only in Salesforce Lightning); uses the Salesforce API to open a specified view based on passed parameters.

This action supports the following:

Name

Supported Values

Description

urlTemplate

A URL relative path.

A URL inside Salesforce which receives the parameters sent from the workflow.

"urlTemplate":"<path_to_CRM_URL>",
"parameters":[
    {
      "name": "<URL_parameter_name>",
      "value": "<URL_parameter_value>"
    }
 ],
...

Supports name and value parameters which can be used with the URL to construct a query.

Example 3. openCrmUrl
{
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user"
   ],
   "action":"openCrmUrl",
   "urlTemplate:":"/internal-salesforce-relative-url/{callPhoneNumber}/{recordType}",
   "parameters":[
      {
         "name":"id",
         "value":"{callId}"
      },
      {
         "name":"module",
         "value":"{recordType}"
      }
   ]
}


openCustomUrl

The action openCustomUrl opens a new URL in a new browser tab. Included parameters are converted into a query string.

This action supports the following:

Name

Supported Values

Description

urlTemplate

name and value parameters

The URL you want to open. May contain variables from the Tenfold platform.

"urlTemplate" : "https://www.google.com/search",
"parameters" : [                      
    {                          
        "name" : "q",
        "value" : "{recordName}"
    }
...

waitForAttachedData

DEPRECATED

true | false

Adds a delay to workflows which use called attached data; the data sometimes needs a little time to finish writing to the CRM, and this setting prevents the workflow from timing out.

NOTE: This property is deprecated. It is mentioned here for historical reasons only. Use waitForCallAttribute instead.

Supports name and value parameters which can be used with the URL to construct a query.

Example 4. openCustomUrl
{
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user"
   ],
   "type":"webLink",
   "display":"contact",
   "label" : "Look up name",
   "action":{
      "type":"openCustomUrl",
      "urlTemplate":"https://www.google.com/search",
      "parameters":[
         {
            "name":"q",
            "value":"{recordName}"
         }
      ]
   }
}


openMatchingRecord

The action openMatchingRecord opens a record which is in context in the CRM.

This action does not support any properties or variables.

Example 5. openMatchingRecord
{
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user"
   ],
   "type":"resolveMultiMatch",
   "action":{
      "type":"openMatchingRecord"
   }
}


openParentAccount

The action openParentAccount opens the parent account of a record in context in the CRM.

This action does not support any properties or variables.

Example 6. openParentAccount
{
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user"
   ],
   "type":"openParentAccount"
}


openRelatedResource

Opens the target resource of the onRelatedResource trigger in the CRM.

Name

Supported Values

Description

Example 7. openRelatedResource
{
    "type" : "onCall",
    "match" : "singleMatch",
    "action" : {
        "type" : "openRelatedResource"
    },
    "callDirection" : "Inbound"
}


postCustomMessage

When the trigger conditions are met in Tenfold, Tenfold emits this custom search event which contains some information as a payload (example: caller phone number). The MS Dynamics CRM then catches the event and executes the logic contained in a custom script, which then performs some task. For example, it could redirect the user to a custom search page displaying search results with the payload in the search query.

NOTE: This action applies only to the embedded version of Tenfold for Microsoft Dynamics.

This action supports the following:

Name

Supported Values

Description

message

Name of the Tenfold event.

data

A key : value ( <name> : <variable>) pair where the value of a Tenfold variable is saved as the value of a named variable.

Variable information to submit to the search page.

Example 8. postCustomMessage

In the following workflow, the action is triggered when an inbound call event occurs. This causes Tenfold to send the event tenfold:render-custom-search-page to MS Dynamics, along with a payload containing the phone number of the call. When Dynamics receives the event, it uses the payload data to search for the call phone number.

{
  "type":"onCall",
   "callDirection":"Inbound",
   "action":{
      "type":"postCustomMessage",
      "message":"tenfold:render-custom-search-page",
      "data":{
         "phoneNumber":"{callPhoneNumber}"
      }
   },
   "id":"<workflow_id>",
   "_teams":[
      
   ],
   "roles":[
      "user",
      "admin"
   ]
}

NOTE: Additional configuration on the MS Dynamics side is required for postCustomMessage. For specific details, contact Tenfold support.



runApex

Executes an Apex method from an Apex class that’s exposed in Salesforce.

Name

Supported Values

Description

className

string

Apex class of the method to execute.

methodName

string

Method to execute.

params

Method parameters to pass. The string must include field value pairs and be formatted as a valid query string.

Example 9. runApex

{
    "type" : "onCall",
    "onSingleMatch" : true,
    "action" : [ 
        {
            "type" : "runApex",
            "className" : "ExampleClass",
            "methodName" : "ExampleMethod", 
            "waitForAttachedData" : true,
            "params" : {
                "inputData" : {
                    "category" : "{callAttachedData.category}", 
                    "intent" : "{callAttachedData.intent}",
                    "description" : "{callDescription}"
                }
            }
        }, 
        {
            "type" : "relateResource",
            "param" : "{returnValue.runApex.caseId}"
        }
    ],
    "callDirection" : "Inbound",
},


sendRequest

Sends a REST request to Salesforce to a service on a local port.

Name

Supported Values

Description

requestType

GET | POST

urlTemplate

string

requestBody

The body of the REST request.

Example 10. sendRequest



Variables

Parameters can obtain information about objects the CRM knows about such as a call, a record, or the current user and can be used as conditions for triggering a workflow. Weblinks use a separate set of parameters from other types of workflows. Tables listing the supported parameters for each are included below.

Supported JSON configurator workflow parameters

Parameters from the CRM environment can be passed between the workflow and the CRM framework.

These variables can be used in URLs, parameters and in searchTemplate.

Other workflow properties

These properties are used with different triggers to define other aspects of the workflow or to define triggers. Some of these properties are required with certain types of triggers.

Table 5. Other workflow properties

Name

Supported values

Description

Applicable to:

delay

number

The length of time to wait before running the action (in milliseconds).

onCall

disableDefaultBehavior

true | false

Disables the default behavior of onClickCreateRecord so that a new browser tab opens instead of a new create record form.

onClickCreateRecord

display

contact

contactCard

global

historyElement

Enables rendering web links within the Tenfold UI for:

  • on contact cards (contact)

  • in global links (global)

  • in call history (historyElement)

  • on the call description card (contactCard)

Defaults to global if display is not specified.

webLink

icon

*.ico file or a link to a *.png file

An icon which displays next to a web link in the UI.

webLink

match

multiMatch

noMatch

singleMatch

The match scenario that triggers the workflow.

onCall

webLink

onSingleMatch

true | false

Evaluates to true when there is only one match for a call from the beginning.

onCall



Conditions

Conditions make complex workflows possible which include numerous dependencies. Conditions follow the order of mathematical operations, beginning with the most deeply nested statements and proceeding outward. When all conditions have been evaluated and condition evaluates to true, then the action proceeds. If condition evaluates to false, then the workflow does not run.

Conditions are supported by all triggers except for webLink.

Table 6. Workflow property conditions

Name

Description

Values

child

A JSON object made up of a key, an operator, and a value. It evaluates to either true or false and can be compared to other child objects using Boolean operators.

<key> , <operator> , <value>

Example format of a child object:

"child2" : {
   "key" : "{callAttachedData.city}",
   "operator" : "non-equal",
   "value" : "detroit"
}

NOTE: While it is not required to use "child" to name these objects, it is a best practice for clarity and supportability.

condition

A JSON object which compares included child objects to produce a Boolean value.

If condition evaluates to true, then the worfklow proceeds. If it evaluates to false, then the workflow stops.

child

logicalOp

key

A property in the format of <object>.<property> which represents a value.

A property in the format <object>.<property> which is compared with the value assigned to value.

operator

A mathematical operator; used to compare key and value.

gt = greater than

gte = greater than or equal to

equal = equal to

non-equal = not equal to

lt = less than

lte = Iess than or equal to

isNil = is null or undefined

value

A value assigned to a key.

A value which is compared to key using a mathematical operator to produce a Boolean value.

logicalOp

A logical operator.

AND

OR



Example 11. Logical and mathematical operators in a workflow

An example of a condition.

{
   "id":"<workflow_id>",
   "roles":[
      "admin",
      "user"
   ],
   "_teams":[
      "60d201b4aab4dc7af8667f5c"
   ],
   "type":"onCall",
   "callDirection":"Inbound",
   "action":{
      "type":"openCustomUrl",
      "urlTemplate":"https://foo.com/{callAttachedData.TransferReason}?xx={callAttachedData.someIvrData}",
      "waitForAttachedData":true,
      "condition":{
         "child1":{
            "child1":{
               "key":"{callAttachedData.TransferReason}",
               "operator":"equal",
               "value":"InternetPickup"
            },
            "logicalOp":"AND",
            "child2":{
               "key":"{callAttachedData.city}",
               "operator":"non-equal",
               "value":"lodz"
            }
         },
         "logicalOp":"AND",
         "child2":{
            "child1":{
               "key":"{callAttachedData.testData}",
               "operator":"gt",
               "value":5
            },
            "logicalOp":"OR",
            "child2":{
               "key":"{callAttachedData.someIvrData}",
               "operator":"gte",
               "value":10
            }
         }
      }
   }
}