End

This help page is for Desktop Studio. This information is also available for CXone Studio.

Terminates a script.

There are some differences in how this action functions depending on script media type. It's important to use this action with supported media types only. See the Dependencies and Similar Actions sections for more information.

Dependencies

  • If you use End in a script with an unsupported media type, it may not end all processes properly or the contact. Ending background processes is a key function of terminating actions. For this reason, it's important to use the action best suited for the media type of your script:
    • For inbound phone scripts, you can use End as long as the call hasn't connected. After a call connects, use the Hangup action to terminate the script.
    • For outbound phone scripts, you can use End until the Placecall action executes. After the call connects, use the Hangup action to terminate the script.
    • For chat scripts, use Exit to terminate the script.
    • For email scripts, use Discard to terminate the script.
    • For digital scripts, End only terminates the script. It doesn't terminate the contact. Digital contacts continue to exist in Digital Experience. For all other script types, End terminates both the script and the contact.
  • If you use End in a subscript, it terminates both the subscript and the originating script. Use the Return action if you want to terminate the subscript but for the originating script to continue.
  • End should be used to terminate the logic flow of an active script and invoke the OnRelease event action. For this reason, it shouldn't be used after the OnRelease event logic.

Supported Script Types

The icon for a Generic script type - a rectangle with < and > symbols inside it.

The icon for the Phone script type - an old-style phone handset with curved lines indicating sound coming out of it.

The icon for the Voicemail script type - a symbol that looks like a cassette tape - two circles sitting on a horizontal line.

The icon for the Work Item script type-a piece of paper with one corner folded down and a bullet list on it.

The icon for the SMS script type - a smart phone with a chat bubble coming out of it.

The icon for the Digital script type - a computer monitor with a smartphone next to it.

Generic

Phone Voicemail Work Item SMS Digital

Comparison of Similar Actions

  • Discard: Terminates an email script.
  • End: Terminates a phone, voicemail, SMS, or digital script. Does not terminate a digital contact, but terminates contacts in scripts with other media types.
  • End a Contact: Terminates the active contact. Does not terminate the current script.
  • EndText: Terminates an SMS workflow that doesn't include a Regagent action (for digitalClosed Any channel, contact, or skill associated with Digital Experience. channels only).
  • EndWi: Terminates a work item with a cause code. Does not terminate the current script.
  • Exit: Terminates a chat session and disconnects the chat contact.
  • Hangup: Terminates a phone script.
  • Return: Terminates a subscript and returns control to the originating script.

Do not use the Stop action to end a script. It does not terminate the script and leaves contacts running. This has a negative impact on the CXone servers.

Input Properties

None

Result Branch Conditions

None

Script Example

This is an example to show how this action can be used in scripts. It is not intended to be a complete script. Additional scripting may be required.

This script shows a very simple example in which End is used in a phone script, but the outbound call was never placed because an error occurred. If the error had not occurred, Placecall would have been triggered, and you would have used Hangup in a different branch. Refer to Placecall to see an example of using Hangup in a phone script.

Would you like to download this script?