Return Parameters to Action or Automation Rule bizproc.event.send

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: bizproc

Who can execute the method: any user

The bizproc.event.send method returns the output parameters to the Automation rule or action that were specified during the registration or update of the Automation rule or action.

The call completes a step that is waiting for a response, even if RETURN_VALUES is not passed. To write an intermediate message to the log without completing the step, use the bizproc.activity.log method.

Method Parameters

Required parameters are marked with *

Name
type

Description

EVENT_TOKEN*
string

The run token of the Automation rule or action. Bitrix24 passes it to the application handler in the event_token field.

The process accepts the result only if the step with this token is still waiting for a response. Waiting is enabled by the USE_SUBSCRIPTION: 'Y' parameter when the Automation rule or action is registered. If the parameter is not set, the step does not wait for a response by default, and waiting can be enabled in the step settings

RETURN_VALUES
object

Return values of the Automation rule or action. The keys are the parameter codes from RETURN_PROPERTIES that were set with the methods:

Keys are case-insensitive. Bitrix24 converts the value to the Type of this parameter. Bitrix24 does not retain keys that are not in RETURN_PROPERTIES.

To leave a parameter empty, pass an empty string "". If a key is not passed, the parameter receives the Default value set at registration. For details, see How to Return an Empty Value

LOG_MESSAGE
string

Text for the business process log.

If this parameter is not passed, the log receives the standard entry "Received application response".

Event logging must be enabled in the business process template

The method checks only the signature of EVENT_TOKEN: with an invalid token, it returns the ACCESS_DENIED error. The method responds before Bitrix24 passes the values to the process. If the step has already completed, timed out, or is not waiting for a response, the method still returns true, and the process does not change.

How to Return an Empty Value

To make an Automation rule or action return a parameter as empty, pass an empty string "" in RETURN_VALUES. This works for a parameter of any type, including a multiple one, and with any way of calling the method. An empty string also overrides the Default value set at registration.

The process handles other values differently. The "empty" condition in Automation rules and business processes does not match all of them.

Value in RETURN_VALUES

Result in the process

""

The parameter is empty

Key not passed

The parameter receives the Default value set at registration. If Default is not set, the parameter is empty

null

The parameter receives the Default value set at registration. If Default is not set, the parameter is empty

false

In a request with a JSON body, the parameter is empty. BX24.js and CRest send false as 0, and the parameter receives the value 0

[]

In a request with a JSON body, the parameter is empty. BX24.js and CRest do not send an empty array, and the parameter receives the Default value

0 or "0"

The parameter is set to 0

"N"

For a parameter of the bool type, the parameter is set to "No"

String of spaces

The parameter is set to the string of spaces

Code Examples

How to Use Examples in Documentation

In the example, the outputString parameter is returned with a value, and errorText is returned empty.

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"event_token":"55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90","return_values":{"outputString":"846c55d14f552180874a628d2615e285","errorText":""}}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/bizproc.event.send
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"event_token":"55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90","return_values":{"outputString":"846c55d14f552180874a628d2615e285","errorText":""},"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/bizproc.event.send
        
try
        {
        	const response = await $b24.actions.v2.call.make({
        		method: 'bizproc.event.send',
        		params: {
        			event_token: '55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90',
        			return_values: {
        				outputString: '846c55d14f552180874a628d2615e285',
        				errorText: ''
        			}
        		}
        	});
        
        	if (!response.isSuccess)
        		console.error(response.getErrorMessages().join('; '));
        	else
        		console.log('Success:', response.getData().result);
        }
        catch (error)
        {
        	console.error('Error:', error);
        }
        
from b24pysdk.errors import BitrixAPIError, BitrixSDKException
        
        try:
            bitrix_response = client.bizproc.event.send(
                event_token="55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90",
                return_values={
                    "outputString": "846c55d14f552180874a628d2615e285",
                    "errorText": "",
                },
            ).response
            result = bitrix_response.result
            print(result)
        except BitrixAPIError as error:
            print(
                "Bitrix API error",
                f"error: {error.error}",
                f"error_description: {error.error_description}",
                sep="\n",
            )
        except BitrixSDKException as error:
            print(f"Bitrix SDK error: {error.message}")
        except Exception as error:
            print(f"Unexpected error: {error}")
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'bizproc.event.send',
                    [
                        'event_token' => '55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90',
                        'return_values' => [
                            'outputString' => '846c55d14f552180874a628d2615e285',
                            'errorText' => ''
                        ]
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            echo 'Success: ' . var_export($result[0], true);
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error sending bizproc event: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'bizproc.event.send',
            {
                event_token: '55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90',
                return_values: {
                    outputString: '846c55d14f552180874a628d2615e285',
                    errorText: ''
                }
            },
            function(result) {
                if(result.error())
                    alert("Error: " + result.error());
                else
                    alert("Success: " + result.data());
            }
        );
        
require_once('crest.php');
        
        $result = CRest::call(
            'bizproc.event.send',
            [
                'event_token' => '55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90',
                'return_values' => [
                    'outputString' => '846c55d14f552180874a628d2615e285',
                    'errorText' => ''
                ]
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "bizproc.event.send", b24.Params{
        	"EVENT_TOKEN": "55c1dc1c3f0d75.78875596|A51601_82584_96831_81132|hsyUws1j4XiwqPqN45eH66CcQtEvpUIP.47dd5d888e8e549d2c984713e12a4268e6e87d0208ca1f093ba1075e77f92e90",
        	"RETURN_VALUES": b24.Params{
        		"outputString": "846c55d14f552180874a628d2615e285",
        		"errorText":    "",
        	},
        })
        if err != nil {
        	return fmt.Errorf("bizproc.event.send: %w", err)
        }
        
        var ok bool
        if err := json.Unmarshal(res.Result, &ok); err != nil {
        	return fmt.Errorf("parse response: %w", err)
        }
        fmt.Println("done:", ok)
        

Response Handling

HTTP Status: 200

{
            "result": true,
            "time": {
                "start": 1738152544.203554,
                "finish": 1738152544.248411,
                "duration": 0.044857025146484375,
                "processing": 0.0039920806884765625,
                "date_start": "2025-01-29T15:09:04+01:00",
                "date_finish": "2025-01-29T15:09:04+01:00",
                "operating_reset_at": 1738153144,
                "operating": 0
            }
        }
        

Returned Data

Name
type

Description

result
boolean

true if Bitrix24 accepted the request. This does not confirm that the process applied the values

time
time

Information about the request execution time

Error Handling

HTTP Status: 403

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

Name
type

Description

error
string

String error code. It consists of digits, Latin letters, and underscores. It may arrive empty — in that case only error_description shows the reason

error_description
string

Error message for the developer. Do not show it to the end user without processing

Possible Error Codes

Status

Code

Description

Value

403

ACCESS_DENIED

Access denied!

EVENT_TOKEN is not passed or its signature is invalid

Statuses and System Error Codes

HTTP Status: 4xx, 5xx

The errors described below are returned by the REST API itself, not by the logic of a specific method. They can arrive in response to any method.

Status

Code
Error Message

Description

500

INTERNAL_SERVER_ERROR
Internal server error

An internal server error has occurred. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

500

ERROR_UNEXPECTED_ANSWER
Server returned an unexpected response

The server returned an unexpected response. Retry the call, and if the error persists, contact the server administrator or Bitrix24 technical support

503

QUERY_LIMIT_EXCEEDED
Too many requests

The request intensity limit has been exceeded

429

OPERATION_TIME_LIMIT
Method is blocked due to operation time limit

The method is blocked because the request resource intensity limit has been exceeded. The block is lifted automatically once the accumulated execution time of the method no longer exceeds the limit

401

NO_AUTH_FOUND
Wrong authorization data

The request contains no authorization data: neither an access token nor a webhook code was passed

401

INVALID_REQUEST
Https required

Methods are called over the HTTPS protocol only

401

OVERLOAD_LIMIT
REST API is blocked due to overload

The REST API is blocked due to overload. This is a manual individual block. To have it lifted, contact Bitrix24 technical support

401

ACCESS_DENIED
REST is available only on commercial plans

REST API access is not active for this account. In Bitrix24 Cloud, check the current plan or trial status: Vibe+ plans include REST API access, while Essentials plans do not. A webhook receives a different error message — REST is available only by subscription

401

INVALID_CREDENTIALS
Invalid request credentials

No active webhook with the specified user identifier and secret code was found

404

ERROR_METHOD_NOT_FOUND
Method not found!

No method with this name was found. The name is misspelled, the method does not exist in the REST API, or it is unavailable without the required scope

401

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

The request requires broader permissions than the token has: for a webhook these are the permissions granted to it, for an application it is the scope. For an application, the error message ends with provided by the access token

401

expired_token
The access token provided has expired

The access token has expired

401

user_access_error
The user does not have access to the application

The application is installed, but the Bitrix24 administrator has granted access to it only to specific users

403

PORTAL_DELETED
Portal was deleted

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

Continue Learning