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

# autogen.agentchat.a_initiate_group_chat

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### a\_initiate\_group\_chat

```python theme={null}
a_initiate_group_chat(
    pattern: Pattern,
    messages: list[dict[str, Any]] | str,
    max_rounds: int = 20
) -> tuple[ChatResult, ContextVariables, 'Agent']
```

Initialize and run a group chat using a pattern for configuration, asynchronously.<br />

<b>Parameters:</b>

| Name         | Description                                                                                |
| ------------ | ------------------------------------------------------------------------------------------ |
| `pattern`    | Pattern object that encapsulates the chat configuration.<br /><br />**Type:** Pattern      |
| `messages`   | Initial message(s).<br /><br />**Type:** list\[dict\[str, typing.Any]] \| str              |
| `max_rounds` | Maximum number of conversation rounds.<br /><br />**Type:** int<br /><br />**Default:** 20 |

<b>Returns:</b>

| Type                                                                                                                                                                      | Description                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| tuple\[[ChatResult](/docs/api-reference/autogen/ChatResult), [ContextVariables](/docs/api-reference/autogen/agentchat/group/context_variables/ContextVariables), 'Agent'] | ChatResult: Conversations chat history. ContextVariables: Updated Context variables. "ConversableAgent": Last speaker. |

<br />
