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

# Import Run • AI Agent SDK

> import_run: Write an exported run into ``journal`` and return its run id.

# import\_run

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

> This function is defined in the [**portable**](../modules/portable) module.

Write an exported run into `journal` and return its run id.

Refuses to import over an existing run unless `overwrite=True`: silently
merging two runs' events would produce a replay index that belongs to
neither, and the failure would surface much later as a confusing resume.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def import_run(journal: RunJournal, blob: Dict[str, Any]) -> str
```

## Parameters

<ParamField query="journal" type="RunJournal" required={true}>
  No description available.
</ParamField>

<ParamField query="blob" type="Dict[str, Any]" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  The result of the operation.
</ResponseField>

## Uses

* `PortableRunError`
* `journal.run_meta`
* `JournalEvent`
* `journal.delete_run`
* `journal.open_run`
* `journal.close_run`

## Used By

* [`import_run_json`](../functions/import_run_json)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/portable.py#L85">
  `praisonaiagents/runtime/portable.py` at line 85
</Card>
