flowable/flowable-engine · warning

Invalid service task type

Error message

Invalid service task type: '{}'  for service task {}

What it means

A serviceTask declares a 'type' attribute with a value the engine does not know how to map to an activity behavior. Known types include mail, mule, camel, shell, dmn, etc.; anything else falls through to this warning and no behavior is assigned. The task will lack runtime behavior in the deployed process.

Solutions

  1. Correct the type attribute to a supported value (e.g. mail, mule, camel, shell)
  2. Use activiti:class / delegateExpression / expression instead of the type attribute for custom logic
  3. Upgrade the engine version if the desired type is supported there

Example fix

// before
<serviceTask id="st1" flowable:type="maill"/>
// after
<serviceTask id="st1" flowable:type="mail"/>
Defensive patterns

Strategy: validation

Validate before calling

Set<String> KNOWN = Set.of("mail","mule","camel","shell","dmn");
for (ServiceTask t : model.getFlowElementsOfType(ServiceTask.class)) {
    String type = t.getType();
    if (type != null && !KNOWN.contains(type.toLowerCase())) {
        throw new IllegalArgumentException("serviceTask " + t.getId() + " has unknown type '" + type + "'");
    }
}

Type guard

function isKnownServiceTaskType(type) { return ['mail','mule','camel','shell','dmn'].includes(String(type).toLowerCase()); }

Prevention

When it happens

Trigger: executeParse of a ServiceTask with implementationType IMPLEMENTATION_TYPE_TYPE where getType() is a non-empty string not matching any known branch (case-insensitive compare against "mail", "mule", "camel", "shell", etc.).

Common situations: Typo in the type attribute ("maill", "CamelTask"); copying config from a different engine that supports other types; custom type extension expected in a newer engine version.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/0a845f0275fe8eed. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/ServiceTaskParseHandler.java:59

        ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, serviceTask, BpmnXMLConstants.ELEMENT_TASK_SERVICE);
        activity.setAsync(serviceTask.isAsynchronous());
        activity.setFailedJobRetryTimeCycleValue(serviceTask.getFailedJobRetryTimeCycleValue());
        activity.setExclusive(!serviceTask.isNotExclusive());

        // Email, and Shell service tasks
        if (StringUtils.isNotEmpty(serviceTask.getType())) {

            if ("mail".equalsIgnoreCase(serviceTask.getType())) {
                activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createMailActivityBehavior(serviceTask));

            } else if ("camel".equalsIgnoreCase(serviceTask.getType())) {
                activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(serviceTask, bpmnParse.getBpmnModel()));

            } else if ("shell".equalsIgnoreCase(serviceTask.getType())) {
                activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createShellActivityBehavior(serviceTask));

            } else {
                LOGGER.warn("Invalid service task type: '{}'  for service task {}", serviceTask.getType(), serviceTask.getId());
            }

            // activiti:class
        } else if (ImplementationType.IMPLEMENTATION_TYPE_CLASS.equalsIgnoreCase(serviceTask.getImplementationType())) {
            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createClassDelegateServiceTask(serviceTask));

            // activiti:delegateExpression
        } else if (ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {
            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskDelegateExpressionActivityBehavior(serviceTask));

            // activiti:expression
        } else if (ImplementationType.IMPLEMENTATION_TYPE_EXPRESSION.equalsIgnoreCase(serviceTask.getImplementationType())) {
            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createServiceTaskExpressionActivityBehavior(serviceTask));

            // Webservice
        } else if (ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(serviceTask.getImplementationType()) &&
                StringUtils.isNotEmpty(serviceTask.getOperationRef())) {

View on GitHub (pinned to d6d39ce1c6)