Add a CAI Notifier

SAP Conversational AI and SAP Build Process Automation work together to create your chatbot, CAI (Conversational Artificial Intelligence) provides the natural language interface, while SAP Build Process Automation executes the tasks.

Prerequisites

When designing chatbots, you can use webhooks to trigger the execution of an automation. For this, you need to add an API trigger to the corresponding automation. The endpoint of the created API trigger can then be called in the webhook. For more information about how to use a webhook, refer to the SAP Conversational AI documentation.

Procedure

  1. Choose Control Tower and then the Environments tile.
  2. Select your environment and go to the Triggers view.
  3. Find the trigger for your project, click the and then select Add notifier.
  4. In the Create Notifier screen, select CAI and choose Next
  5. Open the Notify on drop-down list, and choose the activation event:
    • All status changes: A notification is sent for any status change on the job.

    • Start: A notification is sent when the job starts.

    • Success: A notification is sent when the job is successful.

    • Failure: A notification is sent when the job fails.

    • Cancel: A notification is sent when the job is canceled.

    • Expired: A notification is sent when the job is failed or expired. A job expired event triggers under two circumstances:

      • When you have a job ready that does not run before the expiration date. This case concerns automations with a scheduled trigger.

      • When you have a job that is running but the timeout is reached, and the agent is not able to send the result due to some unforeseen challenges such as internet connectivity issues. This case concerns automations with an API trigger.

  6. Optional: From the Available variables list, you can use the variables in the Message Content and Memory field. For more information on available variable, see Available Variables for Notifiers.
  7. Enter a name and a description.
  8. Refer to the Conversation ID passed as invocationContext in the body of the chatbot webhook call.
  9. In the Token field, enter:
    • request token of the project if you want to send a message.

    • developer token if you want to update a conversation.

  10. Optional: Check the Enterprise Edition checkbox if you want to use the enterprise edition of CAI.
    • Provide the enterprise endpoint URL in the Enterprise Endpoint field. The URL of the enterprise endpoint must be without the path. Only the hostname must be provided in the URL of the enterprise endpoint.

  11. In the Auth URL, Client ID, and Client Secret fields, enter the:
    • runtime client credential details when you want to send a message.

    • design time credential details when you want to update a conversation.

  12. Select the action you want to perform with the notifier:
    • Send a message

      No additional implementation is required on the chatbot side. In the Message content area, define the message to be sent.

    • Update a conversation

      Here you can modify the chatbot Memory and if needed, the conversation Language. In your chatbot design you can react to these changes and decide on what is communicated to the user.

      You also need to provide the User slug, Bot slug and Version slug to enable this operation. You can refer to the available variables in the slug definitions, as well as in the memory specification. Consult the SAP Conversational AI documentation to learn where to find the slugs.