# client.flows

> client.flows — the flows operations.

`client.flows` — the `flows` operations.

On `AsyncKindgi` every method is the same, awaited.

## `client.flows.list()`

```python signature
list(
    *,
    limit: int | None = None,
    cursor: str | None = None,
    name: str | None = None,
    scope_kind: Literal['tenant', 'org', 'project'] | None = None,
    scope_id: str | UUID | None = None,
    inherit: bool | None = None,
    include_retired: bool | None = None,
    timeout: float | None = None,
) -> FlowCollectionPage
```

List flows. `GET /v1/flows`

Cursor-paginated list of the latest version per flow id. Optional `?name=` filters by prefix on flow id. A retired flow (every version unregistered) is listed only with `?includeRetired=true`, as its highest version with `unregisteredAt`, so it can be found and a version reinstated.

## `client.flows.publish()`

```python signature
publish(
    body: PublishFlowBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> PublishFlowResult
```

Publish a flow definition. `POST /v1/flows`

Body is a full flow JSON. Server validates via `@kindgi/flow.loadFlow` before persisting. Node handler code is not uploaded through this route.

## `client.flows.get()`

```python signature
get(
    flow_id: str | UUID,
    /,
    *,
    project_id: str | UUID | None = None,
    timeout: float | None = None,
) -> Flow
```

Fetch the latest version of a flow. `GET /v1/flows/{flowId}`

An item more than one project serves (an environment order carries it to later environments) answers its newest active version that can run in a project the caller reads, and `404` when there is none. `projectId` narrows that to one project. An item with one project answers its latest active version.

## `client.flows.list_versions()`

```python signature
list_versions(
    flow_id: str | UUID,
    /,
    *,
    limit: int | None = None,
    cursor: str | None = None,
    include_tombstoned: bool | None = None,
    timeout: float | None = None,
) -> FlowCollectionPage
```

List versions of a flow. `GET /v1/flows/{flowId}/versions`

Cursor-paginated. Sort order is binding-defined (for example semver asc). Defaults to active versions only. Pass `?includeTombstoned=true` to include unregistered versions too, each with `unregisteredAt`: a retired flow (every version unregistered) answers too, with its versions to reinstate.

## `client.flows.get_version()`

```python signature
get_version(
    flow_id: str | UUID,
    version: str,
    /,
    *,
    timeout: float | None = None,
) -> Flow
```

Fetch a specific flow version. `GET /v1/flows/{flowId}/versions/{version}`

## `client.flows.unregister()`

```python signature
unregister(
    flow_id: str | UUID,
    version: str,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> UnregisterFlowResult
```

Unregister a specific flow version. `POST /v1/flows/{flowId}/versions/{version}/unregister`

## `client.flows.reinstate_version()`

```python signature
reinstate_version(
    flow_id: str | UUID,
    version: str,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> ReinstateFlowVersionResult
```

Reinstate a specific tombstoned flow version. `POST /v1/flows/{flowId}/versions/{version}/reinstate`

Un-tombstones a previously-unregistered version: clears the tombstone on that version and recomputes the latest active version. Restores the manifest bytes verbatim (semver hygiene). Idempotent — reinstating an active version returns `wasTombstoned: false`. Reactivates a fully-retired flow identity when applicable. Publish is always allowed regardless of retirement state — this verb restores previously-published bytes; a fresh publish is the way to bring a flow back with new bytes.
