Get a List of Workflow Tasks bizproc.task.list

Scope: bizproc

Who can execute the method: any user

The method bizproc.task.list retrieves a list of workflow tasks.

A portal administrator can request all tasks or tasks for any user. A regular user can only request their own tasks or those of their subordinate.

When requesting their own tasks, the USER_ID filter does not need to be specified.

In cloud Bitrix24, information about tasks is available for 24 hours after the workflow is completed.

Method Parameters

Required parameters are marked with *

Name
type

Description

SELECT
array

An array containing a list of fields to select.

You can specify only the fields that are necessary.

By default, it returns the fields ENTITY, DOCUMENT_ID, ID, WORKFLOW_ID, DOCUMENT_NAME, NAME, DOCUMENT_URL

FILTER
object

An object for filtering the list of tasks in the format {"field_1": "value_1", ... "field_N": "value_N"}, where

  • field_Nfield of the task for filtering
  • value_N — value of the field

If USER_ID is present in the filter, user subordination is checked:

  • a manager can request a list of tasks for their subordinates
  • an administrator can request tasks for any users without restrictions

If the method is called by a non-administrator and the USER_ID filter is not specified, it defaults to selecting tasks for the current user

ORDER
object

An object for sorting the list of tasks in the format {"field_1": "value_1", ... "field_N": "value_N"}, where

  • field_Nfield of the task for sorting
  • value_N — sorting direction

The sorting direction can take the following values:

  • asc — ascending
  • desc — descending

You can specify multiple fields for sorting, for example, {NAME: 'ASC', ID: 'DESC'}

START
integer

This parameter is used for managing pagination.

The page size of results is always static — 50 records.

To select the second page of results, you need to pass the value 50. To select the third page of results — the value 100, and so on.

The formula for calculating the start parameter value:

start = (N - 1) * 50, where N — the desired page number

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"select":["ID","WORKFLOW_ID","DOCUMENT_NAME","DESCRIPTION","NAME","MODIFIED","WORKFLOW_STARTED","WORKFLOW_STARTED_BY","OVERDUE_DATE","WORKFLOW_TEMPLATE_ID","WORKFLOW_TEMPLATE_NAME","WORKFLOW_STATE","STATUS","USER_ID","USER_STATUS","MODULE_ID","ENTITY","DOCUMENT_ID","ACTIVITY","ACTIVITY_NAME","DOCUMENT_URL","PARAMETERS"],"order":{"ID":"DESC"},"filter":{"USER_ID":1,"STATUS":0,"ACTIVITY":"RequestInformationOptionalActivity"}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/bizproc.task.list
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"select":["ID","WORKFLOW_ID","DOCUMENT_NAME","DESCRIPTION","NAME","MODIFIED","WORKFLOW_STARTED","WORKFLOW_STARTED_BY","OVERDUE_DATE","WORKFLOW_TEMPLATE_ID","WORKFLOW_TEMPLATE_NAME","WORKFLOW_STATE","STATUS","USER_ID","USER_STATUS","MODULE_ID","ENTITY","DOCUMENT_ID","ACTIVITY","ACTIVITY_NAME","DOCUMENT_URL","PARAMETERS"],"order":{"ID":"DESC"},"filter":{"USER_ID":1,"STATUS":0,"ACTIVITY":"RequestInformationOptionalActivity"},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/bizproc.task.list
        
// callListMethod: Retrieves all data at once. Use only for small selections (< 1000 items) due to high memory load.
        
        const parameters = {
            select: [
                'ID',
                'WORKFLOW_ID',
                'DOCUMENT_NAME',
                'DESCRIPTION',
                'NAME',
                'MODIFIED',
                'WORKFLOW_STARTED',
                'WORKFLOW_STARTED_BY',
                'OVERDUE_DATE',
                'WORKFLOW_TEMPLATE_ID',
                'WORKFLOW_TEMPLATE_NAME',
                'WORKFLOW_STATE',
                'STATUS',
                'USER_ID',
                'USER_STATUS',
                'MODULE_ID',
                'ENTITY',
                'DOCUMENT_ID',
                'ACTIVITY',
                'ACTIVITY_NAME',
                'DOCUMENT_URL',
                'PARAMETERS'
            ],
            order: {
                ID: 'DESC'
            },
            filter: {
                'USER_ID': 1,
                'STATUS': 0,
                'ACTIVITY': 'RequestInformationOptionalActivity'
            }
        };
        
        try {
            const response = await $b24.callListMethod('bizproc.task.list', parameters);
            const items = response.getData() || [];
            for (const entity of items) { console.log('Entity:', entity); }
        } catch (error) {
            console.error('Request failed', error);
        }
        
        // fetchListMethod: Retrieves data in parts using an iterator. Use for large volumes of data for efficient memory consumption.
        
        const parameters = {
            select: [
                'ID',
                'WORKFLOW_ID',
                'DOCUMENT_NAME',
                'DESCRIPTION',
                'NAME',
                'MODIFIED',
                'WORKFLOW_STARTED',
                'WORKFLOW_STARTED_BY',
                'OVERDUE_DATE',
                'WORKFLOW_TEMPLATE_ID',
                'WORKFLOW_TEMPLATE_NAME',
                'WORKFLOW_STATE',
                'STATUS',
                'USER_ID',
                'USER_STATUS',
                'MODULE_ID',
                'ENTITY',
                'DOCUMENT_ID',
                'ACTIVITY',
                'ACTIVITY_NAME',
                'DOCUMENT_URL',
                'PARAMETERS'
            ],
            order: {
                ID: 'DESC'
            },
            filter: {
                'USER_ID': 1,
                'STATUS': 0,
                'ACTIVITY': 'RequestInformationOptionalActivity'
            }
        };
        
        try {
            const generator = $b24.fetchListMethod('bizproc.task.list', parameters, 'ID');
            for await (const page of generator) {
                for (const entity of page) { console.log('Entity:', entity); }
            }
        } catch (error) {
            console.error('Request failed', error);
        }
        
        // callMethod: Manual control of pagination through the start parameter. Use for precise control over request batches. Less efficient for large data than fetchListMethod.
        
        const parameters = {
            select: [
                'ID',
                'WORKFLOW_ID',
                'DOCUMENT_NAME',
                'DESCRIPTION',
                'NAME',
                'MODIFIED',
                'WORKFLOW_STARTED',
                'WORKFLOW_STARTED_BY',
                'OVERDUE_DATE',
                'WORKFLOW_TEMPLATE_ID',
                'WORKFLOW_TEMPLATE_NAME',
                'WORKFLOW_STATE',
                'STATUS',
                'USER_ID',
                'USER_STATUS',
                'MODULE_ID',
                'ENTITY',
                'DOCUMENT_ID',
                'ACTIVITY',
                'ACTIVITY_NAME',
                'DOCUMENT_URL',
                'PARAMETERS'
            ],
            order: {
                ID: 'DESC'
            },
            filter: {
                'USER_ID': 1,
                'STATUS': 0,
                'ACTIVITY': 'RequestInformationOptionalActivity'
            }
        };
        
        try {
            const response = await $b24.callMethod('bizproc.task.list', parameters, 0);
            const result = response.getData().result || [];
            for (const entity of result) { console.log('Entity:', entity); }
        } catch (error) {
            console.error('Request failed', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'bizproc.task.list',
                    [
                        'select' => [
                            'ID',
                            'WORKFLOW_ID',
                            'DOCUMENT_NAME',
                            'DESCRIPTION',
                            'NAME',
                            'MODIFIED',
                            'WORKFLOW_STARTED',
                            'WORKFLOW_STARTED_BY',
                            'OVERDUE_DATE',
                            'WORKFLOW_TEMPLATE_ID',
                            'WORKFLOW_TEMPLATE_NAME',
                            'WORKFLOW_STATE',
                            'STATUS',
                            'USER_ID',
                            'USER_STATUS',
                            'MODULE_ID',
                            'ENTITY',
                            'DOCUMENT_ID',
                            'ACTIVITY',
                            'ACTIVITY_NAME',
                            'DOCUMENT_URL',
                            'PARAMETERS'
                        ],
                        'order' => [
                            'ID' => 'DESC'
                        ],
                        'filter' => [
                            'USER_ID'  => 1,
                            'STATUS'   => 0,
                            'ACTIVITY' => 'RequestInformationOptionalActivity'
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                echo 'Error: ' . $result->error();
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'bizproc.task.list',
            {
                select: [
                    'ID',
                    'WORKFLOW_ID',
                    'DOCUMENT_NAME',
                    'DESCRIPTION',
                    'NAME',
                    'MODIFIED',
                    'WORKFLOW_STARTED',
                    'WORKFLOW_STARTED_BY',
                    'OVERDUE_DATE',
                    'WORKFLOW_TEMPLATE_ID',
                    'WORKFLOW_TEMPLATE_NAME',
                    'WORKFLOW_STATE',
                    'STATUS',
                    'USER_ID',
                    'USER_STATUS',
                    'MODULE_ID',
                    'ENTITY',
                    'DOCUMENT_ID',
                    'ACTIVITY',
                    'ACTIVITY_NAME',
                    'DOCUMENT_URL',
                    'PARAMETERS'
                ],
                order: {
                    ID: 'DESC'
                },
                filter: {
                    'USER_ID': 1,
                    'STATUS': 0,
                    'ACTIVITY': 'RequestInformationOptionalActivity'
                }
            },
            function(result)
            {
                if(result.error())
                    alert("Error: " + result.error());
                else
                    console.log(result.data());
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'bizproc.task.list',
            [
                'select' => [
                    'ID',
                    'WORKFLOW_ID',
                    'DOCUMENT_NAME',
                    'DESCRIPTION',
                    'NAME',
                    'MODIFIED',
                    'WORKFLOW_STARTED',
                    'WORKFLOW_STARTED_BY',
                    'OVERDUE_DATE',
                    'WORKFLOW_TEMPLATE_ID',
                    'WORKFLOW_TEMPLATE_NAME',
                    'WORKFLOW_STATE',
                    'STATUS',
                    'USER_ID',
                    'USER_STATUS',
                    'MODULE_ID',
                    'ENTITY',
                    'DOCUMENT_ID',
                    'ACTIVITY',
                    'ACTIVITY_NAME',
                    'DOCUMENT_URL',
                    'PARAMETERS'
                ],
                'order' => [
                    'ID' => 'DESC'
                ],
                'filter' => [
                    'USER_ID' => 1,
                    'STATUS' => 0,
                    'ACTIVITY' => 'RequestInformationOptionalActivity'
                ]
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        

Response Handling

HTTP Status: 200

{
            "result": [
                {
                    "ENTITY": "BizprocDocument",
                    "DOCUMENT_ID": "2249",
                    "ID": "1477",
                    "WORKFLOW_ID": "67a2ffdb2c57a3.35276854",
                    "DOCUMENT_NAME": "Partner Conference",
                    "DESCRIPTION": "",
                    "NAME": "Add Contractor Information",
                    "MODIFIED": "2025-02-05T09:06:19+01:00",
                    "WORKFLOW_STARTED": "2025-02-05T09:06:19+01:00",
                    "WORKFLOW_STARTED_BY": "1",
                    "OVERDUE_DATE": null,
                    "WORKFLOW_TEMPLATE_ID": "565",
                    "WORKFLOW_TEMPLATE_NAME": "Event Organization",
                    "WORKFLOW_STATE": "Waiting for Additional Information",
                    "STATUS": "0",
                    "USER_ID": "1",
                    "USER_STATUS": "0",
                    "MODULE_ID": "lists",
                    "ACTIVITY": "RequestInformationActivity",
                    "ACTIVITY_NAME": "A3651_68033_56029_16413",
                    "PARAMETERS": {
                        "CommentLabel": "Comment",
                        "CommentRequired": "Y",
                        "ShowComment": "Y",
                        "StatusOkLabel": "Save Result",
                        "Fields": [
                            {
                                "Id": "contractor",
                                "Type": "E:ECrm",
                                "Name": "Contractor",
                                "Description": "Who performs the work",
                                "Multiple": false,
                                "Required": true,
                                "Options": {
                                    "LEAD": "N",
                                    "CONTACT": "Y",
                                    "COMPANY": "Y",
                                    "DEAL": "N",
                                    "SMART_INVOICE": "N",
                                    "DYNAMIC_136": "N",
                                    "DYNAMIC_1038": "N"
                                },
                                "Settings": null,
                                "Default": [
                                    "C_607"
                                ]
                            },
                            {
                                "Id": "phone_number",
                                "Type": "string",
                                "Name": "Phone Number",
                                "Description": "",
                                "Multiple": false,
                                "Required": true,
                                "Options": null,
                                "Settings": null,
                                "Default": ""
                            }
                        ]
                    },
                    "DOCUMENT_URL": "/bizproc/processes/?livefeed=y&list_id=171&element_id=2249"
                },
                {
                    "ENTITY": "BizprocDocument",
                    "DOCUMENT_ID": "2237",
                    "ID": "1471",
                    ...
                }
            ],
            "total": 2,
            "time": {
                "start": 1738735796.4730229,
                "finish": 1738735796.510215,
                "duration": 0.037192106246948242,
                "processing": 0.0080459117889404297,
                "date_start": "2025-02-05T09:09:56+01:00",
                "date_finish": "2025-02-05T09:09:56+01:00",
                "operating_reset_at": 1738736396,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
object

The root element of the response.

Contains an array of objects with information about workflow tasks.

Each object contains fields of the task specified in the SELECT parameter

total
integer

The total number of records found

time
time

Information about the request execution time

Task Fields

Name
type

Description

ID
integer

Task identifier

WORKFLOW_ID
integer

Workflow identifier

DOCUMENT_NAME
string

Document name

DESCRIPTION
string

Task description

NAME
string

Task name

MODIFIED
datetime

Modification date

WORKFLOW_STARTED
datatime

Workflow start date

WORKFLOW_STARTED_BY
user

Who started the workflow

OVERDUE_DATE
datetime

Deadline

WORKFLOW_TEMPLATE_ID
integer

Workflow template identifier

WORKFLOW_TEMPLATE_NAME
string

Workflow template name

WORKFLOW_STATE
string

Workflow status

STATUS
integer

Task status. Possible values:

  • 0 — in progress
  • 1 — approved
  • 2 — rejected
  • 3 — completed
  • 4 — overdue

USER_ID
user

User identifier

USER_STATUS
integer

User response. Possible values:

  • 0 — awaiting response
  • 1 — approved
  • 2 — rejected
  • 3 — completed

MODULE_ID
string

Module identifier by document

ENTITY
string

Symbolic identifier of the object by document

DOCUMENT_ID
integer

Document identifier

ACTIVITY
string

Task type identifier. Possible values:

  • ApproveActivity — document approval
  • ReviewActivity — document review
  • RequestInformationActivity — request for additional information
  • RequestInformationOptionalActivity — request for additional information (with rejection)

ACTIVITY_NAME
string

Action identifier in the template

PARAMETERS
object

An object describing the task parameters

DOCUMENT_URL
object

Link to the document

PARAMETERS Object

Name
type

Description

CommentLabel
string

Name of the Comment field

CommentRequired
string

Comment requirement. Possible values:

  • N — no
  • Y — yes
  • YA — yes, upon approval
  • YR — yes, upon rejection

ShowComment
boolean

Show comment. Possible values:

  • N — no
  • Y — yes

StatusOkLabel
string

Text for the Acknowledged button

StatusYesLabel
string

Text for the Approve button

StatusNoLabel
string

Text for the Reject button

Fields
array

An array of objects. Each object contains a description of the field in the task

Fields Object

Name
type

Description

Id
string

Symbolic identifier of the task parameter

Type
string

Parameter type. Basic values:

  • bool — yes or no
  • date — date
  • datetime — date and time
  • double — number
  • int — integer
  • select — list
  • string — string
  • text — text
  • user — user

Other types depend on the document with which the workflow operates

Name
string | object

Name of the parameter

Description
string | object

Description of the parameter

Multiple
boolean

Parameter multiplicity. Possible values:

  • true — yes
  • false — no

Required
boolean

Parameter requirement. Possible values:

  • true — yes
  • false — no

Options
object

Field settings.

Values depend on the parameter type. Examples:

  • for the List type select, these are the options of the list
"Options": {
            "1": "First Option",
            "2": "Second Option",
            "3": "Third Option",
        },
        
  • for the CRM Binding type 'E:ECrm', these are the available object types
"Options": {
            "LEAD": "N",
            "CONTACT": "Y",
            "COMPANY": "Y",
            "DEAL": "N",
            "SMART_INVOICE": "N",
            "DYNAMIC_136": "N",
            "DYNAMIC_1038": "N"
        },
        

Settings
object

Additional field settings

Default
any

Default value of the parameter

Error Handling

HTTP Status: 400

{
            "error": "ACCESS_DENIED",
            "error_description": "Access denied!"
        }
        

Name
type

Description

error
string

String error code. It may consist of digits, Latin letters, and underscores

error_description
error_description

Textual description of the error. The description is not intended to be shown to the end user in its raw form

Possible Error Codes

Code

Error Message

Description

ACCESS_DENIED

Access denied!

The method was called by a non-administrator or you cannot view the tasks of the specified employee

Statuses and System Error Codes

HTTP Status: 20x, 40x, 50x

The errors described below may occur when calling any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

An internal server error has occurred, please contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

405

ERROR_BATCH_METHOD_NOT_ALLOWED
Method is not allowed for batch usage

The current method is not allowed to be called using batch

400

ERROR_BATCH_LENGTH_EXCEEDED
Max batch length exceeded

The maximum length of parameters passed to the batch method has been exceeded

401

NO_AUTH_FOUND
Wrong authorization data

Invalid access token or webhook code

400

INVALID_REQUEST
Https required

The methods must be called using the HTTPS protocol

503

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support

403

ACCESS_DENIED
REST API is available only on commercial plans

The REST API is available only on commercial plans

403

INVALID_CREDENTIALS
Invalid request credentials

The user whose access token or webhook was used to call the method lacks permissions

404

ERROR_MANIFEST_IS_NOT_AVAILABLE
Manifest is not available

The manifest is not available

403

insufficient_scope
The request requires higher privileges than provided by the webhook token

The request requires higher privileges than those provided by the webhook token

401

expired_token
The access token provided has expired

The provided access token has expired

403

user_access_error
The user does not have access to the application

The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users

500

PORTAL_DELETED
Portal was deleted

The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site

Continue Learning