> ## Documentation Index
> Fetch the complete documentation index at: https://usefused.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# harnest.durable

> Public Python signatures, fields, and methods.

[All Python modules](https://usefused.com/docs/harnest/reference/api/overview.md) · [Import and compatibility guidance](https://usefused.com/docs/harnest/build/python-imports.md)

## Exports

| Name | Kind |
| - | - |
| [`NativeDurableCall`](#nativedurablecall) | Class |
| [`NativeDurableSuspended`](#nativedurablesuspended) | Class |
| [`NativeResumeInput`](#nativeresumeinput) | Class |
| [`ResumeArtifact`](#resumeartifact) | Class |
| [`adk_durable_tool`](#adk_durable_tool) | Function |
| [`current_native_durable_call`](#current_native_durable_call) | Function |
| [`is_durable_tool`](#is_durable_tool) | Function |
| [`langgraph_durable_callable`](#langgraph_durable_callable) | Function |
| [`native_durable_call`](#native_durable_call) | Function |

## NativeDurableCall

Active native call identity inherited by plugin continuation ports.

```python theme={null}
NativeDurableCall(artifact: ResumeArtifact) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `artifact` | `ResumeArtifact` | `—` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `artifact` | `ResumeArtifact` | Required |
>
> ```python theme={null}
> from harnest.durable import NativeDurableCall
>
> call = NativeDurableCall(artifact=...)
> ```

### NativeDurableCall.submission\_key

```python theme={null}
NativeDurableCall.submission_key(
    *,
    application_id: str,
    user_id: str,
    session_id: str,
    run_id: str,
    provider: str,
    capability: str,
) -> str
```

Derive a stable opaque key that survives framework node replay.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `application_id` | `str` | Required |
> | `user_id` | `str` | Required |
> | `session_id` | `str` | Required |
> | `run_id` | `str` | Required |
> | `provider` | `str` | Required |
> | `capability` | `str` | Required |
>
> ```python theme={null}
> from harnest.durable import NativeDurableCall
>
> call: NativeDurableCall
> result = call.submission_key(
>     application_id=...,
>     user_id=...,
>     session_id=...,
>     run_id=...,
>     provider=...,
>     capability=...,
> )
> ```

### NativeDurableCall.suspend

```python theme={null}
NativeDurableCall.suspend(pending: Any) -> Any
```

Enter the selected framework's persisted suspension primitive.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `pending` | `Any` | Required |
>
> ```python theme={null}
> from harnest.durable import NativeDurableCall
>
> call: NativeDurableCall
> result = call.suspend(pending=...)
> ```

## NativeDurableSuspended

Control flow raised after a framework durably records an external wait.

> [accordion] Example
>
> ```python theme={null}
> from harnest.durable import NativeDurableSuspended
>
> try:
>     ...
> except NativeDurableSuspended as error:
>     ...
> ```

## NativeResumeInput

Private input that asks a framework driver to resume one saved call.

```python theme={null}
NativeResumeInput(artifact: ResumeArtifact, value: Any) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `artifact` | `ResumeArtifact` | `—` |
| `value` | `Any` | `—` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `artifact` | `ResumeArtifact` | Required |
> | `value` | `Any` | Required |
>
> ```python theme={null}
> from harnest.durable import NativeResumeInput
>
> native_resume_input = NativeResumeInput(artifact=..., value=...)
> ```

## ResumeArtifact

Private framework identity required to resume one persisted tool call.

```python theme={null}
ResumeArtifact(
    framework: Literal['adk', 'langgraph'],
    native_invocation_id: str,
    tool_call_id: str,
    tool_name: str,
    version: str = 'harnest-continuation/v1',
) -> None
```

Fields (`—` means no declared default):

| Field | Type | Default |
| - | - | - |
| `framework` | `Literal['adk', 'langgraph']` | `—` |
| `native_invocation_id` | `str` | `—` |
| `tool_call_id` | `str` | `—` |
| `tool_name` | `str` | `—` |
| `version` | `str` | `'harnest-continuation/v1'` |

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `framework` | `Literal['adk', 'langgraph']` | Required |
> | `native_invocation_id` | `str` | Required |
> | `tool_call_id` | `str` | Required |
> | `tool_name` | `str` | Required |
> | `version` | `str` | `'harnest-continuation/v1'` |
>
> ```python theme={null}
> from harnest.durable import ResumeArtifact
>
> artifact = ResumeArtifact(
>     framework=...,
>     native_invocation_id=...,
>     tool_call_id=...,
>     tool_name=...,
> )
> ```

### ResumeArtifact.public\_dict

```python theme={null}
ResumeArtifact.public_dict() -> dict[str, str]
```

Serialize only stable framework identity for durable persistence.

> [accordion] Example
>
> ```python theme={null}
> from harnest.durable import ResumeArtifact
>
> artifact: ResumeArtifact
> result = artifact.public_dict()
> ```

### ResumeArtifact.from\_mapping

```python theme={null}
ResumeArtifact.from_mapping(value: Mapping[str, Any]) -> 'ResumeArtifact'
```

Restore persisted identity without accepting extra compatibility fields.

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `value` | `Mapping[str, Any]` | Required |
>
> ```python theme={null}
> from harnest.durable import ResumeArtifact
>
> artifact = ResumeArtifact.from_mapping(value=...)
> ```

## adk\_durable\_tool

Lower a durable callable to ADK's native long-running tool boundary.

```python theme={null}
adk_durable_tool(value: Callable[..., Any]) -> Any
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `value` | `Callable[..., Any]` | Required |
>
> ```python theme={null}
> from harnest.durable import adk_durable_tool
>
> result = adk_durable_tool(value=...)
> ```

## current\_native\_durable\_call

Return the active framework call without exposing mutation authority.

```python theme={null}
current_native_durable_call() -> NativeDurableCall | None
```

> [accordion] Example
>
> ```python theme={null}
> from harnest.durable import current_native_durable_call
>
> call = current_native_durable_call()
> ```

## is\_durable\_tool

Read the marker propagated through Harnest and framework wrappers.

```python theme={null}
is_durable_tool(value: Any) -> bool
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `value` | `Any` | Required |
>
> ```python theme={null}
> from harnest.durable import is_durable_tool
>
> result = is_durable_tool(value=...)
> ```

## langgraph\_durable\_callable

Inject LangGraph's native tool and thread identities into a callable.

```python theme={null}
langgraph_durable_callable(value: Callable[..., Any]) -> Callable[..., Any]
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `value` | `Callable[..., Any]` | Required |
>
> ```python theme={null}
> from harnest.durable import langgraph_durable_callable
>
> @langgraph_durable_callable
> def my_function():
>     ...
> ```

## native\_durable\_call

Bind native identity only for the dynamic extent of one durable tool.

```python theme={null}
native_durable_call(artifact: ResumeArtifact) -> Iterator[None]
```

> [accordion] Parameters and example
>
> | Parameter | Type | Default |
> | - | - | - |
> | `artifact` | `ResumeArtifact` | Required |
>
> ```python theme={null}
> from harnest.durable import native_durable_call
>
> with native_durable_call(artifact=...):
>     ...
> ```


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