{"record":{"id":"325ee60a77a52c14","repo":"flowable/flowable-engine","slug":"process-name-has-no-default-start-activity-e","errorCode":null,"errorMessage":"Process '${name}' has no default start activity (e.g. none start event), hence you cannot use 'startProcessInstanceBy...' but have to start it using one of the modeled start events (e.g. message start events).","messagePattern":"Process '(.+?)' has no default start activity \\(e\\.g\\. none start event\\), hence you cannot use 'startProcessInstanceBy\\.\\.\\.' but have to start it using one of the modeled start events \\(e\\.g\\. message start events\\)\\.","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/process/ProcessDefinitionImpl.java","lineNumber":50,"sourceCode":"    private static final long serialVersionUID = 1L;\n\n    protected String name;\n    protected String key;\n    protected String description;\n    protected ActivityImpl initial;\n    protected Map<ActivityImpl, List<ActivityImpl>> initialActivityStacks = new HashMap<>();\n    protected List<LaneSet> laneSets;\n    protected ParticipantProcess participantProcess;\n\n    public ProcessDefinitionImpl(String id) {\n        super(id, null);\n        processDefinition = this;\n    }\n\n    @Override\n    public PvmProcessInstance createProcessInstance() {\n        if (initial == null) {\n            throw new ActivitiException(\n                    \"Process '\" + name + \"' has no default start activity (e.g. none start event), hence you cannot use 'startProcessInstanceBy...' but have to start it using one of the modeled start events (e.g. message start events).\");\n        }\n        return createProcessInstanceForInitial(initial);\n    }\n\n    /**\n     * creates a process instance using the provided activity as initial\n     */\n    public PvmProcessInstance createProcessInstanceForInitial(ActivityImpl initial) {\n\n        if (initial == null) {\n            throw new ActivitiException(\"Cannot start process instance, initial activity where the process instance should start is null.\");\n        }\n\n        InterpretableExecution processInstance = newProcessInstance(initial);\n        processInstance.setProcessDefinition(this);\n        processInstance.setProcessInstance(processInstance);\n        processInstance.initialize();","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/process/ProcessDefinitionImpl.java#L32-L68","documentation":"ActivitiException thrown by ProcessDefinitionImpl.createProcessInstance when the process definition has no 'initial' start activity. Processes modeled only with non-none start events (message, signal, timer) have no default start, so startProcessInstanceBy... cannot be used. The engine points the caller at starting via the modeled start events instead.","triggerScenarios":"Calling startProcessInstanceByKey/Id (which invokes createProcessInstance()) on a deployed process whose model contains no none start event.","commonSituations":"BPMN processes that begin only with a message/timer/signal start event, and someone tries to start them with RuntimeService.startProcessInstanceByKey(...).","solutions":["Start the process with the appropriate API: e.g. RuntimeService.startProcessInstanceByMessage(...) for a message start event, or wait for the timer/signal.","Add a none start event to the BPMN model if API-started instances are desired.","Deploy/choose a process version that has a none start event."],"exampleFix":"// before\nruntimeService.startProcessInstanceByKey(\"orderProcess\"); // only message start event\n// after\nruntimeService.startProcessInstanceByMessage(\"newOrderMessage\", businessKey, variables);","handlingStrategy":"validation","validationCode":"org.flowable.engine.RepositoryService rs = ...;\nProcessDefinition pd = rs.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult();\nBpmnModel model = rs.getBpmnModel(pd.getId());\nProcess proc = model.getMainProcess();\nboolean hasNoneStart = proc.findFlowElementsOfType(StartEvent.class).stream()\n    .anyMatch(se -> se.getEventDefinitions().isEmpty());\nif (!hasNoneStart) {\n  // start via message/signal/timer API instead of startProcessInstanceByKey\n}","typeGuard":null,"tryCatchPattern":"try {\n  runtimeService.startProcessInstanceByKey(key, businessKey, vars);\n} catch (ActivitiException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"no default start activity\")) {\n    // fall back to the modeled message start\n    runtimeService.startProcessInstanceByMessage(startMessageName, businessKey, vars);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Check start-event definitions in the BPMN before choosing the start API.","Document per-process how instances are meant to be started.","Prefer adding a none start event when API-started instances are required."],"tags":["java","pvm","process-instance","start-event"],"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"}