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

# Renewal Prep Agent

> Build a DinoAI agent that finds HubSpot accounts renewing in 30 days, queries usage from your warehouse, and writes a prep note on each company.

Instead of building a one-off usage deck before every renewal, let a scheduled DinoAI agent do the first pass: find the accounts renewing soon, pull each one's usage and health from the warehouse, and write a plain-English summary straight onto the HubSpot record. Your account team starts the week with the numbers already on the account, not buried in a dashboard nobody opened.

This guide starts deliberately small: one agent built in the Agent UI and one Bolt schedule. Once the basic loop works, the [Extend the Agent](#extend-the-agent) section shows where to take it next.

<Info>
  **Before You Start**

  * A [DinoAI Background Agent Environment](/products/settings/connections/dinoai-background-agent-environment/index) connection so the agent can query your warehouse
  * [HubSpot connected](/products/dino-ai/tools-and-features/hubspot-tool) on the **DinoAI agent** card under **Settings → Integrations**, so the workspace agent can read your CRM and write notes
  * Read the [Programmable Agents Quick Start](/products/dino-ai/programmable-agents/quick-start) first if you have never created an agent
</Info>

## What You'll Build

* One DinoAI agent (`renewal-prep-reporter`) that finds companies with a renewal in the next 30 days, queries their usage from your marts, and adds a summary note to each HubSpot company
* A Bolt schedule that runs it every Monday at 07:00

The note it writes onto each account is short and scannable:

```
🔄 RENEWAL PREP :: <company> :: renews <date>

USAGE (last 90 days)
  <metric>: <last period> → <this period> (<trend>)

NOT USING
  <features paid for but idle, or "none">

FLAG
  <anything the CSM should know before the call, or "none">
```

<Steps>
  <Step title="Create the Agent">
    In the **Agent** app, open **Agents**, select **New agent**, and start from **Start from scratch**. Fill in the builder fields below, replacing the table names and the renewal property with your own. See [Build an agent in the UI](/guides/programmable-agents/build-in-the-agent-ui) for a tour of the builder.

    **Name**: `renewal-prep-reporter`

    **Role**:

    ```text theme={"system"}
    Customer success analyst who preps accounts for their renewal call.
    ```

    **Goal**:

    ```text theme={"system"}
    On every run:

    1. Find the accounts to prep. Search HubSpot companies whose renewal
       date falls in the next 30 days. If you are unsure of the property
       name, list the company properties first and use the real one
       instead of guessing.

    2. For each company, query analytics.marts.fct_account_usage for the
       last 90 days and compute:
       - active users, this period vs the previous 90 days
       - core-feature adoption
       - any features on their plan with zero usage

    3. Write one note onto the company record with four sections:
       a header line (company, renewal date), USAGE (each metric with
       both numbers and the trend), NOT USING (features paid for but
       idle, or "none"), and FLAG (anything the CSM should know, or
       "none").

    4. Keep it to what fits on a card. This is a prep note, not a report.
    ```

    **Backstory**:

    ```text theme={"system"}
    You are a concise CS analyst. One line per metric, numbers always
    paired with the previous period. If a number looks implausible, say
    so in FLAG instead of presenting it as real. Match each warehouse
    account to the right HubSpot company carefully; if you cannot match
    one confidently, skip it and note that rather than writing to the
    wrong record.
    ```

    **Model**: leave **Auto** selected.

    **Allowed tools**: `read_file`, `run_sql_query`, `search_hubspot_objects`, `get_hubspot_object`, `list_hubspot_properties`, `add_hubspot_note`.

    **Output**: leave empty. This agent writes its result to HubSpot directly rather than to a channel.

    Then select **Deploy**: choose **Just here** to make the agent live in the workspace immediately (ideal while you tune it), or **Open a pull request** to commit it as `.dinoai/agents/renewal-prep-reporter.yml` and govern it as code. See [Creating Agents in the App](/products/dino-ai/programmable-agents/creating-agents-in-the-app).

    <Info>
      **Start read-only if you want to review first.** Leave `add_hubspot_note` off the allowlist for the first few runs so the agent drafts each summary in the run logs without writing anything. Add it back once the notes read the way you want. For the full list of HubSpot actions and how their approvals work, see the [HubSpot tool reference](/products/dino-ai/tools-and-features/hubspot-tool).
    </Info>

    <Info>
      Add your warehouse's metadata tools to the allowlist so the agent looks up table structure instead of guessing, for example `list_all_columns_in_snowflake_table` on Snowflake or `list_all_columns_in_bigquery_table` on BigQuery. See the [Tools Reference](/products/dino-ai/programmable-agents/tools-reference).
    </Info>
  </Step>

  <Step title="Run It Once">
    In the Bolt schedule editor, click **Add command**, pick **Run Paradime DinoAI Agent**, choose `renewal-prep-reporter`, and set the task to:

    ```
    Find companies renewing in the next 30 days, pull their last 90 days of usage, and add a renewal prep note to each HubSpot company.
    ```

    Save and hit **Run now**. The agent's messages stream into the Bolt run logs, and the notes land on the matching HubSpot companies. Use the first couple of runs to tune the metric list and the note wording in the `goal` until the summary reads the way a CSM would want it.

    <Info>
      **Watching a run.** A full run can take a few minutes across several accounts. The Bolt run logs stream every agent message live, and the background agent UI shows per-session traces of each tool call and lets you pause a run that has gone off on a tangent.
    </Info>
  </Step>

  <Step title="Schedule It Weekly">
    In the same schedule, open the [trigger](/guides/paradime-101/running-dbt-in-production-with-bolt/understanding-schedule-types-and-triggers) settings, choose the **Cron** trigger, and set it to run every Monday at 07:00 in your timezone. Save and deploy the schedule.

    Monday 07:00 puts a fresh note on every renewing account before the account team plans its week. That's it: the basic loop is done.
  </Step>
</Steps>

## Extend the Agent

Each of these is an independent upgrade. Add them one at a time, only when the basic note starts feeling too shallow.

**Post a run summary to Slack.** Add the [Slack integration](/integrations/slack) and `post_slack_message` to the allowlist, and tell the agent to post one line at the end listing the accounts it prepped, so the CS team sees the run happened without opening HubSpot.

**Score the renewal risk.** Add a line to the `goal` telling the agent to label each account green, amber, or red based on the usage trend and idle features, and put the label in the header line so a glance down the accounts shows where to focus.

**Break usage down by segment.** Tell the agent to split a moved metric by market, product area, or seat type, so the note says "driven by the analyst seats" instead of just "down".

**Move the definitions into a spec file.** When the metric list and thresholds outgrow the Goal field, put them in a markdown file like `.dinoai/specs/renewal-prep.md` (metrics, table locations, what counts as a risk) and change step 1 of the `goal` to "Read the spec file first". CS ops then evolves the definition with a normal PR, without touching the agent.

**Check pipeline health before reporting.** Add `get_all_sources` and `get_model_health` (the [dbt Discovery tools](/products/dino-ai/tools-and-features/dbt-discovery-tools)) to the allowlist and tell the agent to confirm the usage marts are fresh before it writes anything. This is what separates "usage dropped" from "the table did not refresh".

**Update a deal property, not just a note.** Add `update_hubspot_object` to the allowlist and have the agent set a custom "usage health" property on the renewal deal, so the signal shows up in your pipeline views and reports, not only on the record.

#### Related Docs

* [**HubSpot Tool**: the full list of CRM actions and how approvals work](/products/dino-ai/tools-and-features/hubspot-tool)
* [**Programmable Agents Quick Start**: getting started with DinoAI agents](/products/dino-ai/programmable-agents/quick-start)
* [**YAML Configuration**: full reference for agent config options](/products/dino-ai/programmable-agents/yaml-configuration)
* [**Tools Reference**: all available tools, including per-warehouse metadata tools](/products/dino-ai/programmable-agents/tools-reference)
* [**Triggering from Bolt**: scheduling agents with cron and other triggers](/products/dino-ai/programmable-agents/triggering-from-bolt)


## Related topics

- [Prepare for dbt™ v2](/guides/migrations/dbt-version-upgrades/prepare-for-dbt-v2.md)
- [dbt™ version upgrades](/guides/migrations/dbt-version-upgrades/index.md)
- [AWS Glue](/integrations/aws-glue.md)
- [Bulk CSV Upload](/products/settings/environment-variables/bulk-csv-upload.md)
- [Agent-to-Agent Delegation](/products/dino-ai/programmable-agents/agent-to-agent-delegation.md)
