import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const invocation = await client.invocations.retrieve('rr33xuugxj9h0bkf1rdt2bet');
console.log(invocation.id);{
"id": "rr33xuugxj9h0bkf1rdt2bet",
"app_name": "my-app",
"version": "1.0.0",
"action_name": "analyze",
"started_at": "2024-05-19T15:30:00.000000000Z07:00",
"status": "succeeded",
"payload": "{\"data\":\"example input\"}",
"output": "{\"result\":\"success\",\"data\":\"processed input\"}",
"finished_at": "2024-05-19T15:30:05.000000000Z07:00",
"status_reason": "Invocation completed successfully"
}Get details about an invocation’s status and output.
import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const invocation = await client.invocations.retrieve('rr33xuugxj9h0bkf1rdt2bet');
console.log(invocation.id);{
"id": "rr33xuugxj9h0bkf1rdt2bet",
"app_name": "my-app",
"version": "1.0.0",
"action_name": "analyze",
"started_at": "2024-05-19T15:30:00.000000000Z07:00",
"status": "succeeded",
"payload": "{\"data\":\"example input\"}",
"output": "{\"result\":\"success\",\"data\":\"processed input\"}",
"finished_at": "2024-05-19T15:30:05.000000000Z07:00",
"status_reason": "Invocation completed successfully"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The invocation ID
App invocation retrieved successfully
ID of the invocation
"rr33xuugxj9h0bkf1rdt2bet"
Name of the application
"my-app"
Version label for the application
"1.0.0"
Name of the action invoked
"analyze"
RFC 3339 Nanoseconds timestamp when the invocation started
"2024-05-19T15:30:00.000000000Z07:00"
Status of the invocation
queued, running, succeeded, failed "succeeded"
Payload provided to the invocation. This is a string that can be parsed as JSON.
"{\"data\":\"example input\"}"
Output produced by the action, rendered as a JSON string. This could be: string, number, boolean, array, object, or null.
"{\"result\":\"success\",\"data\":\"processed input\"}"
RFC 3339 Nanoseconds timestamp when the invocation finished (null if still running)
"2024-05-19T15:30:05.000000000Z07:00"
Status reason
"Invocation completed successfully"