# Session

> > This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

# Session

> This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

Creates a session attached to an agent within the formation's project.

## Syntax

```yaml
type: session
properties:
  agent_id: String
  name: String
  actor_id: String
  auto_generate: Boolean
  inactivity_ttl_seconds: Integer
  tool_context: Object
```

## Output

The physical resource ID is the **public ID** of the created resource. Reference it from other resources with a `ref` expression:

```yaml
      some_field:
        ref: MySession
```

## Properties

**`agent_id`**

Public ID of the agent that owns this session

_Required_: Yes
_Type_: String

---

**`name`**

Human-readable label for the session

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`actor_id`**

Public ID of an actor to associate with this session

_Required_: No
_Type_: String
_Nullable_: Yes

---

**`auto_generate`**

Whether to automatically generate a response when messages are sent

_Required_: No
_Type_: Boolean

---

**`inactivity_ttl_seconds`**

Number of seconds of inactivity after which the session expires. 0 means never expires.

_Required_: No
_Type_: Integer

---

**`tool_context`**

Optional context object passed to tool calls

_Required_: No
_Type_: Object
_Nullable_: Yes

---
