Bitrix24 Helpdesk

Bitrix24 has a new interface. The images in the articles might differ from the current account design. We will update them soon.

Activities: Flow Control

Wait for Event

The activity pauses a workflow execution and waits for a user to run an action.

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

The only activity parameter is The event can be sent by. Choose a circle of users who can execute this command.

Consider a short example of using this activity. Having performed the activity block, the workflow will stop and wait for the user to decide which branch the events will follow.

To execute a command,

  1. Go to Automation > Workflows.
  2. Find and open the created element.
  3. Open the Business Processes tab.
  4. Select a command next to Run Action.
  5. Click the Execute Commands button.

Condition

The structure permits you to direct a workflow to different branches depending on preset conditions.

There are different condition types:

Element Field. The activity branch of the condition will be executed if the parameters related to the element fields coincide.

Variable Value. The activity branch of the condition will be executed if the parameters related to workflow variables coincide. You can use the values of both variables and template parameters in this condition type.

Mixed. Set a condition for different sources using this activity branch. Thus, there is no need to create separate activity branches to check each condition. You can select variables, element fields, or constants and specify conditions for them.

True. The activity branch will be executed immediately, and the condition is always met. This condition type comes in handy if none of the other conditions are met.

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

PHP Code. The code is indicated as a condition.

This type is available in the Bitrix24 On-Premise version only.

The code in the condition must result in a logical expression (true or false). If the indicated PHP code returns the value true, the branch of activities below such a condition will be executed. If false is returned, the next condition will be checked.

Note:
  • Only a user with administrative rights can set a PHP code.
  • Only a PHP code can be used for this type of condition. The parameters of the type {=Variable:Variable2_printable} are not supported.

Modified Document Fields. If the workflow is autorun when changed, there is an option to check the field changes of the element. The activity branch will be executed if you enter some modifications in a field.

This type is available in the Bitrix24 On-Premise version only.

You can use this condition type only after additional configuration of the module. Find the instructions below.

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 workflow, 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 workflow editor:

 public static function isFeatureEnabled($documentType, $feature) { return in_array($feature, array(\CBPDocumentService::FEATURE_MARK_MODIFIED_FIELDS)); } 
Attention! If no condition is met, the workflow will continue executing the activities under the condition structure. In other words, it will skip the structure.

Listening for Parallel Event

This structure allows you to direct a workflow to different branches depending on which event occurs earlier. In other words, the activity that occurs earlier in any branch will result in the execution of the chain below such an activity.

To choose an activity branch in this structure, use the Wait for Event or Pause Execution activity.

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

Parallel Execution

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

Set Status

The activity permits you to change the workflow status.

This activity is available only in status driven workflows.

Also, this activity 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 activity enumerates the values of multiple-value sources. You can create a cycle of activities 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 activities for all the selected values entered in the field or variable.

For example, you have a variable with the Link to Employee type, which contains a list of account users. You need to create a task for each of these users sequentially. To do it, select the variable in the iterator parameters and add the Create task activity 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

A loop runs as long as a specific condition is true. For example, you can use a loop to send notifications to all department employees until everyone receives the message. All activities within the loop are executed in one step, even if the condition changes during the process. After that step is done, the loop checks the condition again: if it's still true, it continues; if not, it stops.

Do not use the 'Email message' activity when testing the While Loop. If something goes wrong and the loop keeps repeating, the system could send 1,000 emails from your account—and there’s no way to stop it once it starts.

Make sure the While Loop works correctly before using it to send emails.

Title. This is the name shown in the workflow designer.

Condition Type. Select the condition type that fits your needs:

  • Element field: Checks values in workflow element fields.
  • Mixed: Lets you check multiple things at once without creating separate conditions. For example, you can track variable values, element fields, and constants with a single condition. This makes setup faster and easier.
  • True: Runs the loop immediately without checking any condition.
  • PHP code: Uses PHP to define the condition. Only an admin can set this up. This option is only available in the Bitrix24 On-Premise version.

In the cloud version, a loop can't run more than 1,000 times. If the limit is exceeded:

  • The loop and all its sub-loops end with a false condition.
  • The error is recorded in the workflow log.
  • The workflow continues running.
The limit applies to all loops and sub-loops. If the total number of iterations exceeds the limit, all loops stop at the 1,000th iteration. If a main loop runs 500 iterations and a sub-loop runs 600 iterations, the total is 1,100 iterations. In this case, everything will stop at the 1,000th iteration, even if the main loop hasn't finished.
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
Activities: CRM Activities: Element Processing Activities: Drive Workflow activities Using Macros in Expressions My Activities in workflows Activities: Other Activities: Interactive Settings Activities: Tasks