> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# In Process Turn Executor • AI Agent SDK

> InProcessTurnExecutor: Default turn executor — today's on-loop behaviour, no isolation.

# InProcessTurnExecutor

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Default turn executor — today's on-loop behaviour, no isolation.

Zero-cost, dependency-free implementation of
:class:`TurnExecutorProtocol` for single-process deployments. It runs each
turn directly on the current event loop exactly as the gateway does today,
so selecting it (or leaving the executor unset) is byte-for-byte backward
compatible and introduces no dependency. It provides **no** blast-radius
isolation: a turn that wedges the loop still affects the process — choosing
an isolated executor (subprocess / container / remote, in the wrapper) is
what contains a bad turn to its own worker.

All turns share one worker (the current process/loop), so every placement
carries the same constant `worker_id` at `epoch` 0, and `teardown`
is inert — an in-process turn is cancelled through the existing
`cancel_token` when the holding task exits, so there is no worker to
reclaim. The `limits` argument is accepted for protocol symmetry but is
inert here (no separate worker to bound).

## Methods

<CardGroup cols={2}>
  <Card title="place()" icon="function" href="../functions/InProcessTurnExecutor-place">
    Instance method.
  </Card>

  <Card title="execute_turn()" icon="function" href="../functions/InProcessTurnExecutor-execute_turn">
    Instance method.
  </Card>

  <Card title="teardown()" icon="function" href="../functions/InProcessTurnExecutor-teardown">
    Instance method.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L5729">
  `praisonaiagents/gateway/protocols.py` at line 5729
</Card>
