- Categories:
APPLICATION_CALLBACK_HISTORY¶
Returns information about the history of callback invocations for Snowflake Native Apps in your Snowflake account. Each row represents a callback invocation, including the callback type, execution mode, state, and any error information.
Syntax¶
Optional arguments¶
APPLICATION_NAME => 'application_name'The name of the app for which to retrieve callback history. If not specified, returns history for all apps in the account.
CALLBACK_TYPE => 'callback_manifest_name'The callback type as defined in the manifest file. If not specified, returns history for all callback types in the specified app.
LIMIT => numberThe maximum number of rows to return. Default is 100. Maximum is 10000.
Usage notes¶
When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Snowflake Information Schema.
The
QUERY_TEXTandERROR_MESSAGEcolumns are redacted unless the caller is the app itself.Using this function requires one of the following:
OWNERSHIP on the app.
MONITOR privilege on the app.
Running as the app itself.
Output¶
The function returns the following columns:
Column Name |
Data Type |
Description |
|---|---|---|
TYPE |
VARCHAR |
The callback type as defined in the manifest file. |
EXECUTION_MODE |
VARCHAR |
The execution mode of the callback. Possible values are: |
APPLICATION_NAME |
VARCHAR |
The name of the app that defines the callback. |
STATE |
VARCHAR |
The state of the callback execution. See Callback states. |
STARTED_ON |
TIMESTAMP_LTZ |
The timestamp when the callback was invoked. |
COMPLETED_ON |
TIMESTAMP_LTZ |
The completion timestamp. NULL if the callback has not yet completed. |
TRIGGERING_QUERY_ID |
VARCHAR |
The query ID of the SQL statement that triggered the callback. NULL if the callback was not triggered by a SQL query (for example, when triggered after an upgrade completes). |
QUERY_ID |
VARCHAR |
The query ID of the callback procedure execution. NULL if the callback has not yet completed. |
QUERY_TEXT |
VARCHAR |
The procedure call SQL text. NULL if the callback has not yet completed. This column is redacted unless the caller is the app itself. |
ERROR_CODE |
VARCHAR |
The error code. NULL unless STATE is |
ERROR_MESSAGE |
VARCHAR |
The error message. NULL unless STATE is |
Callback states¶
The following table describes the possible values for the STATE column:
State |
Applies to |
Description |
|---|---|---|
|
Async only |
The callback is waiting to be scheduled. |
|
Async only |
The callback has been scheduled and is waiting to be executed. |
|
Async / Sync |
The callback procedure is currently running. |
|
Async / Sync |
The callback procedure finished successfully. |
|
Async / Sync |
The callback procedure failed validation (for example, wrong signature) or execution. |
|
Async only |
An internal scheduling error occurred. This state requires support intervention. |
Examples¶
Retrieve the callback history for a specific application:
Retrieve the callback history for a specific callback type with a custom limit: