Some activities may suspend the execution of a business process pending user’s response.
For such activities, there is an option to perform tasks instead of the user through API. To do so, send an external event to the workflow as follows:
CBPDocument::SendExternalEvent($workflowId, $activityName, $arEventParameters);
Example for the Activity "Document Approval":
"5046fe0fbf1888.64722245" - the identifier of a business process instance;
"Approve1" - the name of the approval activity;
"USER_ID"=>1 - the identifier of the approving user;
"APPROVE"=>true - the approval result (if declined - false).