Skip to content

Documentation / @agentick/core / useOnExecutionEnd

Function: useOnExecutionEnd() ​

useOnExecutionEnd(callback): void

Defined in: core/src/hooks/lifecycle.ts:204

Register a callback to run when execution completes (after all ticks finish). Fires once per send() call, after the tick loop exits.

Timing: fires after the last tick_end but before the session snapshot is persisted. State changes here are captured in the snapshot.

Parameters ​

callback ​

ExecutionEndCallback

Returns ​

void

Example ​

tsx
useOnExecutionEnd((ctx) => {
  console.log("Execution complete");
  ctx.setState("lastCompleted", Date.now());
});

Released under the ISC License.