Business Key no longer required to be unique?

I am using Flowable 5 and the Javadocs ( for FormService.submitStartFormData state:

Note that a business key MUST be unique for the given process definition.

However, I was able to create a new process instance with that method for the same process definition with the same business key. I am using MySQL as my database and querying the ACT_HI_PROCINST table returns:

| id_ | proc_inst_id_ | business_key_ | proc_def_id_ |
| 47406 | 47406 | A1234 | TestProcess:1:8 |
| 47435 | 47435 | A1234 | TestProcess:1:8 |

I did some digging and it appears the SQL script for MySQL had a unique index for this column changed to not be unique as part of ACT-1860:

commit f091c463439d1e648604de9984d03b34fb784c61
Author: Joram Barrez
Date: Thu Nov 21 09:16:45 2013 +0100

ACT-1860: Remove unique constraint on business key

But the docs continue to say it must be unique. Was there supposed to be a check in the code to prevent duplicate business keys? Or are the docs in error and business key no longer must be unique?

I have not tried this with Flowable 6, but the docs still say the same thing that business key must be unique for a given process definition.



1 Like

The javadocs are wrong, the business key should not be unique anymore. The javadoc has been updated here:

Of course, if you want to have the same behaviour, you can always add a unique index on the table yourself (which was the old implementation).

I think the unique is need, at least in my case. We use bussiness key as a mechanism to keep idempotent when start porcess instance. In some system it called “correlation id”. I hope it can add back to flowable, or give us other way to achive idempotent, thanks.


You can modify DB schema and add unique constraint to your solution.