dhi.io/flowable-rest
Flowable REST runs the Flowable BPMN, CMMN and DMN engines as a Spring Boot application behind a REST API, for deploying and running processes, cases and decisions over HTTP.
All examples in this guide use the public image. If you've mirrored the repository for your own use (for example, to your Docker Hub namespace), update your commands to reference the mirrored image instead of the public one.
For example:
dhi.io/flowable-rest:<tag><your-namespace>/dhi-flowable-rest:<tag>For the examples, you must first use docker login dhi.io to authenticate to the registry to pull the images.
This image runs Flowable REST, the Spring Boot application that puts the Flowable BPMN, CMMN and DMN engines, together
with the IDM, app, event registry and external worker APIs, behind a REST API. It starts through
/flowable-entrypoint.sh, the same entrypoint as the flowable/flowable-rest image, and arguments you pass to the
container are handed to Spring Boot, so --server.port=9090 and similar options work as they do there. The application
listens on port 8080 under the /flowable-rest context path, and the REST API lives under
http://localhost:8080/flowable-rest/service/.
As in the upstream image, the REST API needs HTTP basic authentication, except for the OpenAPI specification files under
/flowable-rest/docs/specfile/ (see Use the OpenAPI specifications). The default
user is rest-admin with the password test, and the example process definitions (oneTaskProcess, vacationRequest
and others) are deployed on the first start. Without database settings the application uses an embedded H2 database
inside the container, which is lost when the container is removed. The PostgreSQL JDBC driver is included.
For the engine APIs and every configuration property, see the Flowable REST API documentation and the Flowable project.
$ docker run -d --name flowable-rest -p 8080:8080 \
dhi.io/flowable-rest:<tag>
The application is ready when the log shows Started FlowableRestApplication. Query the engine and list the deployed
process definitions:
$ curl -s -u rest-admin:test http://localhost:8080/flowable-rest/service/management/engine
{"exception":null,"name":"default","resourceUrl":null,"version":"8.0.0"}
$ curl -s -u rest-admin:test http://localhost:8080/flowable-rest/service/repository/process-definitions
This example stores the engine data in PostgreSQL. The PostgreSQL password is 14 characters or longer so that the same file also works with the FIPS variants (see FIPS variants). Replace both example passwords before production use.
services:
flowable-rest:
image: dhi.io/flowable-rest:<tag>
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver
SPRING_DATASOURCE_URL: jdbc:postgresql://flowable-db:5432/flowable
SPRING_DATASOURCE_USERNAME: flowable
SPRING_DATASOURCE_PASSWORD: flowable-db-Passw0rd
FLOWABLE_REST_APP_ADMIN_PASSWORD: change-me-Passw0rd
depends_on:
flowable-db:
condition: service_healthy
flowable-db:
image: dhi.io/postgres:18
environment:
POSTGRES_DB: flowable
POSTGRES_USER: flowable
POSTGRES_PASSWORD: flowable-db-Passw0rd
volumes:
- flowable-db-data:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-U", "flowable", "-d", "flowable"]
interval: 5s
timeout: 5s
retries: 10
volumes:
flowable-db-data:
$ docker compose up -d
$ curl -s -u rest-admin:change-me-Passw0rd http://localhost:8080/flowable-rest/service/management/engine
Flowable REST reads its configuration through Spring Boot, so any property can be set as an environment variable. The ones used in this guide:
| Variable | Description | Default | Required |
|---|---|---|---|
JAVA_OPTS | Options passed to the java command by the entrypoint | -Xmx512M | No |
SERVER_PORT | Port the application listens on inside the container | 8080 | No |
FLOWABLE_REST_APP_ADMIN_USER_ID | Name of the admin user created on the first start | rest-admin | No |
FLOWABLE_REST_APP_ADMIN_PASSWORD | Password of the admin user created on the first start | test | No |
SPRING_DATASOURCE_URL | JDBC URL of the engine database | embedded H2 database | No |
SPRING_DATASOURCE_DRIVER-CLASS-NAME | JDBC driver class, org.postgresql.Driver for PostgreSQL | detected from the URL | No |
SPRING_DATASOURCE_USERNAME | Database user | flowable | No |
SPRING_DATASOURCE_PASSWORD | Database password | flowable | No |
Set the admin password when you start the container:
$ docker run -d --name flowable-rest -p 8080:8080 \
-e FLOWABLE_REST_APP_ADMIN_PASSWORD=change-me-Passw0rd \
dhi.io/flowable-rest:<tag>
The application creates the admin user only when it does not exist yet, so the variable has no effect on a database that already has one. To change the password of an existing admin user, use the IDM API:
$ curl -s -u rest-admin:change-me-Passw0rd -H 'Content-Type: application/json' -X PUT \
-d '{"password": "new-Passw0rd-value"}' \
http://localhost:8080/flowable-rest/idm-api/users/rest-admin
The FLOWABLE_COMMON_APP_IDM-ADMIN_USER and FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD variables found in some upstream
Compose files are not read by Flowable REST, in this image or in the upstream one.
Start an instance of the oneTaskProcess example, then find and complete its user task:
$ curl -s -u rest-admin:test -H 'Content-Type: application/json' -X POST \
-d '{"processDefinitionKey": "oneTaskProcess"}' \
http://localhost:8080/flowable-rest/service/runtime/process-instances
$ TASK_ID=$(curl -s -u rest-admin:test \
'http://localhost:8080/flowable-rest/service/runtime/tasks?processDefinitionKey=oneTaskProcess' | jq -r '.data[0].id')
$ curl -s -u rest-admin:test -H 'Content-Type: application/json' -X POST \
-d '{"action": "complete"}' \
http://localhost:8080/flowable-rest/service/runtime/tasks/$TASK_ID
After the task is completed, the instance appears under
http://localhost:8080/flowable-rest/service/history/historic-process-instances?finished=true.
For evaluation without an external database, keep the H2 database on a volume. /data exists and is writable by the
image's user (uid 65532, group 0), so point the JDBC URL there:
$ docker run -d --name flowable-rest -p 8080:8080 \
-e 'SPRING_DATASOURCE_URL=jdbc:h2:/data/ossdb;DB_CLOSE_DELAY=-1' \
-v flowable-data:/data \
dhi.io/flowable-rest:<tag>
Process instances, deployments and users survive a container restart. Use PostgreSQL, as in the Compose example, for production.
The OpenAPI (Swagger) specification of each REST API is served without authentication, in JSON and YAML, at
http://localhost:8080/flowable-rest/docs/specfile/<api>/flowable-swagger-<name>.json. Point Swagger UI or an API
client generator at one of these:
| API | Specification path |
|---|---|
| Process (BPMN) | /flowable-rest/docs/specfile/process/flowable-swagger-process.json |
| Case (CMMN) | /flowable-rest/docs/specfile/cmmn/flowable-swagger-cmmn.json |
| Decision (DMN) | /flowable-rest/docs/specfile/dmn/flowable-swagger-decision.json |
| App | /flowable-rest/docs/specfile/app/flowable-swagger-app.json |
| Event registry | /flowable-rest/docs/specfile/eventregistry/flowable-swagger-eventregistry.json |
| External worker | /flowable-rest/docs/specfile/external-worker/flowable-swagger-external-worker.json |
| Identity (IDM) | /flowable-rest/docs/specfile/idm/flowable-swagger-idm.json |
$ curl -s http://localhost:8080/flowable-rest/docs/specfile/process/flowable-swagger-process.json | jq -r '.info.title'
The -fips and -fips-dev tags use the OpenSSL FIPS provider for OS-level cryptography, and run the JVM with the
Bouncy Castle FIPS provider (BCFIPS) as the first security provider in approved-only mode, with a BCFKS trust store.
The settings are carried in JDK_JAVA_OPTIONS; overriding that variable removes them. JAVA_OPTS is separate and safe
to override. Check the provider order:
$ docker run --rm --entrypoint java dhi.io/flowable-rest:<tag>-fips -XshowSettings:security:providers -version 2>&1 | grep -m2 'Provider name'
Provider name: BCFIPS
Provider name: BCJSSE
In approved-only mode, PostgreSQL's SCRAM-SHA-256 authentication, the default in current PostgreSQL releases, needs a
database password of at least 14 characters (112 bits). With a shorter password the application stops during startup
with FipsUnapprovedOperationError: password must be at least 112 bits. This does not apply to the Flowable admin
password.
The JDK's SUN provider stays registered after BCFIPS for non-security uses such as checksums: Groovy script tasks
need it, because Groovy keys every script it compiles by an MD5 hash of the source. An unqualified
MessageDigest.getInstance("MD5") therefore still returns an MD5 digest from SUN, while MD5 requested from the FIPS
provider (MessageDigest.getInstance("MD5", "BCFIPS")) fails with NoSuchAlgorithmException. The JDK's SunJCE
provider is not loaded, so non-approved MACs and ciphers such as Mac.getInstance("HmacMD5"), DES and RC4 fail with
NoSuchAlgorithmException. Do not rely on MD5 digests being unavailable; use approved algorithms for anything
security-relevant.
The image runs as flowable with uid/gid 65532 instead of uid 100, gid 101. Its account home remains
/home/flowable, so the default H2 database stays at /home/flowable/flowable-db. To reuse an upstream volume, stop
the upstream container, correct ownership with the dev tag, then mount it at the same path. No JDBC URL change is
needed:
$ docker run --rm --entrypoint chown -v flowable-home:/home/flowable \
dhi.io/flowable-rest:<tag>-dev -R 65532:65532 /home/flowable
$ docker run -d --name flowable-rest -p 8080:8080 \
-v flowable-home:/home/flowable \
dhi.io/flowable-rest:<tag>
An explicit JVM -Duser.home in JAVA_OPTS still takes precedence over the account home. PostgreSQL and other
external databases need no change.
/wait-for-something.sh is not included. The upstream image inherits this helper, which loops on nc until a
host and port answer, and its example Compose files use it as the entrypoint. Give the database service a
healthcheck and use depends_on with condition: service_healthy instead, as in the
Compose example.
The bundled Swagger UI page at /flowable-rest/docs/ is not served. The OpenAPI specifications it displays still
are; see Use the OpenAPI specifications.
The JRE is Eclipse Temurin 21 at /usr/lib/jvm/temurin-21. The upstream image uses Azul Zulu 21 at
/usr/lib/jvm/zulu21. JAVA_HOME points to the new location; update scripts or mounts that use the old path.
The runtime image has /bin/sh only because the entrypoint script needs it, and no package manager. Use a dev
tag to install packages in a build stage. The application lives at /usr/share/flowable-rest, and /app links to it,
so paths such as /app/WEB-INF/lib in upstream-based Dockerfiles still work.
Docker Hardened Images come in different variants depending on their intended use. Image variants are identified by their tag.
Runtime variants are designed to run your application in production. These images are intended to be used either directly or as the FROM image in the final stage of a multi-stage build. These images typically:
Build-time variants typically include dev in the tag name and are intended for use in the first stage of a
multi-stage Dockerfile. These images typically:
FIPS variants include fips in the variant name and tag. They come in both runtime and build-time variants. These
variants use cryptographic modules that have been validated under FIPS 140, a U.S. government standard for secure
cryptographic operations. For example, usage of MD5 fails in FIPS variants.
To view the image variants and get more information about them, select the Tags tab for this repository, and then select a tag.
To migrate your application to a Docker Hardened Image, you must update your Dockerfile. At minimum, you must update the base image in your existing Dockerfile to a Docker Hardened Image. This and a few other common changes are listed in the following table of migration notes.
| Item | Migration note |
|---|---|
| Base image | Replace your base images in your Dockerfile with a Docker Hardened Image. |
| Package management | Non-dev images, intended for runtime, don't contain package managers. Use package managers only in images with a dev tag. |
| Non-root user | By default, non-dev images, intended for runtime, run as the nonroot user. Ensure that necessary files and directories are accessible to the nonroot user. |
| Multi-stage build | Utilize images with a dev tag for build stages and non-dev images for runtime. For binary executables, use a static image for runtime. |
| TLS certificates | Docker Hardened Images contain standard TLS certificates by default. There is no need to install TLS certificates. |
| Ports | Non-dev hardened images run as a nonroot user by default. As a result, applications in these images can't bind to privileged ports (below 1024) when running in Kubernetes or in Docker Engine versions older than 20.10. To avoid issues, configure your application to listen on port 1025 or higher inside the container. |
| Entry point | Docker Hardened Images may have different entry points than images such as Docker Official Images. Inspect entry points for Docker Hardened Images and update your Dockerfile if necessary. |
| No shell | By default, non-dev images, intended for runtime, don't contain a shell. Use dev images in build stages to run shell commands and then copy artifacts to the runtime stage. |
The following steps outline the general migration process.
Find hardened images for your app.
A hardened image may have several variants. Inspect the image tags and find the image variant that meets your needs.
Update the base image in your Dockerfile.
Update the base image in your application's Dockerfile to the hardened image you found in the previous step. For
framework images, this is typically going to be an image tagged as dev because it has the tools needed to install
packages and dependencies.
For multi-stage Dockerfiles, update the runtime image in your Dockerfile.
To ensure that your final image is as minimal as possible, you should use a multi-stage build. All stages in your
Dockerfile should use a hardened image. While intermediary stages will typically use images tagged as dev, your
final runtime stage should use a non-dev image variant.
Install additional packages
Docker Hardened Images contain minimal packages in order to reduce the potential attack surface. You may need to install additional packages in your Dockerfile. Inspect the image variants to identify which packages are already installed.
Only images tagged as dev typically have package managers. You should use a multi-stage Dockerfile to install the
packages. Install the packages in the build stage that uses a dev image. Then, if needed, copy any necessary
artifacts to the runtime stage that uses a non-dev image.
For Alpine-based images, you can use apk to install packages. For Debian-based images, you can use apt-get to
install packages.
The following are common issues that you may encounter during migration.
The hardened images intended for runtime don't contain a shell nor any tools for debugging. The recommended method for debugging applications built with Docker Hardened Images is to use Docker Debug to attach to these containers. Docker Debug provides a shell, common debugging tools, and lets you install other tools in an ephemeral, writable layer that only exists during the debugging session.
By default image variants intended for runtime, run as the nonroot user. Ensure that necessary files and directories are accessible to the nonroot user. You may need to copy files to different directories or change permissions so your application running as the nonroot user can access them.
Non-dev hardened images run as a nonroot user by default. As a result, applications in these images can't bind to
privileged ports (below 1024) when running in Kubernetes or in Docker Engine versions older than 20.10. To avoid issues,
configure your application to listen on port 1025 or higher inside the container, even if you map it to a lower port on
the host. For example, docker run -p 80:8080 my-image will work because the port inside the container is 8080, and
docker run -p 80:81 my-image won't work because the port inside the container is 81.
By default, image variants intended for runtime don't contain a shell. Use dev images in build stages to run shell
commands and then copy any necessary artifacts into the runtime stage. In addition, use Docker Debug to debug containers
with no shell.
Docker Hardened Images may have different entry points than images such as Docker Official Images. Use docker inspect
to inspect entry points for Docker Hardened Images and update your Dockerfile if necessary.