Lifecycle events - Agent Workspace

Lifecycle events

There are lifecycle states that an app can move between from when the app is initially opened to when it is closed. This includes the initialization handshake that the app goes through with the workspace after it has loaded to establish the communication channel between the two. There is another handshake between the workspace and the application when the app will be shutdown. An application can hook into onCreate and onDestroy when calling AmazonConnectApp.init().


The create event results in the onCreate handler passed into the AmazonConnectApp.init() to be invoked. Init should be called in an application once it has successfully loaded and is ready to start handling events from the workspace. The create event provides the appInstanceId and the appConfig.

  • appInstanceId: The ID for this instance of the app provided by the workspace.

  • appConfig: The application configuration being used by the instance for this app.

  • contactScope: Provides the current contactId if the app is opened during an active contact.


The destroy event will trigger the onDestroy callback configured during AmazonConnectApp.init(). The application should use this event to clean up resources and persist data. The workspace will wait for the application to respond that it has completed clean up for a period of time.