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

# collapse • AI Agent SDK

> collapse: Project a ``RunTerminal`` onto the existing ``RunStatus`` vocabulary.

# collapse

Function

> This function is defined in the [**run\_outcome**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/run_outcome.md) module.

Project a `RunTerminal` onto the existing `RunStatus` vocabulary.

Collapses to exactly one of `success`/`timeout`/`cancelled`/
`failure` for all downstream consumers.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def collapse(outcome: RunTerminal) -> RunStatus
```

## Parameters

**outcome** `RunTerminal` *required*

No description available.

### Returns

**Returns** `RunStatus`

The result of the operation.

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/run_outcome.py#L447)**
>
> `praisonaiagents/run_outcome.py` at line 447


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.