{"record":{"id":"64fbf40b9923c72f","repo":"flowable/flowable-engine","slug":"could-not-find-activity-activity-for-processid","errorCode":null,"errorMessage":"Could not find activity ${activity} for processId ${processInstanceId} in defined timeout of ${timeout} ms.","messagePattern":"Could not find activity (.+?) for processId (.+?) in defined timeout of (.+?) ms\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-camel/src/main/java/org/flowable/camel/FlowableProducer.java","lineNumber":147,"sourceCode":"                execution = runtimeService.createExecutionQuery()\n                        .executionId(executionId)\n                        .activityId(activity)\n                        .singleResult();\n\n            } else {\n                execution = runtimeService.createExecutionQuery()\n                        .processDefinitionKey(processKey)\n                        .processInstanceId(processInstanceId)\n                        .activityId(activity)\n                        .singleResult();\n            }\n\n            if (execution != null) {\n                break;\n            }\n        }\n        if (execution == null) {\n            throw new FlowableException(\"Could not find activity \" + activity + \" for processId \" + processInstanceId +\n                    \" in defined timeout of \" + timeout + \" ms.\");\n        }\n\n        runtimeService.setVariables(execution.getId(), ExchangeUtils.prepareVariables(exchange, getFlowableEndpoint()));\n        runtimeService.trigger(execution.getId());\n    }\n\n    protected String findProcessInstanceId(Exchange exchange) {\n        String processInstanceId = exchange.getProperty(PROCESS_ID_PROPERTY, String.class);\n        if (processInstanceId != null) {\n            return processInstanceId;\n        }\n        String key = exchange.getProperty(PROCESS_KEY_PROPERTY, String.class);\n        ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(key).singleResult();\n\n        if (processInstance == null) {\n            throw new FlowableException(\"Could not start process instance with business key \" + key);\n        }","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-camel/src/main/java/org/flowable/camel/FlowableProducer.java#L129-L165","documentation":"FlowableProducer.signal waits for the process execution to arrive at the expected activity within a configurable timeout (default via endpoint's timeout/timeResolution). If after the timeout no execution is found at that activity, Flowable throws this FlowableException rather than triggering an execution that does not exist.","triggerScenarios":"Calling a synchronous flowable: endpoint (FlowableProducer.process) where the target process does not reach the expected wait-state activity within the configured timeout: process path never reaches the activity, process instance already ended, wrong activity name, or the process is still busy in another service task.","commonSituations":"Process definition changed so the activity name in the camel URI no longer exists; process instance terminated/aborted while waiting; polling loops too short relative to async jobs needing job executor execution; job executor disabled so async steps never advance.","solutions":["Increase the endpoint timeout (e.g. flowable:key:activity?timeout=30000 or dataFlowableEndpoint timeout property) so slow/async process paths can complete.","Verify the process actually reaches the expected activity: check the activity name in the camel URI matches the BPMN wait-state (receiveTask/userTask) id.","Ensure the Flowable job executor is enabled and running so async continuations move the process forward.","Check process history/logs to confirm the process instance is still running and its path reaches the activity."],"exampleFix":"// before\nfrom(\"direct:start\").to(\"flowable:myProcess:waitState?timeout=2000\");\n// after\nfrom(\"direct:start\").to(\"flowable:myProcess:waitState?timeout=60000\");","handlingStrategy":"try-catch","validationCode":"// verify the wait state exists in the deployed definition\nProcessDefinition def = repositoryService.createProcessDefinitionQuery()\n    .processDefinitionKey(\"myProcess\").latestVersion().singleResult();\nif (def == null) throw new IllegalStateException(\"Process not deployed\");\n// increase timeout if async steps are involved","typeGuard":null,"tryCatchPattern":"try {\n    producer.process(exchange);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"Could not find activity\")) {\n        // retry with larger timeout or inspect process state via runtimeService\n    }\n    throw e;\n}","preventionTips":["Match the activity name in the camel URI to the BPMN wait-state id exactly.","Enable and size the Flowable job executor for async continuations.","Set timeouts generously relative to expected process latency.","Monitor process instances that stall before the expected activity."],"tags":["camel","flowable","timeout","wait-state"],"backgroundTag":"request-timeout","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}