Learn about Control Tower database tables
Control Tower uses the MS SQL database (wfdb, ct schema). From version to version, the database structure can vary, but the high-level architecture remains the same.
Business Process and Manual Task execution

See the description of the database tables below:
The
runtable represents the BP instance steps and draft BP instances. Let's consider the following example:Work.AI up to v10.2.9 Work.AI v10.3+ 

In the database, you would have the following table data (only selected columns are displayed):

In the table above, the first record represents a draft BP.
warningThe record might not exist if the BP is launched by Scheduler.
The rootRunUUID that you can get in the UI is stored in:
- uuid of the first BP step
- rootRunUUID in all records generated during the BP
The
AwsHittable represents one entity submitted for processing to the step.The
AwsHitAssignmenttable represents the fact that a human worker or a bot worked on anAwsHitentity.The
AwsHitAssignmentAnswertable stores the results of the step execution:- For a Bot Task that would have a record for each exported parameter in the
<export>section. - For an MT that would have a record for each input parameter plus a record for each field in MT.
- For a Bot Task that would have a record for each exported parameter in the
The
AwsHitQuestiontable.The
HitSubmissionDataItemtable stores the input data for the step execution (one record per hit).
Business Process structure

- The
campaigntable represents one step in a workflow. So when you have multiple BP executions, theruntable contains multiple records, and all these records reference the samecampaign. - The
campaignmaptable is basically a link between therunandcampaigntables.
Example:
select r.id as run_id, r.campaign_id as run_campaign_id, r.campaignMap_id, cm.campaign as campaignMap_campaign,
coalesce(cm.campaign, r.campaign_id) as campaign_id, c.title, c.type, c.executingType, c.machineConfigId from Run r
left join CampaignMap cm on cm.id = r.campaignMap_id
left join Campaign c on c.id = coalesce(cm.campaign, r.campaign_id)
where r.id in (6822, 6821, 6820, 6819) order by r.id asc;

In the example above, all runs (from the BP execution) have the same campaign_id (473) that links to the campaign with the Example BP title. Through campaignmap, they are linked to the campaign records corresponding to the steps in the BP workflow.
Data Stores
- The
datastoretable represents a Data Store itself. - The
datastorecolumntable represents a single column in a Data Store.
For the Data Store data, there is an additional wf_datastore database in MS SQL that has a table for each Data Store. Actual Data Store content is stored in that table.
Events

- The
event_objecttable links another object in the system that generates an event (Run, Campaign, User) toevent_tracking. That link is established throughOBJECT_TYPE = Run | Campaign | ...andOBJECT_ID, the linked object ID in the corresponding table. - The
event_trackingtable contains the event type and description.
User management

The main tables here are as follows:
- The
ApplicationUsertable contains user details. - The
UserGrouptable contains the groups where the user belongs. One user can be added to multiple groups. The link between a user and a group is stored in theUserGroupApplicationUserLinktable. - The
rolefeatures user roles in the system. It is linked to the following:Permission: a single permission in the system (for example, VIEW_DATASTORES). One role can have multiple permissions assigned through theRolePermissionLinktable.ApplicationUserthrough theApplicationUserRoleMaptable. In the UI, a user can only have one role. In the backend, it is the multiple-to-multiple relationship.UserGroupthough theUserGroupRoleLinktable. In the UI, a group can only have one role. In the backend, it is the multiple-to-multiple relationship.
User permissions are the sum of all permissions from the role and groups (through role).
System tables
There are several system tables that are not supposed to be changed, but it is better to understand their function:
changelogis the table that stores all applied migrations to the database.batch_is a number of tables controlling the batch job execution.qrtz_is a number of tables controlling the scheduling of background jobs.
Virtualizer and Control Tower database relation
Although Work.AI and Workspace have different databases, it's pretty clear that as these two components communicate with each other, they should have the same entities to store the internuncial information. These are two examples:
EndpointTaskfor Control Towerhitfor WorkSpace
The above two tables are linked by the hit unique identifier, which is vid in the hit table and nativeId in the EndpointTask one.
Here is the structure and relations of both tables:

The data is preserved in the EndpointTask table only when a hit is not submitted in Workspace. After its submission, the relevant entry is cleaned.