---
title: "Query for tasks"
method: POST
path: "/cmmn-query/tasks"
tags: ["Tasks", "Query"]
---

# Query for tasks

`POST /cmmn-query/tasks`

## Request

- Base URL: `https://developer-docs.flowable.com/cmmn-api`
- URL: `https://developer-docs.flowable.com/cmmn-api/cmmn-query/tasks`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/docs/cmmn-query/tasks/post.ts> (a function with typed inputs; its response is checked against the schema)

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of tasks (except for candidateGroupIn which is only available in this POST task query REST service), but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on task and process variables. The taskVariables and processInstanceVariables are both JSON-arrays containing objects with the format as described here.

## Request body

- TaskQueryRequest
  - `start` integer
  - `size` integer
  - `sort` string
  - `order` string
  - `taskId` string
  - `name` string
  - `nameLike` string
  - `nameLikeIgnoreCase` string
  - `description` string
  - `descriptionLike` string
  - `priority` integer
  - `minimumPriority` integer
  - `maximumPriority` integer
  - `assignee` string
  - `assigneeLike` string
  - `owner` string
  - `ownerLike` string
  - `unassigned` boolean
  - `delegationState` string
  - `candidateUser` string
  - `candidateGroup` string
  - `candidateGroupIn` string[]
  - `ignoreAssignee` boolean
  - `involvedUser` string
  - `caseInstanceId` string
  - `caseInstanceIdWithChildren` string
  - `planItemInstanceId` string
  - `propagatedStageInstanceId` string
  - `scopeId` string
  - `scopeIds` string[]
  - `withoutScopeId` boolean
  - `subScopeId` string
  - `scopeType` string
  - `caseDefinitionId` string
  - `caseDefinitionKey` string
  - `caseDefinitionKeyLike` string
  - `caseDefinitionKeyLikeIgnoreCase` string
  - `caseDefinitionKeys` string[]
  - `createdOn` string, date-time
  - `createdBefore` string, date-time
  - `createdAfter` string, date-time
  - `excludeSubTasks` boolean
  - `taskDefinitionKey` string
  - `taskDefinitionKeyLike` string
  - `dueDate` string, date-time
  - `dueBefore` string, date-time
  - `dueAfter` string, date-time
  - `withoutDueDate` boolean
  - `active` boolean
  - `includeTaskLocalVariables` boolean
  - `includeProcessVariables` boolean
  - `tenantId` string
  - `tenantIdLike` string
  - `withoutTenantId` boolean
  - `withoutProcessInstanceId` boolean
  - `candidateOrAssigned` string
  - `category` string
  - `rootScopeId` string
  - `parentScopeId` string
  - `taskVariables` QueryVariable[]
    - `name` string
    - `operation` 'equals' | 'notEquals' | 'equalsIgnoreCase' | 'notEqualsIgnoreCase' | 'like' | 'likeIgnoreCase' | 'greaterThan' | 'greaterThanOrEquals' | 'lessThan' | 'lessThanOrEquals' | 'exists' | 'notExists'
    - `value` object
    - `type` string
  - `categoryIn` string[]
  - `categoryNotIn` string[]
  - `withoutCategory` boolean

## Response `200`

Indicates request was successful and the tasks are returned.

- DataResponseTaskResponse
  - `data` TaskResponse[]
    - `id` string
    - `url` string
    - `owner` string
    - `assignee` string
    - `delegationState` string: Delegation-state of the task, can be null, "pending" or "resolved".
    - `name` string
    - `description` string
    - `createTime` string, date-time
    - `dueDate` string, date-time
    - `priority` integer
    - `suspended` boolean
    - `claimTime` string
    - `taskDefinitionKey` string
    - `scopeDefinitionId` string
    - `scopeId` string
    - `subScopeId` string
    - `scopeType` string
    - `propagatedStageInstanceId` string
    - `tenantId` string
    - `category` string
    - `formKey` string
    - `caseInstanceId` string
    - `caseInstanceUrl` string
    - `caseDefinitionId` string
    - `caseDefinitionUrl` string
    - `parentTaskId` string
    - `parentTaskUrl` string
    - `executionId` string
    - `processInstanceId` string
    - `processDefinitionId` string
    - `variables` RestVariable[]
      - `name` string: Name of the variable
      - `type` string: Type of the variable.
      - `value` object: Value of the variable.
      - `valueUrl` string
      - `scope` string
  - `total` integer
  - `start` integer
  - `sort` string
  - `order` string
  - `size` integer

## Other responses

- `400`: Indicates a parameter was passed in the wrong format or that delegationState has an invalid value (other than pending and resolved). The status-message contains additional information.

---

[API](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api.md) - [All operations](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/revisions/afdfa1fcacd0?raw)
