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

# portable • AI Agent SDK

> Move a durable run between processes.

# portable

AI Agent

Move a durable run between processes.

Durable execution is real and thorough -- `agent/durable.py` replays a run
from a journal -- but the journal is a local SQLite file, so a run could only
resume where it started. Pausing on a web worker, putting the state in a queue
and resuming it somewhere that shares no disk was not possible.

This exports a run's journal (its metadata and every event) as a plain dict,
and imports it into another journal:

blob = export\_run(journal, run\_id)          # -> JSON-safe dict
redis.set(key, export\_run\_json(journal, run\_id))

# elsewhere, no shared disk

run\_id = import\_run(other\_journal, blob)

# resume as usual: the replay index is rebuilt from these events

Deliberately a JOURNAL export rather than a new state format: the journal is
already the single source of truth that `DurableRunContext` replays from, so
a second representation would be a second thing to keep correct.

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.runtime import portable
```

## Classes

> **[PortableRunError](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/PortableRunError.md)**
>
> Raised when a run cannot be exported or imported.

## Functions

> **[export\_run()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/export_run.md)**
>
> Everything needed to resume `run_id` in another process.

> **[export\_run\_json()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/export_run_json.md)**
>
> `export_run` as a JSON string, ready for a queue or a form field.

> **[import\_run()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/import_run.md)**
>
> Write an exported run into `journal` and return its run id.

> **[import\_run\_json()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/import_run_json.md)**
>
> `import_run` from a JSON string.

### Constants

| Name | Value |
| - | - |
| `PORTABLE_RUN_VERSION` | `1` |


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