flowable/flowable-engine · error · FlowableException

Unsupported flow element type

Error message

Unsupported flow element type %s

What it means

Thrown in WebServiceActivityBehavior.execute() when the activity's flow element is neither a SendTask nor a ServiceTask with the expected web-service properties (ioSpecification, operationRef, data associations). Only those element types can invoke a web service; any other element routed to this behavior is unsupported.

Solutions

  1. Use a <serviceTask> (with webservice implementation) or <sendTask> element in the BPMN XML instead of another task type
  2. Verify the element's implementation/behavior mapping — do not attach WebServiceActivityBehavior to other flow elements
  3. Regenerate/repair the deployed BPMN model if it was programmatically modified
  4. Check custom BpmnParseHandler code that may assign the wrong behavior class to the element

Example fix

<!-- before -->
<task id="wsCall" activiti:expression="${webServiceActivityBehavior}">
<!-- after -->
<serviceTask id="wsCall" activiti:implementation="##WebService" activiti:operationRef="tns:myOperation">
Defensive patterns

Strategy: validation

Validate before calling

if (!(flowElement instanceof ServiceTask) && !(flowElement instanceof SendTask)) {
    throw new IllegalArgumentException("WebServiceActivityBehavior only supports ServiceTask/SendTask, got " + flowElement.getClass());
}

Type guard

boolean isWebServiceTask(FlowElement e) { return e instanceof ServiceTask || e instanceof SendTask; }

Try / catch

try {
    deploymentBuilder.deploy();
} catch (FlowableException e) {
    if (e.getMessage().startsWith("Unsupported flow element type")) { /* fix BPMN element type */ }
    throw e;
}

Prevention

When it happens

Trigger: A BPMN element (e.g. a custom task or misconfigured activity) whose behavior is set to WebServiceActivityBehavior but whose Bpmn flowElement is not a SendTask/ServiceTask; programmatic model corruption where the behavior/element pairing is wrong.

Common situations: Custom task types reusing the web service behavior class; a broken/patched BPMN model where behavior was assigned manually; copy-pasted XML merging attributes across task types.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/behavior/WebServiceActivityBehavior.java:111

        List<DataAssociation> dataInputAssociations = null;
        List<DataAssociation> dataOutputAssociations = null;

        if (flowElement instanceof SendTask) {
            SendTask sendTask = (SendTask) flowElement;
            ioSpecification = sendTask.getIoSpecification();
            operationRef = sendTask.getOperationRef();
            dataInputAssociations = sendTask.getDataInputAssociations();
            dataOutputAssociations = sendTask.getDataOutputAssociations();

        } else if (flowElement instanceof ServiceTask) {
            ServiceTask serviceTask = (ServiceTask) flowElement;
            ioSpecification = serviceTask.getIoSpecification();
            operationRef = serviceTask.getOperationRef();
            dataInputAssociations = serviceTask.getDataInputAssociations();
            dataOutputAssociations = serviceTask.getDataOutputAssociations();

        } else {
            throw new FlowableException("Unsupported flow element type " + flowElement);
        }

        MessageInstance message = null;

        Operation operation = operationMap.get(operationRef);
        try {
            if (ioSpecification != null) {
                initializeIoSpecification(ioSpecification, execution, bpmnModel);
                if (ioSpecification.getDataInputRefs().size() > 0) {
                    String firstDataInputName = ioSpecification.getDataInputRefs().get(0);
                    ItemInstance inputItem = (ItemInstance) execution.getTransientVariable(firstDataInputName);
                    message = new MessageInstance(operation.getInMessage(), inputItem);
                }

            } else {
                message = operation.getInMessage().createInstance();
            }

View on GitHub (pinned to d6d39ce1c6)