Bitrix24Care

BI Builder datasets: workflows

Datasets contain information on workflows, SPA, employees, and other items. Each item has multiple datasets that automatically include both standard and custom fields. Use these datasets to create charts and analyze business performance indicators.

In this article, we'll explore datasets for workflows, how to blend them, and how to create charts.

Datasets:

Examples:


Datasets

To start analyzing data on a dashboard, select a dataset and create a chart based on it.

Workflow assignments — bizproc_task: Provides information on workflow assignments, such as their names, types, statuses, and execution times. Use it in charts to track assignment completion.

Workflows

Workflow assignments — bizproc_task

Field Description Field type
ID Unique key Number
CODE_ID Assignment type ID String
CODE_NAME Assignment type name String
CODE type String
WORKFLOW_ID Workflow ID and parent workflow ID String
NAME Assignment name String
CREATED_DATE Date and time assignment was created Date
MODIFIED Date and time assignment was modified Date
DURATION Workflow execution time in seconds Number
APPROVE_TYPE Assignment approval type ID String
APPROVE_TYPE_NAME Assignment approval type name String
STATUS_ID Status ID Number
STATUS_NAME Assignment status name String
STATUS Assignment status ID and name String
USER_ID Assignment participant ID Number
USER_NAME Assignment participant name String
USER Assignment participant ID and name String

Workflow — bizproc_workflow_state: Includes information on active workflows, such as their statuses, execution times, and details about the users who started or edited them. Use it in charts to track start times and workflow progress.

Workflow — bizproc_workflow_state

Field Description Field type
ID Unique key String
STARTED_BY_ID ID of the user who started the workflow Number
STARTED_BY_NAME Name of the user who started the workflow String
STARTED_BY ID and name of the user who started the workflow String
STARTED Start date and time Date
COMPLETED Completion status, "Y" - completed, "N" - running String
DOCUMENT_ID Workflow element ID String
DURATION Workflow execution time in seconds Number
START_DURATION Time spent on getting the workflow to start Number
WORKFLOW_TEMPLATE_ID Template ID Number
WORKFLOW_TEMPLATE_NAME Template name String
MODULE_ID Module ID String
MODULE_ID_NAME Module name String
ENTITY_ID Entity type ID String
ENTITY_ID_NAME Entity type name String
MODIFIED_BY_ID ID of the user who last updated the template Number
MODIFIED_BY_NAME Name of the user who last updated the template String
MODIFIED_BY ID and name of the user who last updated the template String

How to create a chart

Use datasets to create charts and track workflow execution. The charts can show active workflows and their stages.

Go to the BI Builder and follow these steps:

  1. Open the Charts tab.
  2. Click + Chart.
  3. Select the dataset from the list. If you don't see the one you need, click Add a dataset to create a new one.
    How to create a dataset
  4. Choose a format for showing the data: big number, table, line chart, or others.
  5. Click Create new chart.

How to blend datasets

Combine datasets to include information about pending workflow assignments and their stages in the report.

Go to the BI Builder and do the following:

  1. Go to SQL > SQL Lab.
  2. Select the bitrix24 scheme.
  3. Enter the SQL query and click Run.

The new set includes information from the fields that you specified in the SQL query. You can save it as a dataset to create a chart for the dashboard.
Create a chart based on a virtual dataset

If you're blending datasets for the first time, refer to the sample query.

Example of an SQL query

Here's an SQL query to extract data from two datasets: workflow assignments (bizproc_task) and workflow (bizproc_workflow_state). You can copy it and see how it works. The query selects pending workflow assignments and shows their IDs, names, statuses, and participant names.

SELECT
    bizproc_task.ID AS "Assignment ID",
    bizproc_task.NAME AS "Assignment name",
    bizproc_task.USER_NAME AS "Assignment participant name",
    bizproc_task.STATUS_NAME AS "Assignment status",
    bizproc_workflow_state.STARTED AS "Workflow start date and time",
    bizproc_workflow_state.STARTED_BY_NAME AS "User who started the workflow"
FROM
    bizproc_task
LEFT JOIN
    bizproc_workflow_state 
    ON bizproc_task.WORKFLOW_ID = bizproc_workflow_state.ID
WHERE
    bizproc_workflow_state.COMPLETED = 'N';

SELECT: Chooses which data to extract. For example, the SELECT bizproc_task.ID AS "Assignment ID" part does the following:

  • Selects the assignment ID from the bizproc_task dataset
  • Assigns it the name Assignment ID
  • Displays the result in a separate column

FROM: Specifies the main table for the query, such as the bizproc_task table containing information about workflow assignments.

LEFT JOIN: Connects the bizproc_task and bizproc_workflow_state tables to combine their data. It links assignments to the workflows that created them. Use LEFT JOIN to display all assignments, even if there's no data on active workflows.

WHERE: Filters the query results to show only active workflows. The condition bizproc_workflow_state.COMPLETED = 'N' ensures that only active workflows are shown. To include completed workflows, remove this condition.


In brief

  • Datasets contain information on workflows, SPA, employees, and other items.

  • Each item has multiple datasets that automatically include both standard and custom fields.

  • There are two datasets for workflows: workflow assignments (bizproc_task) and workflow (bizproc_workflow_state).

  • Use these datasets to create charts and analyze business performance indicators. For example, include data on completed workflow assignments and approval times.

  • Blend datasets to combine data on pending assignments and workflow progress. To do this, write an SQL query, save the result as a dataset, and create a chart.

Was this information helpful?
Integration specialist assistance
That's not what I'm looking for
Complicated and incomprehensible text
The information is outdated
It's too short. I need more information
I don't like the way this tool works
Go to Bitrix24
Don't have an account? Create for free
Related articles
BI Builder: solving CSV file import errors Create a dataset from a CSV file in BI Builder BI Builder datasets: companies and contacts BI Builder datasets: Smart Process Automation BI Builder datasets: tasks and projects BI Builder: how to use ad account data BI Builder datasets: leads BI Builder datasets: activities, CRM stages, and CRM item links BI Builder datasets: products BI Builder datasets: deals