Taskrouter templates explained

Christina Dechent
Christina Dechent
  • Updated

babelforce uses the Taskrouter (TR) to route not only calls, but also other tasks to third party systems or babelforce agents. 

Imagine for example the following use case:

  1. a ticket is opened in your help center / CRM
  2. the content of that ticket is sent off to a natural language understanding tool (like Dialogflow, Deepsearch, or Microsoft LUIS, etc.)
  3. the intent is then printed in your ticket
  4. the ticket is routed to a certain agent based on the intent 

This one and many other use cases can be built by the Taskrouter. We can build these use cases using low code. However, in order to make this even easier to use out-of-the-box, we offer so called Taskrouter templates. Each of these templates stores one of the use cases like described above, so you don't have to script it on your side. 

The following section explains how to use these predefined templates: 

1. To use the taskrouter templates, you first need to integrate with "babelforce-tasks". Therefore, go to the section Integrated processes > Integrations, then click on "Add" and search for "tasks". Then simply add and save this integration. 

2. Next, go to Integrated processes > Global automations and add a new automation. From the "Actions" dropdown menu, choose the action "Create task via template": 


3. To check which templates are available on your environment, you can query the following endpoint: 

GET https://{{env}}.babelforce.com/api/v3/tasks/scripts/babelforce.template

The respective curl is this one: 

curl -X 'GET' \
'https://{{env}}.babelforce.com/api/v3/tasks/scripts/babelforce.template' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer {my_bearer_token}'

4. Each of these template has some predefined required fields that need to be field in order to carry out the task. These required fields and the respective template id are the only information you need, to construct your template task. To find out which fields are required for the template you want to use, you can use this request: 

curl -X 'GET' \
'https://{{env}}.babelforce.com/api/v3/tasks/scripts/babelforce.template/{{my_template_id}}?response=payload' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer {my_bearer_token}'

 5. Example:

To construct a task for the template with the id


the following fields are required: 

"required_fields": [
"body.text"  ],

6. Just enter these into the field "request body" of the babelforce action. It should look similar to this: 

    "body.callId": "{call.id}",
    "body.api_key": "{{my_api_key}}",
    "body.text": "{app.speechToText.call_reason}"
To have a closer look at how to build a use case based on these templates, have a look at this article

Was this article helpful?




Please sign in to leave a comment.