Project: Cadence Workflow (Provisioning / Automation & Configuration)
File: cassandra-executions-table.md

The `executions` table in Cassandra is a table used for storing mutiple types of entities, because Cassandra doesn't support cross-table LWTs. The `type` column in `executions` table indicates the type of entity stored in that row. Since the table stores all the entities, the columns are the union set of columns of all entities. And the data in each column have different meaning for different type of entities. We'll explain for each type of entity the usage of the columns in `executions` table. The `shard` entities are the rows with `type=0`, which stores the information of Cadence shards. The following columns are used: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of entity, which is always `0` for `shard` `shard`: stores the information of `shard` `range_id`: used to manage changes to the shard's configuration and ownership Other columns are set to a constant only because they're part of primary key columns: `domain_id`: 10000000-1000-f000-f000-000000000000 `workflow_id`: 20000000-1000-f000-f000-000000000000 `run_id`: 30000000-1000-f000-f000-000000000000 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 `task_id`: -11 The `execution` entities are the rows with `type=1`, which stores the information of workflow. And there are 2 types of executions: `currentexecution` and `concreteexecution`. The `currentexecution` entities has a constant value in the `runid` column which equals `30000000-0000-f000-f000-000000000001`. The follwing columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `domain_id`: the `id` of the domain of the workflow `workflow_id`: the `id` of the workflow `currentrunid`: the `runid` of the most recent workflow among the workflows with the same `workflowid` `execution`: stores some information about the workflow `workflowlastwrite_version`: the failover version of the workflow last updated by a Cadence cluster `workflow_state`: the state of the workflow The following columns are set to a constant value: `run_id`: 30000000-0000-f000-f000-000000000001 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 `task_id`: -10 The `concrete_execution` entities stores the information of each run of a

These columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `domain_id`: the `id` of the domain of the workflow `workflow_id`: the `id` of the workflow `run_id`: the `id` of the instance of the workflow `execution`: stores some information about the workflow `nexteventid`: the `id` of the next event of the workflow `activity_map`: the information of activities of the workflow `timer_map`: the information of timers of the workflow `childexecutionsmap`: the information of child workflows of the workflow `requestcancelmap`: the information of cancellation requests of the workflow `signal_map`: the information of signals applied to the workflow `signal_requested`: the ids of the signals applied to the workflow `bufferedeventslist`: the buffered events of the workflow `workflowlastwrite_version`: the failover version of the workflow last updated by a Cadence cluster `workflow_state`: the state of the workflow `version_histories`: stores the information tracking the version history of the workflow `versionhistoriesencoding`: the encoding type of `version_histories` column `checksum`: a piece of data used for detecting data corruption in database The following columns are set to a constant value: `visibility_ts`: 2000-01-01 00:00:00.000000+0000 `task_id`: -10 The `transfer_task` entities are the rows with `type=2`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `task_id`: the `id` of the task `transfer`: the information of the task The following columns are set to a constant value: `domain_id`: 10000000-3000-f000-f000-000000000000 `workflow_id`: 20000000-3000-f000-f000-000000000000 `run_id`: 30000000-3000-f000-f000-000000000000 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 The `timer_task` entities are the rows with `type=3`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `visibility_ts`: the timestamp of the timer task `task_id`: the `id` of the task `timer`: the information of the task The following columns are set to a constant value: `domain_id`: 10000000-4000-f000-f000-000000000000 `workflow_id`: 20000000-4000-f000-f000-000000000000 `run_id`: 30000000-4000-f000-f000-000000000000 The `replication_task` entities are the rows with `type=4`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `task_id`: the `id` of the task `replication`: the information of the task The following columns are set to a constant value: `domain_id`: 10000000-5000-f000-f000-000000000000 `workflow_id`: 20000000-5000-f000-f000-000000000000 `run_id`: 30000000-5000-f000-f000-000000000000 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 The `dlq` entities are the rows with `type=5`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `workflow_id`: the source cluster of the replication task `task_id`: the `id` of the task `replication`: the information of the task The following columns are set to a constant value: `domain_id`: 10000000-6000-f000-f000-000000000000 `run_id`: 30000000-6000-f000-f000-000000000000 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 The `crossclustertask` entities are the rows with `type=6`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity `workflow_id`: the target cluster which the task is applied to `task_id`: the `id` of the task `cross_cluster`: the information of the task The following columns are set to a constant value: `domain_id`: 10000000-7000-f000-f000-000000000000 `run_id`: 30000000-7000-f000-f000-000000000000 `visibility_ts`: 2000-01-01 00:00:00.000000+0000 The `workflow_requests` entities are rows with `type` in `{7, 8, 9, 10}`. The following columns are set: `shard_id`: the `id` of the Cadence shard `type`: indicates the type of the entity (7 = StartWorkflowRequest, 8 = SignalWorkflowRequest, 9 = CancelWorkflowRequest, 10 = ResetWorkflowRequest) `domain_id`: the `id` of the domain `workflow_id`: the `id` of the workflow which the request is applied to `run_id`: the `id` of the request `task_id`: the failover version of the domain when the request is applied `currentrunid`: the `run_id` of the workflow which the request is applied to The following columns are set to a constant value: `visibility_ts`: 2000-01-01 00:00:00.000000+0000