Read FAQ
NEW
Bitrix24 Support
Registration and Authentication
How to start
My Profile
Feed
Chats and Calls
Calendar
Bitrix24.Docs
Bitrix24.Drive
Bitrix24.Mail
Workgroups
Tasks and Projects
CRM
CoPilot - AI in Bitrix24
Contact Center
Sales Center
CRM Analytics (beta)
BI Builder
Sales Intelligence
Inventory Management
Marketing
Sites
Online Store (beta)
CRM + Online Store
CRM Store (beta)
Bitrix24.Sign
Company
Knowledge base (beta)
Automation
Workflows
Telephony
Market
Subscription
Settings
Enterprise
Mobile App
Desktop App
General questions
Bitrix24 On-Premise

Bitrix24Care

Actions: Flow Control

Flow Control in business processes - this group contains managing structures.

Wait for Event

This action’s execution depends on the users. A specific control element will be created for them. The command interrupts a business process pending the user’s action.

We recommend using the User notification function before the command. Users will see that their action is required to proceed with the execution of the business process.

Action Parameters

The event can be sent by – permits limiting a circle of users for whom this command is available.


Let's consider a short example of using this action.

In this example, having performed the action block, the business process will stop and wait for the user to decide which branch the events will follow.

You should open the created element (all business processes and their elements are in Automation > Workflows in Feed section) and select the command in the Business processes tab.

Condition

The structure permits you to direct a business process according to different scenarios depending on preset conditions.


Condition Type – Element Field

This action branch of the condition will be executed if the parameters related to the element fields coincide.


Condition Type – Variable Value

This action branch of the condition will be executed if the parameters related to business process variables coincide. The values of both variables and template parameters can be used in this type.


Condition Type – Mixed

You can specify a condition for different sources with the help of this action branch. Thus, there is no need to create separate action branches to check each condition.

For example, you can select variables, element fields, or constants and specify the conditions for them.


Condition Type – True

This action branch will be executed immediately. This condition is always met. This condition type comes in handy if none of the other conditions is met.

The conditions are checked from left to right. It is recommended to make such a condition branch the right-most one.


Condition Type – PHP Code
This type is available in Bitrix24 Self-Hosted version only.

The code is indicated as a condition.

If the indicated PHP code returns the value true, the branch of actions below such a condition will be executed; if false is returned, the next condition will be checked.

Note: Only a user with administrator’s rights can set a PHP code.

Attention! Only a PHP code can be used for this type of condition. The parameters of the type {=Variable:Variable2_printable} are not supported.

The code executed in the condition must also result in a logical expression (true or false).


Condition Type – Modified Document Fields
This type is available in Bitrix24 Self-Hosted version only.

If the business process is autorun when changed, there is an option to check the field changes of the element. The action branch will be executed if you enter some modifications in a field.

You can use this condition type only after additional configuration of the module.
How to set up the Modified Document Fields condition type (for developers)

To use this condition type, you need to apply the settings on the module side. When starting a business process, it is required to pass an array of the modified fields using the parameter CBPDocument::PARAM_MODIFIED_DOCUMENT_FIELDS:

CBPDocument::StartWorkflow( $arDocumentState["TEMPLATE_ID"], BizProcDocument::getDocumentComplexId($arParams["IBLOCK_TYPE_ID"], $arResult["ELEMENT_ID"]), array_merge($arBizProcParametersValues[$arDocumentState["TEMPLATE_ID"]], array( CBPDocument::PARAM_TAGRET_USER => "user_".intval($GLOBALS["USER"]->GetID()), CBPDocument::PARAM_MODIFIED_DOCUMENT_FIELDS => $modifiedFields )), $arErrorsTmp ); 

Also, you need to implement support for this condition type in a document to see it in the business process editor:

 public static function isFeatureEnabled($documentType, $feature) { return in_array($feature, array(\CBPDocumentService::FEATURE_MARK_MODIFIED_FIELDS)); } 

Attention! If no condition is met, the business process will continue executing the actions located under the Condition structure. In other words, it will 'skip' the structure.

Listening for Parallel Event

This structure permits you to direct a business process according to different scenarios depending on which event occurs earlier.

To choose the action branch, this structure must use the actions Wait for Event or Pause Execution first.

In other words, the action that occurs earlier in any branch will result in the execution of the chain below such an action.

This action Pause Execution permits you to resume a business process at a certain time in case no command is executed. Otherwise, the business process will just stop and wait for the execution of any command inside the structure.

Parallel Execution

This action runs the simultaneous execution of multiple action branches. If one of the action branches is not executed in the Parallel Execution structure, the business process will stop until its execution.

Set Status

This action permits you to change the status of a business process.

This action is available solely for business processes with statuses.

Also, this action has the Abort current status option. It immediately moves an element to the specified status without waiting for the completion of the previous one.

Iterator

This action enumerates values of multiple-value sources. You can create a cycle of actions that will be executed for each value one by one.

Select a multiple-value variable, element field, or constant in Activity parameters:

After that, you can arrange the execution of the set of similar actions for all the selected values entered in the field or variable.

For example, you have a variable with the Link to Employee type. It contains a list of users in your account. You need to create a task for each of these users sequentially. To do it, select the variable with the employees list in the Iterator parameters and add the Create task action to the construction.

To use each time the next value of the multiple-value variable in the cycle, insert the Value item from the Additional Results of Iterator.

While Loop

Do not use the 'Email message' function when testing the loop.

If there is an error and the process repeats endlessly in the loop, the action will be executed 1'000 times and 1'000 emails will be sent from your account. There will be no way to stop the sending in this case.

Make sure that the While Loop structure works properly, then use it to send emails.

The structure executes its subactions so far as a given condition is met.

In other words, the cycle works so far as the condition is valid (true), otherwise (false) the loop is terminated.


Condition Type – Element Field

The loop will continue operating so long as the parameters related to the element fields coincide.


Condition Type – Variable Value

The loop will continue operating so far as parameters related to variables of the business process coincide.

The values of both variables and template parameters can be used in this type.

Condition Type – Mixed

You can specify a condition for different sources with the help of this action branch. Thus, there is no need to create separate action branches to check each condition.

For example, you can select variables, element fields, or constants and specify the conditions for them.


Condition Type – PHP Code
This type is available in Bitrix24 Self-Hosted version only.

Code is indicated as a condition.

If the indicated PHP code returns the value true, the loop will continue operating; if false is returned, the loop will be terminated.

Only a user with administrator’s rights can set the PHP code.

Condition Type – True

In this case, the loop will always be executed.

For Bitrix24 Cloud users, the loop will be repeated for a maximum of 1'000 times.
Please note that all consultations and assistance with business process setup are provided exclusively by local Bitrix24 partners.
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