Configuring Workflow Services

This document describes how to configure a Workflow service with the SonataFlow Operator.

Editing the Workflow Configuration

When the operator deploys the Workflow service, it also creates two `ConfigMap`s to store the runtime properties:

  • The user properties are defined in a ConfigMap named after the SonataFlow object with the suffix -props. For example, if your Workflow name is greeting, then the ConfigMap name is greeting-props.

  • The Managed Properties are defined in a ConfigMap named after the SonataFlow object with the suffix -managed-props. For example, if your Workflow name is greeting, then the ConfigMap name is greeting-managed-props.

Managed properties always override any user property using the same key name and cannot be edited by the user. Any change would be overwritten by the operator at the next reconciliation cycle.

You can use the Kubernetes object editor of your preference to add or edit the properties in the Workflow configuration. Using kubectl you can do:

Editing the Workflow Properties
kubectl edit cm <workflow-name>-props

Note that it’s important to respect the properties format, otherwise the operator will replace your configuration with the default one.

Here’s an example of a Workflow properties stored within a ConfigMap:

Example of a Workflow ConfigMap Properties
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app: greeting
  name: greeting-props
  namespace: default
data:
  application.properties: |
    my.properties.key = any-value

The underlying runtime engine that executes the Workflow service is based on Quarkus. The application.properties key in the ConfigMap means that you can configure the Workflow as you would any Quarkus application.

Any SonataFlow configuration that the documentation describes or general Quarkus application property can be configured using this method.

Managed properties

A few properties cannot be changed in this configuration and they are defined in the managed properties file. The table below lists them.

Table 1. List of managed properties
Property Key Immutable Value Profile

quarkus.http.port

8080

all

quarkus.http.host

0.0.0.0

all

org.kie.kogito.addons.knative.eventing.health-enabled

false

dev

Other managed properties include:

If you try to change any of them, the operator will override them with the default, but preserving your changes in other property keys.

Defining Global Managed Properties

It’s possible to set custom global managed properties for your workflows by defining them in the SonataFlowPlatform resource in the same namespace.

Edit the SonataFlowPlatform instance and add the required properties to the .spec.properties.flow attribute. For example:

Example of a SonataFlowPlatform with flow properties
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform
spec:
    properties:
        flow: (1)
         - name: quarkus.log.category (2)
           value: INFO (3)
1 Attribute to set the array of custom global managed properties
2 The property key
3 The property value

Every workflow in this SonataFlowPlatform instance’s namespace will have the property quarkus.log.category: INFO added to its managed properties.

You can’t override the default managed properties set by the operator using this feature.

You can add properties from other ConfigMap or Secret from the same namespace. For example:

Example of a SonataFlowPlatform properties from ConfigMap and Secret
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform
spec:
    properties:
        flow:
         - name: my.petstore.auth.token
           valueFrom: (1)
                secretKeyRef: petstore-credentials
                    keyName: AUTH_TOKEN
         - name: my.petstore.url
           valueFrom:
                configMapRef: petstore-props
                    keyName: PETSTORE_URL
1 The valueFrom attribute derives from the EnvVar Kubernetes API.

Found an issue?

If you find an issue or any misleading information, please feel free to report it here. We really appreciate it!