Databases 17 min read

Flowable Workflow Engine: Deep Dive into Core Table Schemas (Part 3)

This article details the modular design of Flowable's core database tables, dividing them into five categories—Repository, Runtime, History, Identity, and General Data—and explains each table’s fields, types, and inter‑table relationships, including multi‑tenant support and optimistic‑locking mechanisms.

Programmer1970
Programmer1970
Programmer1970
Flowable Workflow Engine: Deep Dive into Core Table Schemas (Part 3)

Repository Layer (Process Definitions & Deployments)

The repository tables store process definitions, deployment metadata, and model data.

ACT_RE_PROCDEF (Process Definition Table)

ID_ VARCHAR(64) – Primary key formatted as {key}:{version}:{randomID}, references ACT_RE_DEPLOYMENT.ID_.

NAME_ VARCHAR(255) – Human‑readable name, e.g., "Leave Request".

KEY_ VARCHAR(255) – Unique process key, e.g., vacationRequest.

VERSION_ INTEGER – Incremental version starting at 1.

DEPLOYMENT_ID_ VARCHAR(64) – Links to ACT_RE_DEPLOYMENT.ID_.

RESOURCE_NAME_ VARCHAR(2000) – Path to the BPMN XML file, e.g., processes/vacation.bpmn20.xml.

DGRM_RESOURCE_NAME_ VARCHAR(4000) – Path to the diagram image, e.g., processes/vacation.png.

HAS_START_FORM_KEY_ BOOLEAN – Indicates whether a start form exists.

TENANT_ID_ VARCHAR(255) – Tenant identifier for multi‑tenant isolation.

ACT_RE_DEPLOYMENT (Deployment Information Table)

ID_ VARCHAR(64) – Primary key (UUID) of the deployment.

NAME_ VARCHAR(255) – Deployment name, e.g., "2023‑01‑01 Deployment".

DEPLOY_TIME_ TIMESTAMP – Timestamp of deployment.

CATEGORY_ VARCHAR(255) – Category label.

ENGINE_VERSION_ VARCHAR(255) – Engine version, e.g., 6.8.0.

TENANT_ID_ VARCHAR(255) – Tenant identifier.

ACT_RE_MODEL (Model Definition Table)

ID_ VARCHAR(64) – Primary key of the model.

NAME_ VARCHAR(255) – Model name, e.g., "Leave Process Model".

MODEL_EDITOR_JSON_ TEXT – JSON representation stored by the BPMN designer.

DEPLOYMENT_ID_ VARCHAR(64) – References a deployment if the model has been deployed.

TENANT_ID_ VARCHAR(255) – Tenant identifier.

Runtime Layer (Process Instances & Tasks)

ACT_RU_EXECUTION (Execution Instance Table)

ID_ VARCHAR(64) – Execution instance ID; root execution shares the same ID as PROC_INST_ID_.

REV_ INTEGER – Optimistic‑lock version.

PROC_INST_ID_ VARCHAR(64) – Process instance ID (matches root execution).

BUSINESS_KEY_ VARCHAR(255) – Business key, e.g., order number ORD-1001.

PARENT_ID_ VARCHAR(64) – Parent execution ID for sub‑processes.

PROC_DEF_ID_ VARCHAR(64) – Links to ACT_RE_PROCDEF.ID_.

SUPER_EXEC_ID_ VARCHAR(64) – Super execution ID for call activities.

ACT_ID_ VARCHAR(255) – Current activity node ID.

IS_ACTIVE_ BOOLEAN – Indicates if the execution is active.

IS_CONCURRENT_ BOOLEAN – Marks concurrent executions.

IS_SCOPE_ BOOLEAN – Marks scope executions.

ACT_RU_TASK (Task Table)

ID_ VARCHAR(64) – Primary key of the task.

REV_ INTEGER – Optimistic‑lock version.

NAME_ VARCHAR(255) – Task name, e.g., "Department Approval".

PARENT_TASK_ID_ VARCHAR(64) – Parent task ID for sub‑tasks.

DESCRIPTION_ VARCHAR(4000) – Task description.

PRIORITY_ INTEGER – Priority (default 50).

CREATE_TIME_ TIMESTAMP – Creation timestamp.

OWNER_ VARCHAR(255) – Owner (creator), linked to ACT_ID_USER.

ASSIGNEE_ VARCHAR(255) – Assigned user, linked to ACT_ID_USER.

DELEGATION_ VARCHAR(64) – Delegation state, e.g., pending.

PROC_INST_ID_ VARCHAR(64) – Process instance ID, linked to ACT_RU_EXECUTION.

EXECUTION_ID_ VARCHAR(64) – Execution instance ID, linked to ACT_RU_EXECUTION.

TASK_DEF_KEY_ VARCHAR(255) – Task definition key from BPMN.

FORM_KEY_ VARCHAR(255) – Associated form key.

ACT_RU_VARIABLE (Runtime Variable Table)

ID_ VARCHAR(64) – Primary key.

REV_ INTEGER – Optimistic‑lock version.

TYPE_ VARCHAR(255) – Variable type (e.g., string, json, serializable).

NAME_ VARCHAR(255) – Variable name.

EXECUTION_ID_ VARCHAR(64) – Links to ACT_RU_EXECUTION.ID_.

PROC_INST_ID_ VARCHAR(64) – Links to the process instance.

TASK_ID_ VARCHAR(64) – Task‑scoped variable, links to ACT_RU_TASK.ID_.

BYTEARRAY_ID_ VARCHAR(64) – Links to binary data in ACT_GE_BYTEARRAY.

DOUBLE_ DOUBLE – Numeric value.

LONG_ BIGINT – Long integer value.

TEXT_ TEXT – Textual value.

TEXT2_ TEXT – Extended text (e.g., multi‑language).

History Layer (Process Audit)

ACT_HI_PROCINST (Historical Process Instance Table)

ID_ VARCHAR(64) – Historical instance ID, linked to runtime ACT_RU_EXECUTION.

PROC_INST_ID_ VARCHAR(64) – Same as runtime instance ID.

BUSINESS_KEY_ VARCHAR(255) – Business key.

PROC_DEF_ID_ VARCHAR(64) – Links to ACT_RE_PROCDEF.ID_.

START_TIME_ TIMESTAMP – Process start time.

END_TIME_ TIMESTAMP – Process end time.

DURATION_ BIGINT – Duration in milliseconds.

START_USER_ID_ VARCHAR(255) – Starter user ID, linked to ACT_ID_USER.

DELETE_REASON_ VARCHAR(4000) – Reason for deletion, e.g., "Manual termination".

TENANT_ID_ VARCHAR(255) – Tenant identifier.

ACT_HI_TASKINST (Historical Task Instance Table)

ID_ VARCHAR(64) – Historical task ID, linked to runtime ACT_RU_TASK.

PROC_INST_ID_ VARCHAR(64) – Process instance ID, linked to ACT_HI_PROCINST.

EXECUTION_ID_ VARCHAR(64) – Execution ID, linked to ACT_RU_EXECUTION.

TASK_DEF_KEY_ VARCHAR(255) – Task definition key.

NAME_ VARCHAR(255) – Task name.

PARENT_TASK_ID_ VARCHAR(64) – Parent task ID.

ASSIGNEE_ VARCHAR(255) – Assignee, linked to user table.

START_TIME_ TIMESTAMP – Start time.

END_TIME_ TIMESTAMP – End time.

DURATION_ BIGINT – Duration.

DELETE_REASON_ VARCHAR(4000) – Deletion reason, e.g., "Skipped".

ACT_HI_VARINST (Historical Variable Table)

ID_ VARCHAR(64) – Primary key.

PROC_INST_ID_ VARCHAR(64) – Links to ACT_HI_PROCINST.ID_.

EXECUTION_ID_ VARCHAR(64) – Links to runtime execution.

TASK_ID_ VARCHAR(64) – Task‑scoped variable, links to ACT_RU_TASK.ID_.

NAME_ VARCHAR(255) – Variable name.

VAR_TYPE_ VARCHAR(255) – Variable type.

TEXT_ TEXT – Variable value.

BYTEARRAY_ID_ VARCHAR(64) – Binary data ID, links to ACT_GE_BYTEARRAY.

Identity Layer (Users & Groups)

ACT_ID_USER (User Table)

ID_ VARCHAR(64) – Primary key.

REV_ INTEGER – Optimistic‑lock version.

FIRST_ VARCHAR(255) – First name.

LAST_ VARCHAR(255) – Last name.

EMAIL_ VARCHAR(255) – Email address.

PWD_ VARCHAR(255) – Encrypted password.

SALT_ VARCHAR(255) – Password salt.

PICTURE_ID_ VARCHAR(64) – Avatar image ID, linked to ACT_GE_BYTEARRAY.

ACT_ID_GROUP (Group Table)

ID_ VARCHAR(64) – Primary key.

REV_ INTEGER – Optimistic‑lock version.

NAME_ VARCHAR(255) – Group name, e.g., "Finance Department".

TYPE_ VARCHAR(255) – Group type, e.g., department or role.

ACT_ID_MEMBERSHIP (User‑Group Association)

USER_ID_ VARCHAR(64) – References ACT_ID_USER.ID_.

GROUP_ID_ VARCHAR(64) – References ACT_ID_GROUP.ID_.

General Data Layer

ACT_GE_BYTEARRAY (Binary Resource Table)

ID_ VARCHAR(64) – Primary key for binary resources.

REV_ INTEGER – Optimistic‑lock version.

NAME_ VARCHAR(255) – Resource name, e.g., vacation.bpmn20.xml.

DEPLOYMENT_ID_ VARCHAR(64) – Links to ACT_RE_DEPLOYMENT.ID_.

BYTES_ BLOB – Binary content of BPMN files, diagrams, etc.

ACT_GE_PROPERTY (System Property Table)

NAME_ VARCHAR(64) – Property name, e.g., schema.version, next.dbid.

VALUE_ VARCHAR(300) – Property value.

REV_ INTEGER – Optimistic‑lock version.

Table Relationship Summary

ACT_RE_PROCDEF.DEPLOYMENT_ID_ → ACT_RE_DEPLOYMENT.ID_
ACT_RE_PROCDEF.DGRM_RESOURCE_NAME_ → ACT_GE_BYTEARRAY.NAME_

(diagram resource)

When a process ends, runtime tables ACT_RU_EXECUTION, ACT_RU_TASK, ACT_RU_VARIABLE are copied to their corresponding history tables ( ACT_HI_PROCINST, ACT_HI_TASKINST, ACT_HI_VARINST).

ACT_RU_TASK.EXECUTION_ID_ → ACT_RU_EXECUTION.ID_
ACT_RU_TASK.PROC_INST_ID_ → ACT_RU_EXECUTION.PROC_INST_ID_
ACT_ID_MEMBERSHIP.USER_ID_ → ACT_ID_USER.ID_

and

ACT_ID_MEMBERSHIP.GROUP_ID_ → ACT_ID_GROUP.ID_
ACT_RU_VARIABLE.EXECUTION_ID_ → ACT_RU_EXECUTION.ID_
ACT_HI_VARINST.PROC_INST_ID_ → ACT_HI_PROCINST.ID_

Key Design Highlights

All runtime tables include a REV_ column to implement optimistic locking and prevent concurrent update conflicts.

Multi‑tenant isolation is achieved via the TENANT_ID_ column present in every major table, ensuring data segregation across tenants.

Process completion triggers data migration from runtime tables to history tables while retaining runtime rows unless explicitly deleted.

Binary resources such as BPMN files and diagrams are stored in ACT_GE_BYTEARRAY and linked to deployments via DEPLOYMENT_ID_.

Relationships are expressed through foreign‑key‑like columns (e.g., ACT_RU_TASK.EXECUTION_ID_ → ACT_RU_EXECUTION.ID_, ACT_RU_TASK.PROC_INST_ID_ → ACT_RU_EXECUTION.PROC_INST_ID_, ACT_ID_MEMBERSHIP.USER_ID_ → ACT_ID_USER.ID_).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BPMNMulti‑TenantWorkflow Enginedatabase-schemaflowableOptimistic LockingProcess History
Programmer1970
Written by

Programmer1970

Formerly called 'Code to 35'. Add our main WeChat ID to access a wealth of shared resources (algorithms, interview prep, tech stacks: Java, Python, Go, big data). We mainly share serious development techniques, focusing on output-driven input. Occasionally we post life snippets and gossip. Our aim is to attract precise traffic and test advertising opportunities.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.