{"record":{"id":"c02eba20cbcdb0d8","repo":"flowable/flowable-engine","slug":"injection-type-is-not-supported-injectiontype","errorCode":null,"errorMessage":"injection type is not supported ${injectionType}","messagePattern":"injection type is not supported (.+?)","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceResource.java","lineNumber":316,"sourceCode":"                dynamicBpmnService.injectUserTaskInProcessInstance(processInstanceId, taskBuilder);\n            }\n        \n        } else if (\"subprocess\".equalsIgnoreCase(injectActivityRequest.getInjectionType())) {\n            if (StringUtils.isEmpty(injectActivityRequest.getProcessDefinitionId())) {\n                throw new FlowableIllegalArgumentException(\"processDefinitionId is required\");\n            }\n            DynamicEmbeddedSubProcessBuilder subProcessBuilder = new DynamicEmbeddedSubProcessBuilder();\n            subProcessBuilder.id(injectActivityRequest.getId())\n                .processDefinitionId(injectActivityRequest.getProcessDefinitionId());\n            \n            if (injectActivityRequest.getTaskId() != null) {\n                dynamicBpmnService.injectParallelEmbeddedSubProcess(injectActivityRequest.getTaskId(), subProcessBuilder);\n            } else {\n                dynamicBpmnService.injectEmbeddedSubProcessInProcessInstance(processInstanceId, subProcessBuilder);\n            }\n        \n        } else {\n            throw new FlowableIllegalArgumentException(\"injection type is not supported \" + injectActivityRequest.getInjectionType());\n        }\n    }\n\n    protected ProcessInstanceResponse activateProcessInstance(ProcessInstance processInstance) {\n        if (!processInstance.isSuspended()) {\n            throw new FlowableConflictException(\"Process instance with id '\" + processInstance.getId() + \"' is already active.\");\n        }\n        runtimeService.activateProcessInstanceById(processInstance.getId());\n\n        ProcessInstanceResponse response = restResponseFactory.createProcessInstanceResponse(processInstance);\n\n        // No need to re-fetch the instance, just alter the suspended state of the result-object\n        response.setSuspended(false);\n        return response;\n    }\n\n    protected ProcessInstanceResponse suspendProcessInstance(ProcessInstance processInstance) {\n        if (processInstance.isSuspended()) {","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceResource.java#L298-L334","documentation":"Flowable REST throws FlowableIllegalArgumentException when the injectionType in an inject-activity request is neither 'usertask' nor 'subprocess'. Only those two dynamic injection types are supported by this endpoint.","triggerScenarios":"POST /runtime/process-instances/{id}/inject-activity with {\"injectionType\":\"servicetask\"} or any value other than 'usertask'/'subprocess' (comparison is case-insensitive).","commonSituations":"Developer assumes all BPMN element types can be injected dynamically; copy-paste of 'injectionType' from other tooling; version differences in supported dynamic injection features.","solutions":["Use injectionType 'usertask' or 'subprocess' only.","For other element types, modify the process definition and redeploy instead of dynamic injection.","Consult DynamicBpmnService in your Flowable version for supported injection capabilities."],"exampleFix":"// before\n{\"injectionType\":\"servicetask\",\"id\":\"svc1\"}\n// after\n{\"injectionType\":\"usertask\",\"id\":\"userTask2\",\"name\":\"Manual step\"}","handlingStrategy":"validation","validationCode":"if (!['usertask','subprocess'].includes(injectionType.toLowerCase())) throw new Error('unsupported injectionType: ' + injectionType);","typeGuard":"const isInjectableType = (t) => ['usertask','subprocess'].includes(String(t).toLowerCase());","tryCatchPattern":null,"preventionTips":["Only use documented injection types","Redeploy the definition for other element types","Pin client code to the Flowable version's supported features"],"tags":["rest-api","unsupported-operation","dynamic-bpmn"],"backgroundTag":"unsupported-operation","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}