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

# Record Completed Run • AI Agent SDK

> record_completed_run: Persist a pointer to the trace file of the just-completed run.

# record\_completed\_run

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**last\_run**](../modules/last_run) module.

Persist a pointer to the trace file of the just-completed run.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def record_completed_run(trace_path: Any, meta: Optional[Dict[str, Any]]) -> Path
```

## Parameters

<ParamField query="trace_path" type="Any" required={true}>
  Path to the trace artifact (JSON or JSONL).
</ParamField>

<ParamField query="meta" type="Optional" required={false}>
  Optional run metadata (agent name, status, etc.).
</ParamField>

### Returns

<ResponseField name="Returns" type="Path">
  The path the pointer was written to.
</ResponseField>

## Uses

* `resolve`
* `Path`
* `time.time`
* `last_run_pointer_path`
* `json.dumps`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/trace/last_run.py#L60">
  `praisonaiagents/trace/last_run.py` at line 60
</Card>


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