Skip to main content
You can terminate an invocation that’s running. This is useful for stopping automations or agents stuck in an infinite loop.
Terminating an invocation also destroys any browsers associated with it.

Via API

You can stop an invocation by setting its status to failed. This will cancel the invocation and mark it as terminated.
import Kernel from '@onkernel/sdk';

const client = new Kernel({
  apiKey: 'My API Key',
});

const invocation = await client.invocations.update('invocation_id', {
  status: 'failed',
  output: JSON.stringify({ error: 'Invocation cancelled by user' })
});

Via CLI

Use ctrl-c in the terminal tab where you launched the invocation.
I