# beforeRun

open suspend fun beforeRun(invocationContext: InvocationContext): CallbackChoice<Unit, Content>

Callback executed before the ADK runner starts the main execution loop.

This is the first callback called in the lifecycle, ideal for global setup or initialization tasks. It provides an opportunity to inspect or log the invocation setup, or to short-circuit the run before it begins.

#### Return

A CallbackChoice where returning CallbackChoice.Break with custom Content halts execution of the runner and resolves the invocation with that content directly. Returning CallbackChoice.Continue with Unit allows execution to proceed normally.

#### Parameters

invocationContext

The context for the entire invocation, containing session information, the root agent, etc.