flowable/flowable-engine · error · FlowableObjectNotFoundException

Task '' does not have an event with id ''.

Error message

Task '' does not have an event with id ''.

What it means

GET /runtime/tasks/{taskId}/events/{eventId} throws FlowableObjectNotFoundException when the event id does not exist or the event's taskId does not match the requested task. Events are engine-generated task lifecycle records (assignment, creation, etc.).

Solutions

  1. Fetch valid event ids via GET /runtime/tasks/{taskId}/events first
  2. Verify the eventId belongs to the same taskId used in the path
  3. Check that history/event cleanup jobs have not purged the event
Defensive patterns

Strategy: try-catch

Validate before calling

const events = await get(`/runtime/tasks/${taskId}/events`);
if (!events.some(ev => ev.id === eventId)) return null;

Try / catch

try { ... } catch (e) { if (e.status === 404) return null; throw e; }

Prevention

When it happens

Trigger: GET /runtime/tasks/{taskId}/events/{eventId} with an unknown eventId or an event belonging to another task.

Common situations: Using an event id from a different task or process; event purged by history cleanup; typos in ids copied from logs.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/task/TaskEventResource.java:54

 * @author Frederik Heremans
 */
@RestController
@Api(tags = { "Tasks" }, authorizations = { @Authorization(value = "basicAuth") })
public class TaskEventResource extends TaskBaseResource {

    @ApiOperation(value = "Get an event on a task", tags = { "Tasks" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the task and event were found and the event is returned."),
            @ApiResponse(code = 404, message = "Indicates the requested task was not found or the tasks does not have an event with the given ID.")
    })
    @GetMapping(value = "/runtime/tasks/{taskId}/events/{eventId}", produces = "application/json")
    public EventResponse getEvent(@ApiParam(name = "taskId") @PathVariable("taskId") String taskId, @ApiParam(name = "eventId") @PathVariable("eventId") String eventId) {

        HistoricTaskInstance task = getHistoricTaskFromRequest(taskId);

        Event event = taskService.getEvent(eventId);
        if (event == null || !task.getId().equals(event.getTaskId())) {
            throw new FlowableObjectNotFoundException("Task '" + task.getId() + "' does not have an event with id '" + eventId + "'.", Event.class);
        }

        return restResponseFactory.createEventResponse(event);
    }

    @ApiOperation(value = "Delete an event on a task", tags = { "Tasks" }, code = 204)
    @ApiResponses(value = {
            @ApiResponse(code = 204, message = "Indicates the task was found and the events are returned."),
            @ApiResponse(code = 404, message = "Indicates the requested task was not found or the task does not have the requested event.")
    })
    @DeleteMapping(value = "/runtime/tasks/{taskId}/events/{eventId}")
    @ResponseStatus(HttpStatus.NO_CONTENT)
    public void deleteEvent(@ApiParam(name = "taskId") @PathVariable("taskId") String taskId, @ApiParam(name = "eventId") @PathVariable("eventId") String eventId) {

        // Check if task exists
        Task task = getTaskFromRequestWithoutAccessCheck(taskId);

        Event event = taskService.getEvent(eventId);

View on GitHub (pinned to d6d39ce1c6)