---
title: "Sign-up Review Agent"
description: "This agent reviews each new Dex Cloud sign-up with admins in Slack. It applies their decision on the account and sends the applicant a welcome email."
canonical_url: "https://docs.superdurable.io/examples/sign-up-review-agent/"
source: "docs/content/use-cases/signup-review-agent.mdx"
locale: "en"
---

> Index of every page for AI agents: https://docs.superdurable.io/llms.txt

# Sign-up Review Agent

This agent reviews each new Dex Cloud sign-up with admins in Slack. It applies their decision on the account and sends the applicant a welcome email.

**SDKs:** TypeScript and Go, in its own repository: [superdurable-apps/dex-signup-agent-demo](https://github.com/superdurable-apps/dex-signup-agent-demo)

**Shows:** [agent sessions](https://docs.superdurable.io/build-ai-agents/use-dex-with-agent-sdks.md#how-it-works), [Connectors as Tools](https://docs.superdurable.io/build-ai-agents/connectors-as-tools.md), a [Connector Trigger](https://docs.superdurable.io/reference/agents/connector-triggers.md#start-and-feed-sessions), a wait of days for a person, and [Time Travel](https://docs.superdurable.io/production-operations/operate-and-debug.md#time-travel).

## Product requirements

<a id="what-the-agent-does"></a>

1. It looks the applicant up on GitHub and on their profile page or website.
2. It posts a review in a Slack channel: a recommendation to approve or reject, its reasons, and a draft welcome email.
3. It waits, for minutes or days, for a reviewer to reply in the review's thread.
4. A reviewer replies `approve`, `reject <reason>`, or `hold`. Any other reply is feedback on the email, and the agent posts a new draft.
5. After the approval, a reviewer replies `send`. The agent sends the latest draft from the team's Gmail.
6. The agent posts a summary in the thread and ends the review.

## Flow design

<a id="how-it-maps-to-dex"></a>

Each sign-up gets one agent session, a Flow with the ID `signup-review-<accountId>`. A loop in the Worker lists the pending sign-ups registered since a configured cutoff, every 30 seconds by default. It starts a session for each one, with the sign-up data as the first message. The start uses the fixed Flow ID, disallows its reuse, and treats an already started review as done, so each account gets one review.

The application is the agent's prompt and nine tools. Each tool's [effect class](https://docs.superdurable.io/build-ai-agents/use-dex-with-agent-sdks.md#give-each-tool-a-policy) decides how Dex runs it:

| Tool                                           | What it does                                            | Effect class           | Runs in                                       |
| ---------------------------------------------- | ------------------------------------------------------- | ---------------------- | --------------------------------------------- |
| `github_user`, `fetch_profile`                 | Read the applicant's GitHub profile and web page        | `read`                 | `CallTool`, with retries                      |
| `post_review`, `post_draft`, `reply_in_thread` | Post the review, a new draft, or a note in Slack        | `non_idempotent_write` | `CallSingleAttemptTool`, with bounded resends |
| `approve_account`, `reject_account`            | Decide the account, then post the outcome in the thread | `non_idempotent_write` | `CallSingleAttemptTool`, with bounded resends |
| `send_welcome_email`                           | Send the latest draft with Gmail                        | `non_idempotent_write` | `CallSingleAttemptTool`, with bounded resends |
| `finish_review`                                | End the session once the account is decided             | `idempotent_write`     | `CallTool`, with retries                      |

The Slack and Gmail tools come from the official Slack and Gmail Connectors, so the app has no Slack or Gmail client code. Each operation's manifest sets its effect class. The Slack and Gmail write operations used here allow at most three sends per call.

The same prompt and tools run on three harnesses: Pi and the Claude Agent SDK in TypeScript, and Eino in Go. With the Claude Agent SDK, one `RunModel` Step runs a turn segment, with the model calls and the reads inside it. Each write runs in its own Step. [Agent SDK adapters](https://docs.superdurable.io/reference/agents/agent-sdk-adapters.md) shows which Steps each one runs.

<a id="wait-for-a-reviewer"></a>

## Wait for a reviewer

After `post_review`, the session waits in `AwaitUserMessage` without holding a Worker.

The Slack Connector's `threadReplyCreated` Trigger delivers the replies. It keeps only thread replies from the listed reviewers, finds the session that owns the thread, and sends the reply through the session's `send_user_message` RPC. Each reply wakes the session for one turn.

<a id="recover-a-failed-email-send"></a>

## Recover a failed email send

The welcome email should go out once. When Gmail's answer is lost, the Gmail Connector searches Sent Mail and sends again only when it finds no copy, at most three times for the call. When Gmail rejects the message, nothing was sent and the call fails.

If the outcome is still unknown, Dex records the call as `outcome_unknown` and does not run it again. The agent asks the admins in the thread to check Sent Mail. The tool also refuses another send of a draft that this review recorded as sent or unknown.

To send it, first confirm in Sent Mail that the email did not go out, and fix the cause, such as an expired Gmail connection. Then use Time Travel: move the session back to right before the send. The session's records go back with it, and the send runs again in the same run as a new attempt.

<a id="run-it"></a>

## Run it

The agent runs from its own repository, outside the playground that [Run an example from the playground](https://docs.superdurable.io/install.md#run-an-example-from-the-playground) starts. You need Node.js 22.19 or later, `dexcli`, a Slack app, and a Gmail account to send from.

These steps run the TypeScript harnesses. For the Go Eino harness, run `make run-eino` from the repository root in step 4; it needs Go 1.26 or later.

1. Start Dex with `dexcli dev`.
2. In Dex Web, open **Connectors** and add two connections: `review-slack` for Slack and `welcome-gmail` for Gmail.
3. Copy `.env.example` to `.env`, and fill in the review channel, the reviewers, and the model settings.
4. Run `npm ci && npm start`.
5. Reply in the review's thread in Slack, and watch the session `signup-review-<accountId>` in Dex Web.

The repository lists every setting, the Slack app's scopes, and how to run the agent on Dex Cloud.

## Next

- [Release Watch Agent](https://docs.superdurable.io/examples/release-watch-agent.md): a scheduled digest that two agents judge and triage with your team.
- [Order Support Agent](https://docs.superdurable.io/examples/order-support-agent.md): one agent built in each agent framework.
- [Build AI Agents](https://docs.superdurable.io/build-ai-agents.md): what Dex adds to an agent, and how to build one.
- [Connectors as Tools](https://docs.superdurable.io/build-ai-agents/connectors-as-tools.md)
- [Give each tool a policy](https://docs.superdurable.io/build-ai-agents/use-dex-with-agent-sdks.md#give-each-tool-a-policy)
