This function ends the Siemplify action and sends the action results to the Siemplify system. This method is halting the action process, so no other code after the end() function will be executed.

end(output_message, result_value)

Parameters

Param Name Param Type Possible Values Comments Mandatory Parameter
output_message string Action completed The message that will be displayed in Siemplify. Yes
result_value

The result value of the action (to be later used in other actions playbooks). For example, if an action is listing the users in Active Directory, then the action result might be the number of users found. Usually a boolean value will be passed, indicating whether the action succeeded or not. Yes
execution_state int 0/1/2/3 Indicator for the current action’s state, 0 = completed, 1 = in progress, 2 = failed, 3 = timed out (states can be found in ScriptResult module). Mainly used in async actions for marking whether the action has completed or not. Default to 0 No

Return Value

None

Errors

If the end function is not called, the script will throw the following error.

Script did not return expected data. Did you call build_result/end_script? Check DebugOutput for details

Example

Sample code
from SiemplifyAction import SiemplifyAction 
from ScriptResult import EXECUTION_STATE_COMPLETED 
siemplify = SiemplifyAction() 
output_message = "Display message when action is done." 
result_value = True 
siemplify.end(output_message, result_value, EXECUTION_STATE_COMPLETED)
Result
output_message