> ## 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.

# Create Thread • AI Agent SDK

> create_thread: Open a new thread/topic under ``target`` (Issue #3987).

# create\_thread

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**OutboundMessengerProtocol**](../classes/OutboundMessengerProtocol) class in the [**protocols**](../modules/protocols) module.

Open a new thread/topic under `target` (Issue #3987).

For multi-agent handoffs, subtasks, and parallel workflow branches, this
lets the gateway scope a subtask into its own platform-native thread
(Telegram forum topic, Discord thread, Slack thread anchor) instead of
flooding the shared channel inline. Gated on the channel's
`PlatformCapabilities.supports_threads` — a channel that cannot thread
returns a typed `unsupported` outcome instead of raising, so the
caller falls back to the parent channel::

res = await messenger.create\_thread("slack:C123", name="research")
target = f"slack:C123:\{res.thread\_id}" if res.ok else "slack:C123"
await messenger.send(target, subtask\_output)

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def create_thread(target: str, name: str) -> 'ThreadResult'
```

## Parameters

<ParamField query="target" type="str" required={true}>
  Symbolic target token ("origin", "\<platform>", or "\<platform>:\<chat\_id>", or a friendly alias).
</ParamField>

<ParamField query="name" type="str" required={true}>
  Human-friendly thread/topic title.
</ParamField>

### Returns

<ResponseField name="Returns" type="'ThreadResult'">
  class:`ThreadResult` carrying the new thread id on success, or a
  typed `unsupported` / `failed` / `no_route` outcome. Never
  raises.
</ResponseField>

## Source

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