diff --git a/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/history-process-instance.ftl b/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/history-process-instance.ftl
index d5532b1cf92..548f00d4644 100644
--- a/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/history-process-instance.ftl
+++ b/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/history-process-instance.ftl
@@ -240,7 +240,7 @@
"activityIdIn": {
"type": "array",
"itemType": "string",
- "desc": "Restrict to instances with an active activity with one of the given ids. This filter behaves differently as `activeActivityIdIn` since it also yields results when filtering for activities with an incident. ${listTypeDescription}"
+ "desc": "Restrict to instances with an active activity with one of the given ids. In contrast to the `activeActivityIdIn` filter, it can query for async and incident activities. ${listTypeDescription}"
},
"executedActivityIdIn": {
diff --git a/engine/src/main/java/org/camunda/bpm/engine/history/HistoricProcessInstanceQuery.java b/engine/src/main/java/org/camunda/bpm/engine/history/HistoricProcessInstanceQuery.java
index 46fa51c951c..6cef89483c4 100644
--- a/engine/src/main/java/org/camunda/bpm/engine/history/HistoricProcessInstanceQuery.java
+++ b/engine/src/main/java/org/camunda/bpm/engine/history/HistoricProcessInstanceQuery.java
@@ -441,7 +441,8 @@ public interface HistoricProcessInstanceQuery extends Query
-
+
@@ -414,12 +414,12 @@
-
+
-
+
@@ -430,9 +430,8 @@
LEFT JOIN ${prefix}ACT_HI_ACTINST HAI
ON HAI.PROC_INST_ID_ = SELF.ID_
-
-
- LEFT JOIN ${prefix}ACT_HI_INCIDENT INCACT on SELF.PROC_INST_ID_ = INCACT.PROC_INST_ID_
+
+ LEFT JOIN ${prefix}ACT_RU_EXECUTION EXE on SELF.PROC_INST_ID_ = EXE.PROC_INST_ID_