Manage templates
Templates provide a way to reuse objects. Almost every object within IA Cloud Enterprise, including Manual Tasks and Business Processes, is based on templates.
To start managing templates, go to Advanced > Templates. On the page, you can apply the following actions:
- Create and edit
- Copy
- Export or import
- Delete
- Filter templates by type
Create and edit template
While editing or creating a template, you can access the following tabs:
Content
In the Template Content box, you can add plain text, XML, HTML, CSS, JavaScript, and FreeMarker directives and save the result. You can also modify the Template Type.

History
The History tab displays all saved versions of a particular template along with the author names and modification dates.
To view the template code, find the Template Name column and click a link in it. The respective code is displayed under the grid.

To compare two different template versions, tick the appropriate checkboxes and click the Compare button. The selected two versions are displayed under the grid with all their differences highlighted.

Copy tasks with and without templates
When copying tasks, you have two options:
- Create a copy of the existing template.
- Create a link to the template to make it possible for the changes to propagate when either task copy is modified.
When you copy a template, changes to a new task do not affect the original one and its associated template, whereas changes made to a task with a linked template do.

tip
See the Copy Task and Copy Business Process topics for details.
Use template variables
For more information, refer to FreeMarker engine variables.
To use an object in code, put it inside the <#if ??> tag:
<#if worker??>
Worker Name: ${worker.firstName}
</#if>
You can also create a hidden answer and pass some info into it to view it on the Results > Data page. For example, this code snippet submits the worker ID in a separate column:
<#list questions as question>
<input type="hidden" name="${question.identifier!}_worker_id_skipCheck"/>
<script type="text/javascript">
$(document).ready(function() {
$("input[name=${question.identifier!}_worker_id_skipCheck]").val($('#workerId').val());
});
</script>
<#if run??>
<@input type="hidden" name="_sys_executorId" value="${workerId!}:${run.questionUUID}" question=question answer=false class="executorId"/>
<@input type="hidden" name="_sys_human_task_title" value="${run.question.title}" question=question answer=false class="humanTaskTitle"/>
</#if>
</#list>
You can use the following variables in all templates, except Machine and Base_Machine.
| Variable | Type | Description |
|---|---|---|
questions | List of object | A list of questions used typically in the following form: Variable usage example: <#list questions as question>Question text: Field #1: ${question.data.field1}Field #2: ${question.data.field2}<@answers question=question/> </#list> |
question | Object | class: com.freedomoss.appliance.model.QuestionDTO |
question.data | Map | Main data. Can be used in the following form: question.data.column_name. |
question.order | Number | Question order. |
question.answers | List of objects | Question answers. |
submissionUUID | String | Task submission UUID. |
workerId | String | Worker ID assigned on an endpoint. |
worker | Object | An object with the current worker info. Can be empty (null) when a worker is previewing the task and has not accepted it yet. Class: com.freedomoss.worker.model.Worker |
worker.id | Number | Worker ID in the WorkFusion database. |
worker.uuid | String | Worker UUID. |
worker.nativeWorkerId | String | Same as worker.id (see above). |
worker.firstName | String | First name. |
worker.lastName | String | Last name. |
worker.nickname | String | Nickname. |
worker.creationDate | Datetime | Worker's registration datetime. |
worker.country.name | String | Worker's country. Can be empty if the worker's country cannot be determined. |
worker.lastActivity | Datetime | Worker's last activity datetime. |
countryCode | String | Worker's country code (if detected). |
assignmentId | String | Assignment ID. |
mturkExternalSubmit | String | URL to submit the task form for unsecure submission via http. |
secureMturkExternalSubmit | String | URL to submit the task form for secure submission via https. |
hitTypeId | String | Hit type ID(as defined by an endpoint. |
Explore template types
Macro
Macro templates are libraries that contain custom tags used to build the Task and Base templates. They contain necessary imports, scripts, structure, and styling.
Macro templates can have the following extensions:
- FTL used in the task Code Editor
- CSS for Answer Type styling
- JS for coding the Answer behavior
important
Manual modification of MT via the Control Tower UI is strictly forbidden. If you need to make changes to a Macro template, create a feature request or a bug ticket and assign it to the WorkFusion dev team. Mind that WorkFusion tracks the history of template updates, so if needed, the template content can be restored.
Basic Macro templates
| Name | Description |
|---|---|
html.ftl | Converts data, scripts, and formatting to HTML. |
answers.ftl | Contains macros for all defined Answer Types. |
extras.ftl | Contains gold data macros. |
answer_information_extraction.ftl | Used to render the Information Extraction Answer Type. |
Base and Base_Machine
Digital Workers are based on the template type. These templates contain the code for the task design, including Instructions, Questions, and Answer choices (if any). They specify the format of the input file and are designed for the application by default.
When you create a task using a Base template, a copy of the template is created and linked to that task. Duplication of the Base template ensures that the original template remains consistent and is not altered unless required.
As tasks are created, a new copy of the Base template is associated with the new task. The following graphic illustrates this inherent design:

Task
Every time a new task is created or copied, a template for that task is created. This template contains the code for the task design, including Instructions, Questions, and Answer choices (if any).
It also handles the passing of information, such as the input data for the task and the Answer data from workers.
The FreeMarker code of a task is available in the Task Code Editor.
Task templates have "include" links to FTL files (extras, html, answers)—Macro templates.
Machine
It is Bot Config XML code written using the WebHarvest language.
Availability
Availability templates allow you to define an alternative UI for the task when the task is not available for execution.
An example scenario for implementing this template would be when time constraints exist within the timing of a task. If a task is set up to engage business, you might require the task to only run during normal business hours. This template controls the task timing.