This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Operational flowcharts

Aura operational flowcharts

The current section includes certain key operational flows in Aura

Introduction

Find the following flowcharts for Aura operational processes:

1 - Direct Line flowcharts

Direct Line flowcharts

Basic flows for Direct Line channels

Request a new accessToken from Direct Line to access Aura

These steps must be executed before starting the user conversation with Aura. The token to access Direct Line must be requested to Aura because one of the admin secrets of the bot Direct Line configuration is used to generate the tokens.

@startuml
    title: Request a DirectLine accessToken for AuraGroot
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99

    Channel -> AuthenticationApi: POST /aura-services/v1/token/wss
    AuthenticationApi -> DirectLine: POST /token
    DirectLine -> AuthenticationApi: 201 Created {token}
    AuthenticationApi -> Channel: 201 Created {token}
    Channel -> DirectLine: Open WebSocket
    Channel -> DirectLine: Start sending user requests
    Channel -> DirectLineWebSocket: Start getting Aura responses
@enduml

New Direct Line message from anonymous users

An anonymous user is the one that has never been authenticated via Kernel and her authentication session has not been stored in aura-authentication-api.

Find more information in the document Channels authentication: anonymous users

@startuml

title: Basic flow for DirectLine anonymous users


    actor User
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 

    Channel -> DirectLineWebsocket: Open WebSocket
    User -> Channel: Send [message]
    Note over Channel,DirectLine: The previously created token of DirectLine must be sent in the Authorization header as Bearer token.
    Channel -> DirectLine: Send {activity[message]}
    DirectLine -> AuraGroot: Send {activity[message]}
    AuraGroot -> DirectLine: 200 OK
    note right of AuraGroot: KPI entities are stored during Middlewares execution in local memory.\nEvery 2 minutes and before closing a POD, they are written in Azure Storage.
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {activity[message]}
    Note over AuraGroot,AuraBot: There are two different conversations: one between the channel and AuraGroot and another one between AuraGroot and the skill.
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuthenticationApi: GET AuraId
    AuthenticationApi -> AuraBot: 404 Not found (Anonymous)
    AuraBot -> AuraBot: Middlewares
    note right of AuraBot: KPI entities are stored during Middlewares execution in local memory.\nEvery 2 minutes and before closing a POD, they are written in Azure Storage.
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute Specific functional Dialog
    AuraBot -> AuraGroot: Send {responseActivity}
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> DirectLine: Send {responseActivity}
    DirectLine -> AuraGroot: 200 OK
    Channel -> DirectLineWebsocket: Read {responseActivity}
    Channel -> User: Show {responseActivity}
@enduml

New Direct Line message from authenticated users

Find information regarding users’ authentication in the document Channels authentication: authenticated users.

@startuml

title: Basic flow for DirectLine authenticated users

    actor User
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF
    
    Channel -> DirectLineWebsocket: Open WebSocket
    User -> Channel: Send [message]
    Note over Channel,DirectLine: The previously created token of DirectLine must be sent in the Authorization header as Bearer token.
    Channel -> DirectLine: Send {activity[message]}
    DirectLine -> AuraGroot: Send {activity[message]}
    AuraGroot -> DirectLine: 200 OK
    Note right of AuraGroot: KPI entities are stored during Middlewares execution in local memory.\nEvery 2 minutes and before closing a POD, they are written in Azure Storage.
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {activity[message]}
    Note over AuraGroot,AuraBot: There are two different conversations: one between the channel\nand AuraGroot and another one between AuraGroot and the skill.
    AuraBot -> AuraGroot: 200 OK
    opt user is not in cache
        AuraBot -> AuthenticationApi: GET AuraId
        AuthenticationApi -> AuraBot: 200 OK {userData}
        AuraBot -> KernelAuthServer: POST /token
        Note over AuraBot,KernelAuthServer: Here, a 3legged accessToken is requested
        KernelAuthServer -> AuraBot: {token}
        AuraBot -> KernelAuthServer: getIntrospect(token)
        opt channel allows UserProfile
            AuraBot -> KernelUserProfileApi: getUserProfile(userId)
            KernelUserProfileApi -> AuraBot: UserProfile
        end
        AuraBot -> AuraBot: store user in cache: userData, userProfile, valid scopes and purposes
    end
    AuraBot -> AuraBot: Middlewares
    Note right of AuraBot: KPI entities are stored during Middlewares execution in local memory.\nEvery 2 minutes and before closing a POD, they are written in Azure Storage.
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: ValidateAuthenticationForDialog
    AuraBot -> AuraBot: Execute Specific functional Dialog
    AuraBot -> AuraGroot: Send {responseActivity}
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> DirectLine: Send {responseActivity}
    DirectLine -> AuraGroot: 200 OK
    Channel -> DirectLineWebsocket: Read {responseActivity}
    Channel -> User: Show {responseActivity}
@enduml

2 - User authentication flowcharts

User authentication

Basic flows for users authentication in Aura

Non-integrated channels

For this kind of channels, the users always start as authenticated. The channel is responsible for authenticating the user in the OB and Kernel and for generating the auraId needed to prepare a valid request to Aura.

Further information about non-integrated channels can be found in Channels Authentication: non-integrated authentication.

This diagram must be executed just before sending messages to Aura for authenticated users.

⚠️ The request from Channel to IDP is not fully explained in the diagram. Follow Kernel documentation for a deep dive on how it works.

@startuml
title: Users authentication flow for non-integrated channels

    participant Channel #bdf492
    participant AuthenticationApi #FFFF99
    participant IdP #99FFFF
    participant KernelAuthServer #99FFFF
    participant KernelAuraServicesApi #99FFFF

    Channel -> IdP: POST /authorize
    IdP -> Channel: 200 OK {UserAuthenticationContext}
    Channel -> KernelAuthServer: POST /token
    Note over Channel,KernelAuthServer: Here a 3-legged accessToken is requested
    KernelAuthServer -> Channel: {token}
    Channel -> KernelAuraServicesApi: GET /users/aura-id
    KernelAuraServicesApi -> AuthenticationApi: GET /aura-services/v1/users/aura-id
    AuthenticationApi -> KernelAuraServicesApi: 200 OK {AuraUser}
    KernelAuraServicesApi -> Channel: 200 OK {AuraUser}
    Note over KernelAuraServicesApi,Channel: AuraUser contains the auraId needed to fulfil the requests to Aura.
@enduml

Integrated or federated channels

For this kind of channels, the users always start as anonymous and they can consume some generic questions use cases, those that do not need knowing who the user is to be resolved, such as FAQs or small talk use cases.

Once the user requests one use case that needs knowing her identity, then the authentication flow is launched by a dialog available in aura-bot. The auraId, in this case, is decided by the channel. Usually, its own user identifier is used. For instance, in the case of WhatsApp or Facebook, their own users identifier are received and used as auraId.

Further information about integrated channels can be found in Channels Authentication: integrated authentication.

This diagram substitutes the Specific functional Dialog step in the diagram New Direct Line message from anonymous user, assuming that the user has requested an authenticated use case. Not all the steps of this diagram have been included again in the sake of clarity of the diagram.

User authentication by redirection

Find further details about how this mechanism works in Kernel here.

@startuml
title: Users authentication flow for integrated channels with URL redirection

    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant AuraBridge #1add4d
    participant IdP #99FFFF
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF

    AuraBot -> AuraBot: Executing a user message that raises a dialog that needs authentication
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: ValidateAuthenticationForDialog
    AuraBot -> AuraBot: AuthenticationDialog
    AuraBot -> IdP: OPEN in webserver /authorize?state&redirectUri
    Note over AuraBot,IdP: At this moment, a web page with the login form is open
    IdP -> KernelAuthServer: Authentication status
    Note over KernelAuthServer,AuthenticationApi: In Aura, the redirectUri points to our AuthenticationApi
    KernelAuthServer -> AuthenticationApi: POST /aura-services/v1/users/auraid/integrated?code&state
    AuthenticationApi -> AuthenticationApi: validate(state)
    AuthenticationApi -> KernelAuthServer: POST /token {code}
    KernelAuthServer -> AuthenticationApi: 200 OK {token}
    AuthenticationApi -> KernelAuthServer: POST /introspect {token}
    KernelAuthServer -> AuthenticationApi: 200 OK {plainToken}
    AuthenticationApi -> AuthenticationApi: store(AuraUser)
    AuthenticationApi -> KernelAuthServer: 200 OK
    AuthenticationApi -> AuraBridge: sendAsyncCallback(AuraUser)
    AuraBridge -> AuraGroot: Send {UserCreatedActivity}
    AuraBridge -> AuthenticationApi: 200 OK
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {UserCreatedActivity}
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Middlewares
    Note right of AuraBot: KPI entities are stored during Middlewares execution in local memory.\nEvery 2 minutes and before closing a POD, they are written in Azure Storage.
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: ValidateAuthenticationForDialog
    AuraBot -> AuraBot: Execute Specific functional Dialog
    AuraBot -> AuraGroot: Send {responseActivity}
    AuraGroot -> AuraBot: 200 OK

User authentication using WhatsApp

Access these documents for further detail:

3 - Use cases flowcharts

Use cases flowcharts

Key operational flowcharts for different types of use cases such as TV, generic questions, etc.

Message generic questions use case

Generic questions use cases are based on frequently asked questions (FAQs).

These experiences are valid for anonymous users, so the example is provided with an anonymous user, but are also valid for authenticated users, in this case, when entering aura-bot the authentication steps should be executed.

Please, refer to Direct Line basic flows for authenticated users to check the differences. The example is provided using Direct Line, but it is also available for the rest of types of channels: WhatsApp or Auraline.

@startuml
title: User message that is recognized as a FAQ
    actor User
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 

    Channel -> DirectLineWebsocket: Open WebSocket
    User -> Channel: Send [Phrase that starts FAQ dialog]
    Channel -> DirectLine: Send {activity[Phrase that starts FAQ dialog]}
    DirectLine -> AuraGroot: Send {activity[Phrase that starts FAQ dialog]}
    AuraGroot -> DirectLine: 200 OK
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {activity[Phrase that starts FAQ dialog]}
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuthenticationApi: GET AuraId
    AuthenticationApi -> AuraBot: 404 Not found (Anonymous)
    AuraBot -> AuraBot: Middlewares
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute FAQ dialog
    AuraBot -> AuraBot: filterFaqWithContext(faq, user, channelData.contextFilters)
    AuraBot -> AuraGroot: Send {faqResponse}
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> DirectLine: Send {faqResponse}
    DirectLine -> AuraGroot: 200 OK
    Channel -> DirectLineWebsocket: Read {faqResponse}
    Channel -> User: Show {faqResponse}
@enduml

User message that leads to a dialog that needs an asynchronous API request to be resolved

This experience is defined in the guidelines for building a dialog that uses async APIs.

The example is provided using WhatsApp, but is also available for the rest of types of channels: DirectLine or Auraline.

@startuml
title: Use case handling asynchronous requests
    actor User
    participant WhatsApp #f6b5ff
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant AuraBridge #1add4d
    participant AuraBridgeOutbound #1add4d
    participant KernelWhatsAppApi #99FFFF
    participant AsyncApi #fc989b

    User -> WhatsApp: Request [message]
    WhatsApp -> KernelWhatsAppApi: Request [message]
    KernelWhatsAppApi -> AuraBridge: Request [message]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuthenticationApi: GET AuraId
    AuthenticationApi -> AuraGroot: 200 OK {UserData}
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: See Basic WhatsApp flow for authenticated users
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute dialog that calls to an asynchronous API
    AuraBot -> AuraBot: The dialog inits bypass
    AuraBot -> AsyncApi: POST request
    AsyncApi -> AuraBot: 200 OK
    AsyncApi -> AuraBridge: POST async-callback/notifications with response data
    AuraBridge -> AsyncApi: 200 OK
    AuraBridge -> AuraGroot: Send [payload with response data]
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraBot: Send [payload with response data]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Back to the dialog that opened the bypass
    AuraBot -> AuraBot: Process [payload with response data]
    AuraBot -> AuraGroot: Send [async request response]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Response to [message]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Response to [message]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Response to [message]
    WhatsApp -> User: Show response to [message]
@enduml

Message use case that receives files from the user

This experience is defined in the guidelines for using files in WhatsApp use cases.

The example is provided using WhatsApp, which is currently the only channel able to handle incoming files.

@startuml
title: Use case expecting files from the user
    actor User
    participant WhatsApp #f6b5ff
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant AuraBridge #1add4d
    participant AuraBridgeOutbound #1add4d
    participant KernelWhatsAppApi #99FFFF
    participant FileManager #fae193
    participant AzureStorage #dedddb

    User -> WhatsApp: Request [message]
    WhatsApp -> KernelWhatsAppApi: Request [message]
    KernelWhatsAppApi -> AuraBridge: Request [message]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuthenticationApi: GET AuraId
    AuthenticationApi -> AuraGroot: 200 OK {UserData}
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: See Basic WhatsApp flow for authenticated users
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute dialog that requests a file from the user
    AuraBot -> AuraBot: The dialog inits bypass
    AuraBot -> AuraGroot: Send [Provide a file]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Response to [Provide a file]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Response to [Provide a file]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Response to [Provide a file]
    WhatsApp -> User: Show [Provide a file]
    User -> WhatsApp: Send [requested file]
    WhatsApp -> KernelWhatsAppApi: Request [requested file]
    KernelWhatsAppApi -> AuraBridge: Request [requested file]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [requested file]
    Note over AuraBridge,AuraGroot: file is sent as an Attachment to the bot
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [activity[attachment[file]]]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: See Basic WhatsApp flow for authenticated users
    AuraBot -> AuraBot: Middleware that handles file attachments
    AuraBot -> AuraBot: check that a dialog was waiting for a file
    AuraBot -> FileManager: POST manage(file)
    FileManager -> AuraBot: 200 OK
    FileManager -> KernelWhatsAppApi: GET /media/file
    Note right of FileManager: In fact, file is passed by streaming from WhatsApp media API to Azure Storage
    KernelWhatsAppApi -> FileManager: 200 OK {fileStream}
    FileManager -> FileManager: validate(file)
    FileManager -> AzureStorage: POST upload(file)
    AzureStorage -> FileManager: 201 Created
    FileManager -> AuraBridge: POST async-callback/notifications with file validation data
    Note over FileManager,AuraBridge: FileManager response contains the file validation\nand the local Azure Storage URL where the file can be obtained.
    AuraBridge -> FileManager: 200 OK
    AuraBridge -> AuraGroot: Send [payload with file validation data]
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraBot: Send [payload with file validation data]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Back to the dialog that waits for a file
    AuraBot -> AuraBot: Process [payload with file validation data]
    AuraBot -> AuraGroot: Send [file response]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Response to [file response]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Response to [file response]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Response to [file response]
    WhatsApp -> User: Show response to [file response]
@enduml

TV use cases

Currently, TV use cases are only available for authenticated users.

TV use case for channels with integration with channelData v3

Operational flow for TV use cases in channels integrated with channelData v3.

@startuml
title: TV use case for channelData V3
    actor User
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant ComplexLogicApi #CCCCFF
    participant KernelVideoContentsApi #99FFFF

    Channel -> DirectLineWebsocket: Open WebSocket
    User -> Channel: Send [I want to see an action movie]
    Channel -> DirectLine: Send {activity[I want to see an action movie]}
    DirectLine -> AuraGroot: Send {activity[I want to see an action movie]}
    AuraGroot -> DirectLine: 200 OK
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {activity[I want to see an action movie]}
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Basic DirectLine flow for authenticated users
    AuraBot -> AuraBot: Middlewares
    AuraBot -> AuraBot: Recognizers intent.tv.search
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute intent.tv.search Dialog
    AuraBot -> ComplexLogicApi: POST tv/query {intent: intent.tv.search, entities: movie, action}
    ComplexLogicApi -> KernelVideoContentsApi: GET /videocontents filter by user context and entities
    KernelVideoContentsApi -> ComplexLogicApi: 200 OK [{videoContent}]
    ComplexLogicApi -> AuraBot: 200 OK [{videoContent}]
    AuraBot -> AuraGroot: Send [{videoContent}]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> DirectLine: Send [{videoContent}]
    DirectLine -> AuraGroot: 200 OK
    Channel -> DirectLineWebsocket: Read [{videoContent}]
    Channel -> User: Show [{videoContent}]
@enduml

TV use case for channels with integration with channelData v1

Operational flow for TV use cases in channels integrated with channelData v1.

This scenario is only available in Spain.

@startuml
title: TV use case for channelData V1
    actor User
    participant Channel #bdf492
    participant DirectLine #FFCC99
    participant DirectLineWebsocket #FFCC99
    participant AuthenticationApi #FFFF99
    participant AuraGroot #76bbe7
    participant AuraBot #41a0f9 
    participant MovistarResolutionApi #CCCCFF
    participant KernelLegacyVideoApi #99FFFF

    Channel -> DirectLineWebsocket: Open WebSocket
    User -> Channel: Send [I want to see an action movie]
    Channel -> DirectLine: Send {activity[I want to see an action movie]}
    DirectLine -> AuraGroot: Send >{activity[I want to see an action movie]}
    AuraGroot -> DirectLine: 200 OK
    AuraGroot -> AuraGroot: Middlewares
    AuraGroot -> AuraGroot: Recognizers (GetSkillByChannel)
    AuraGroot -> AuraBot: Send {activity[I want to see an action movie]}
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Basic DirectLine flow for authenticated users
    AuraBot -> AuraBot: Middlewares
    AuraBot -> AuraBot: Recognizers intent.tv.search
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute intent.tv.search Dialog
    AuraBot -> MovistarResolutionApi: POST tv/query {intent: intent.tv.search, entities: movie, action}
    MovistarResolutionApi -> KernelLegacyVideoApi: GET /video filter by user context and entities
    KernelLegacyVideoApi -> MovistarResolutionApi: 200 OK [{videoContent}]
    MovistarResolutionApi -> AuraBot: 200 OK {[{videoContent}], [{suggestion}]}
    AuraBot -> AuraGroot: Send {[{videoContent}], [{suggestion}]}
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> DirectLine: Send {[{videoContent}], [{suggestion}]}
    DirectLine -> AuraGroot: 200 OK
    Channel -> DirectLineWebsocket: Read {[{videoContent}], [{suggestion}]}
    Channel -> User: Show {[{videoContent}], [{suggestion}]}
@enduml

4 - WhatsApp flowchart

WhatsApp flowchart

Key flowcharts for WhatsApp channel: basic, login and logout flows

WhatsApp basic flowchart

Flows for new messages from anonymous and authenticated users in the WhatsApp channel.

New WhatsApp message from anonymous user

@startuml
title: Basic flow for WhatsApp anonymous users
    actor User
    participant WhatsApp #f6b5ff
    participant KernelWhatsAppApi #99FFFF
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant AuthenticationApi #FFFF99
    participant AuraBot #41a0f9 
    participant TACApi #66B2FF
    participant AuraBridgeOutbound #1add4d

    User -> WhatsApp: Request [message]
    WhatsApp -> KernelWhatsAppApi: Request [message]
    KernelWhatsAppApi -> AuraBridge: Request [message]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    Note over AuraBridge,AuraGroot: WhatsApp channels use channelData V2 between AuraBridge and AuraGroot
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuthenticationApi: GET auraId
    AuthenticationApi -> AuraBot: 404 Not Found (Anonymous user)
    Note left of TACApi: See Terms and Conditions flow
    AuraBot -> TACApi: Check terms and conditions
    TACApi -> AuraBot: 200 OK
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute Specific functional Dialog
    AuraBot -> AuraGroot: Response to [message]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Response to [message]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Response to [message]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Response to [message]
    WhatsApp -> User: Show response to [message]
@enduml

New WhatsApp message from authenticated user

@startuml
title: Basic flow for WhatsApp authenticated users
    actor User
    participant WhatsApp #f6b5ff
    participant KernelWhatsAppApi #99FFFF
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant AuthenticationApi #FFFF99
    participant AuraBot #41a0f9 
    participant TACApi #66B2FF
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF
    participant AuraBridgeOutbound #1add4d

    User -> WhatsApp: Request [message]
    WhatsApp -> KernelWhatsAppApi: Request [message]
    KernelWhatsAppApi -> AuraBridge: Request [message]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    Note over AuraBridge,AuraGroot: WhatsApp channels use channelData V2 between AuraBridge and AuraGroot
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: GET userCache(auraId)
    opt User is not in cache
        AuraBot -> AuthenticationApi: GET AuraId
        AuthenticationApi -> AuraBot: 200 OK {userData}
        AuraBot -> KernelAuthServer: POST /token
        Note over AuraBot,KernelAuthServer: Here, a 3legged accessToken is requested
        KernelAuthServer -> AuraBot: {token}
        AuraBot -> KernelAuthServer: getIntrospect(token)
        opt channel allows UserProfile
            AuraBot -> KernelUserProfileApi: getUserProfile(userId)
            KernelUserProfileApi -> AuraBot: UserProfile
        end
        AuraBot -> AuraBot: store user in cache: userData, userProfile, valid scopes and purposes
    end
    Note left of TACApi: See Terms and Conditions flow
    AuraBot -> TACApi: Check terms and conditions
    TACApi -> AuraBot: 200 OK
    AuraBot -> AuraBot: Recognizers
    AuraBot -> AuraBot: Main Dialog
    AuraBot -> AuraBot: Execute Specific functional Dialog
    AuraBot -> AuraGroot: Response to [message]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Response to [message]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Response to [message]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Response to [message]
    WhatsApp -> User: Show response to [message]
@enduml

Terms & Conditions flowchart

@startuml

title: Acceptance of terms and conditions flow
    actor User
    participant WhatsApp #f6b5ff
    participant KernelWhatsAppApi #99FFFF
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant AuthenticationApi #FFFF99
    participant AuraBot #41a0f9 
    participant TACApi #66B2FF
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF
    participant AuraBridgeOutbound #1add4d

    User -> WhatsApp: Request [message]
    WhatsApp -> KernelWhatsAppApi: Request [message]
    KernelWhatsAppApi -> AuraBridge: Request [message]
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: GET userCache(auraId)
    alt User already accepted authenticated T&C or Channel doesn't have terms and conditions config
        AuraBot -> TACApi: GET termsAndConDitions(auraId)
        TACApi -> AuraBot: 200 OK
        Note left of AuraBot: See WhatSApp basic flow
        AuraBot -> AuraBot: Recognizers
        AuraBot -> AuraBot: Main Dialog
        AuraBot -> AuraBot: Execute Specific functional Dialog
        AuraBot -> AuraGroot: Response to [message]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Response to [message]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Response to [message]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp: Response to [message]
        WhatsApp -> User: Show response to [message]
    else User needs to accept authenticated T&C
        AuraBot -> TACApi: GET termsAndConditions(auraId)
        TACApi -> AuraBot: 404 Not found
        AuraBot -> AuraBot: executes terms and conditions dialog
        AuraBot -> AuraGroot: Send [onboarding messages]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Send [onboarding messages]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Send [onboarding messages]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp: Send [onboarding messages]
        WhatsApp -> User: Show [onboarding messages]
    end
@enduml

WhatsApp phone OTP (LoA2) authentication

Operational flow based on the whatsapp-otp-login global dialog.

The flow will be similar for email OTP method.

@startuml
title: WhatsApp authentication flow via phone OTP (LoA2)
    actor User
    participant WhatsApp #f6b5ff
    participant KernelWhatsAppApi #99FFFF
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant AuthenticationApi #FFFF99
    participant AuraBot #41a0f9 
    participant TACApi #66B2FF
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF
    participant AuraBridgeOutbound #1add4d

    User -> WhatsApp: I want to log in
    WhatsApp -> KernelWhatsAppApi: I want to log in
    KernelWhatsAppApi -> AuraBridge: I want to log in
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: I want to log in
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> AuraBot: Request [message]
    AuraBot -> AuraGroot: 200 OK
    note left of AuraGroot: See basic WhatsApp flow for anonymous users
    AuraBot -> AuraBot: basic whatsapp flow for anonymous user
    AuraBot -> AuraBot: Dialog needs auth and user is anonymous. Redirect to WhatsApp login dialog, step 1
    AuraBot -> AuraGroot: Send [Please, enter your phone number]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Send [Please, enter your phone number]
    AuraBridgeOutbound -> KernelWhatsAppApi: Send [Please, enter your phone number]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Send [Please, enter your phone number]
    WhatsApp -> User: Send [Please, enter your phone number]
    User -> WhatsApp: phoneNumber
    WhatsApp -> KernelWhatsAppApi: phoneNumber
    KernelWhatsAppApi -> AuraBridge: phoneNumber
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: phoneNumber
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraBot: phoneNumber
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Execute step 2 of WhatsApp login dialog
    AuraBot -> KernelWhatsAppApi: POST sendSMSOTPCode(phoneNumber)
    KernelWhatsAppApi -> AuraBot: 200 OK
    KernelWhatsAppApi -> User: [SMS] Your verification code is XXXX
    AuraBot -> AuraGroot: Send [Please, enter your phone number]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Send [Please, enter your phone number]
    AuraBridgeOutbound -> KernelWhatsAppApi: Send [Please, enter your phone number]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Send [Please, enter your phone number]
    WhatsApp -> User: Send [Please, enter the verification code]
    User -> WhatsApp: XXXX
    WhatsApp -> KernelWhatsAppApi: XXXX
    KernelWhatsAppApi -> AuraBridge: XXXX
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: XXXX
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraBot: XXXX
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Execute step 3 of WhatsApp login dialog
    AuraBot -> KernelWhatsAppApi: POST validateCode(phoneNumber, code)
    KernelWhatsAppApi -> AuraBot: 200 OK {authenticationContext}
    AuraBot -> AuthenticationApi: POST /users/auraId {authenticationContext}
    AuthenticationApi -> AuraBot: 201 Created
    alt  User has already accepted authenticated Terms and Conditions
        AuraBot -> TACApi: GET termsAndConditions(auraId)
        TACApi -> AuraBot: 200 OK
        AuraBot -> AuraGroot: Send [Great! you are now signed in]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Send [Great! you are now signed in]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Send [Great! you are now signed in]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp: Send [Great! you are now signed in]
        WhatsApp -> User: Show [Great! you are now signed in]
    else User needs to accept authenticated T&C
        AuraBot -> TACApi: GET termsAndConditions(auraId)
        TACApi -> AuraBot: 404 Not found
        AuraBot -> AuraGroot: Send [Great! you are now signed in]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Send [Great! you are now signed in]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Send [Great! you are now signed in]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp: Send [Great! you are now signed in]
        WhatsApp -> User: Show [Great! you are now signed in]
        AuraBridgeOutbound -> AuraGroot: intent.onboarding.terms-and-conditions from redirect intent configured for the channel
        AuraGroot -> AuraBridgeOutbound: 200 OK
        AuraGroot -> AuraBot: intent.onboarding.terms-and-conditions from redirect intent configured for the channel
        AuraBot -> AuraGroot: 200 OK
        AuraBot -> AuraBot: GET userCache(auraId)
        opt User is not in cache
            AuraBot -> AuthenticationApi: GET AuraId
            AuthenticationApi -> AuraBot: 200 OK {userData}
            AuraBot -> KernelAuthServer: POST /token
            Note over AuraBot,KernelAuthServer: Here, a 3legged accessToken is requested
            KernelAuthServer -> AuraBot: {token}
            AuraBot -> KernelAuthServer: getIntrospect(token)
            opt channel allows UserProfile
                AuraBot -> KernelUserProfileApi: getUserProfile(userId)
                KernelUserProfileApi -> AuraBot: UserProfile
            end
            AuraBot -> AuraBot: store user in cache: userData, userProfile, valid scopes and purposes
        end
        AuraBot -> AuraBot: executes Terms and Conditions dialog
        AuraBot -> AuraGroot: Send [onboarding messages]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Send [onboarding messages]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Send [onboarding messages]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp:  Send [onboarding messages]
        WhatsApp -> User: Show [onboarding messages]
    else Channel doesn't have terms and conditions config
        AuraBot -> AuraGroot: Send [Great! you are now signed in]
        AuraGroot -> AuraBot: 200 OK
        AuraGroot -> AuraBridgeOutbound: Send [Great! you are now signed in]
        AuraBridgeOutbound -> AuraGroot: 200 OK
        AuraBridgeOutbound -> KernelWhatsAppApi: Send [Great! you are now signed in]
        KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
        KernelWhatsAppApi -> WhatsApp: Send [Great! you are now signed in]
        WhatsApp -> User: Show [Great! you are now signed in]
    end
@enduml

WhatsApp logout

Operational flow based on the whatsapp-logout global dialog.

@startuml
title: WhatsApp logout flow
    actor User
    participant WhatsApp #f6b5ff
    participant KernelWhatsAppApi #99FFFF
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant AuthenticationApi #FFFF99
    participant AuraBot #41a0f9 
    participant KernelAuthServer #99FFFF
    participant KernelUserProfileApi #99FFFF
    participant AuraBridgeOutbound #1add4d

    User -> WhatsApp: I want to logout
    WhatsApp -> KernelWhatsAppApi: I want to logout
    KernelWhatsAppApi -> AuraBridge: I want to logout
    AuraBridge -> KernelWhatsAppApi: 200 OK
    AuraBridge -> AuraGroot: I want to logout
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraBot: I want to logout
    AuraBot -> AuraGroot: 200 OK
    AuraBot -> AuraBot: Basic whatsapp flow for authenticated users
    AuraBot -> AuthenticationApi: DELETE /users/auraId
    AuthenticationApi -> AuraBot: 204 NO_CONTENT
    AuraBot -> KernelWhatsAppApi: DELETE /sessions/authorizationId
    KernelWhatsAppApi -> AuraBot: 204 NO_CONTENT
    AuraBot -> AuraGroot: Send [You're successfully logged out, discover what can be done with Aura]
    AuraGroot -> AuraBot: 200 OK
    AuraGroot -> AuraBridgeOutbound: Send [You're successfully logged out, discover what can be done with Aura]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> KernelWhatsAppApi: Send [You're successfully logged out, discover what can be done with Aura]
    KernelWhatsAppApi -> AuraBridgeOutbound: 200 OK
    KernelWhatsAppApi -> WhatsApp: Send [You're successfully logged out, discover what can be done with Aura]
    WhatsApp -> User: Show [You're successfully logged out, discover what can be done with Aura]
@enduml

5 - Auraline flowcharts

Auraline flowcharts

Basic flowcharts for Auraline channels message flow.

Auraline basic flowcharts

Auraline channel handled by an external skill

This flowchart shows the interaction of anonymous users requesting a use case handled by an external skill.

@startuml
title: Auraline anonymous user using external skill
    actor User
    participant Channel #bdf492
    participant AuraBridge #1add4d
    participant AuraGroot #76bbe7
    participant ExternalSkill #B266FF
    participant AuraBridgeOutbound #1add4d

    User -> Channel: Request [message]
    Channel -> AuraBridge: Request [message]
    AuraBridge -> Channel: 200 OK
    AuraBridge -> AuraGroot: Request [message]
    Note over AuraBridge,AuraGroot: Auraline  channels use channelData V3 between AuraBridge and AuraGroot
    AuraGroot -> AuraBridge: 200 OK
    AuraGroot -> AuraGroot: GetSkillByChannel
    AuraGroot -> ExternalSkill: Request [message]
    ExternalSkill -> AuraGroot: 200 OK
    ExternalSkill -> ExternalSkill: Process [message]
    ExternalSkill -> AuraGroot: Send [response]
    AuraGroot -> ExternalSkill: 200 OK
    AuraGroot -> AuraBridgeOutbound: Send [response]
    AuraBridgeOutbound -> AuraGroot: 200 OK
    AuraBridgeOutbound -> Channel: Send [response]
    Channel -> User: Show [response]
    alt Channel should use status endpoint to inform Aura whether or not the sent activities are shown to the user
        Channel -> AuraBridge: Send [status]
        AuraBridge -> Channel: 200 OK
        AuraBridge -> AuraBridge: log status
    end
@enduml