---
title: "Show sessions in Dex Web"
description: "dex-web}"
canonical_url: "https://docs.superdurable.io/reference/agents/dex-web/"
source: "docs/reference/agents/dex-web.mdx"
locale: "en"
---

<a id="dex-web"></a>

# Show sessions in Dex Web

[Dex Web](https://docs.superdurable.io/reference/web/dex-web.md) draws a Flow and offers its Actions from a
Flow Definition Graph. **dexcli visualize** cannot read the session Flow,
because the Flow lives in the agents package and each application chooses its
Flow type. The Python and TypeScript packages ship the session graph instead.

<a id="upload-the-graph"></a>

## Upload the session graph from the Worker

Since 0.5.0. With server-zd 0.1.26 or later, the Worker uploads the graph to
the Dex Server when it starts, and Dex Web reads it from there. Pass the
document that **session_flow_definition_document** (Python) or
**sessionFlowDefinitionDocument** (TypeScript) returns for each agent, with the
agent's Flow type and the permission its Actions require, such as
**SupportAgent** and **support-agent.operate**. Python takes it in
**WorkerOptions.flow_definitions**, and TypeScript in
**WorkerOptions.flowDefinitions**.

The Worker uploads only the Flow types it registers. A failed upload, such as
on an older server, logs a warning, and the Worker still starts. See Flow
definitions in the [Python](https://docs.superdurable.io/reference/python/workers.md#flow-definitions) and
[TypeScript](https://docs.superdurable.io/reference/typescript/workers.md#flow-definitions) Worker references.

The document's generation time is the time the graph template last changed,
the same in both packages. Restarting a Worker writes nothing, and Workers of
an upgraded package replace the graph. The server keeps a stored graph whose
generation time is the same or later, so changing only the permission does not
replace it. To change the permission, upload the new document once with
**force**, through **upload_flow_definitions** or **uploadFlowDefinitions** on
the Client.

The Dex Agents CLI commands also upload the graph of their session Flow type
when they start. Their Actions require the permission **dex-agents-cli.operate**.

<a id="render-the-graph"></a>

## Render the session graph

For a server older than 0.1.26, render the graph to a file instead. Render it
once for each agent, with the agent's Flow type and the permission its Actions
require:

```bash
dex-agents-session-graph --flow-type SupportAgent --permission support-agent.operate \
  --out definitions/support-agent.json
```

Both packages install the **dex-agents-session-graph** command, and both write
the same bytes. In code, call **render_session_flow_graph** in Python or
**renderSessionFlowGraph** in TypeScript. Point Dex Web at the directory:

```bash
dex-web --flow-rendering-dir ./definitions
```

On a development machine, **dexcli dev --flow-rendering-dir ./definitions**
does the same. Render the files in the build or deployment step that ships the
Workers, and mount the directory into Dex Web. Dex Web reads the directory
when it starts, so restart it after a file changes. Render the files again
after you upgrade the agents packages.

<a id="what-dex-web-shows"></a>

## What Dex Web shows

The graph shows every session Step, its wait conditions, the RPCs, and the
Channels between them. It leaves out Attribute reads and writes. Dex Web offers
four Actions: **resolve_interrupt**, **answer_question**, **steer_user_message**,
and **cancel_turn**. Each takes its request fields as input, such as the
interrupt ID and the decision, and requires the permission you chose. The
Actions have no condition, because each RPC checks the session state itself.
Dex Web offers all four while the session runs, and an RPC that does not apply
returns false. Read the interrupt ID from **PendingInterrupts** in the run's
state, or from the session snapshot.

The run page of a session also has an **Agent session** tab. It shows the
conversation with each tool call where the agent made it, one approval card for
each pending call, and a message box with **Steer** and **Stop turn**. The tab
reads the session's Attributes directly, so it still shows the session while its
Workers are down. It can also edit the session's settings and start a new
session with a first message and settings. See
[Agent session view](https://docs.superdurable.io/reference/web/dex-web.md#agent-session-view).

The session declares no Summary or Display fields, so Dex Web shows a session
without calling a Worker. Actions still need a Worker.

Dex Web shows an Action form only to a user **Working as** its permission.
The session Actions have no condition, so **Working as** hides no session of
the agent. It lists every session whose Flow type offers the permission.

The agent mode of Work Queue lists the sessions that wait for a person, grouped
by agent, and answers them in its side panel. See
[Agent inbox](https://docs.superdurable.io/reference/web/dex-web.md#agent-inbox). A session appears there only
while its Flow searches by active Step type, which **start_session** turns on.
See [Find sessions that need a person](https://docs.superdurable.io/reference/agents/approvals.md#find-sessions).
