---
updatedAt: 2026-09-30T10:53:38.000Z
agentTools:
  projectIndex: https://docs.hud.io/llms.txt
---

# Agentic Workflows

Give your coding agents real production context — automate PR risk checks, health reports, dead-code cleanup, and rollback decisions with Hud runtime data.

An **agentic workflow** is a task you describe once — usually in plain Markdown — and a coding agent (Claude, Codex, Cursor) executes automatically whenever a defined event fires: a pull request opens, a deploy lands, a schedule ticks. Instead of a person prompting an AI by hand in their editor, the agent runs as part of your pipeline.

It's the same shift that CI/CD brought to building and deploying — versioned, governed, automatic — now applied to the work an AI agent does. GitHub calls this pattern *Continuous AI*; the principle holds on any runner.

**A good agentic workflow has three traits:**

* **A clear trigger** that maps to real work — a PR, a webhook, a cron, an issue label.
* **A well-bounded task** with specific inputs and a clear question to answer — not "improve the code," but "score this PR's production risk."
* **A structured output** that keeps a human in the loop — a draft PR, a scored comment, a report — rather than silent changes.

The workflows in this section connect the agent to the **Hud MCP server**, so it reasons over your real runtime data — invocation counts, latency percentiles, error rates, and call graphs — instead of inferring impact from source and diffs alone.

This section is a library of ready-to-run agentic workflows, plus the instructions to set them up in your own repos.

> 📘 New to the Hud MCP server?
>
> Agentic workflows are built on top of the [Hud MCP Server](https://docs.hud.io/docs/hud-mcp-server). If you've only used Hud inside your IDE so far, start there to understand how an agent queries your runtime data — then come back here to automate it.

<br />

***

## How it works

Every workflow is the combination of two things:

* **A use case** — *what* the agent does (e.g. score a PR's blast radius, clean up dead code).
* **A runner** — *where* it executes (GitHub Actions, Cursor, a Claude routine, …).

Any use case can run on any runner. You pick one of each, copy a few files into your repo, set a secret, and ship.

```
   USE CASE                 RUNNER                      RESULT
┌──────────────┐       ┌──────────────────┐       ┌──────────────────┐
│ Blast radius │   ×   │ GitHub Actions   │   →   │ PR comment with   │
│ Weekly report│       │ gh-aw            │       │ a 0–100 score,    │
│ Dead code    │       │ Cursor           │       │ a Slack report,   │
│ Rollback     │       │ Claude routine   │       │ a draft PR, …     │
└──────────────┘       └──────────────────┘       └──────────────────┘
```

Every workflow authenticates to Hud with a single `HUD_MCP_KEY` secret, passed to `npx -y hud-mcp@v2`.

<br />

***

## How this differs from Hud in your IDE

|                       | Hud in your IDE / MCP            | Agentic workflows                                   |
| --------------------- | -------------------------------- | --------------------------------------------------- |
| **Who triggers it**   | You, interactively, while coding | An event (PR, cron, deploy) or a one-line command   |
| **Where it runs**     | Your editor                      | CI, the cloud, or a scheduled runner                |
| **Human in the loop** | Always                           | Optional — can run fully hands-off                  |
| **Typical output**    | An answer in chat                | A PR comment, Slack post, draft PR, or GitHub issue |

Same runtime data, same MCP. The difference is automation: workflows let the agent act without you prompting it each time.

<br />

***

## Prerequisites

Before setting up any workflow, make sure you have:

1. **Instrumented services reporting to Hud.** Workflows query your *production runtime data*, so your services must already have the Hud SDK installed and be sending data. See [Node.js Installation](https://docs.hud.io/docs/nodejs-installation-guide), [Python Installation](https://docs.hud.io/docs/hud-python-installation) or [Java Installation](https://docs.hud.io/docs/java-installation).
2. **A Hud MCP key.** Get one at [app.hud.io → Settings → API keys](https://www.app.hud.io/settings/api-keys?environment=production). You'll set it as the `HUD_MCP_KEY` secret in your runner.
3. **A model provider key** for the agent — typically an `ANTHROPIC_API_KEY` from [console.anthropic.com](https://console.anthropic.com), or AWS Bedrock credentials. See [model authentication in the FAQ](https://docs.hud.io/docs/agentic-workflows-faq).

<br />

***

## The recipe catalog

Four ready-made use cases ship today. Each is runner-agnostic — it uses environment variables and generic instructions, so you can pair it with any runner. See the full [Recipe Catalog](https://docs.hud.io/docs/agentic-workflows-recipes) for env vars, outputs, and examples.

| Recipe                | What it does                                                                                                                                            |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Blast radius**      | Scores the production blast radius of a PR (0–100) by mapping changed code to affected functions and endpoints, then posts a ranked report.             |
| **Weekly report**     | A multi-phase deep-insights report on production health — proposes fixes, attributes contributors, optionally opens a self-heal PR, and posts to Slack. |
| **Dead-code cleanup** | Finds functions with zero production invocations over a lookback window and opens a PR removing them (with an optional Jira ticket).                    |
| **Rollback check**    | Compares current vs. previous release health per version and returns a structured verdict: `ROLLBACK` / `INVESTIGATE` / `WARN` / `CLEAN`.               |

<br />

### Use case × runner matrix

Each cell pairs a recipe with a runner. **See example** cells link to a fully worked, install-ready combo; the rest you assemble yourself by pairing the recipe prompt with the runner template (see [Choosing a Runner](https://docs.hud.io/docs/agentic-workflows-runners)).

|                       |                                                         GitHub Actions                                                         |                                                          gh-aw                                                         |                                                            Cursor                                                           |                                                          Claude routine                                                          |
| --------------------- | :----------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |
| **Blast radius**      | ✅ [see example](https://github.com/code-hud/hud-agentic-workflows-recipes/tree/main/full-examples/blast-radius-github-actions) |                                                       mix & match                                                      |                                                         mix & match                                                         |                                                            mix & match                                                           |
| **Weekly report**     |                                                           mix & match                                                          | ✅ [see example](https://github.com/code-hud/hud-agentic-workflows-recipes/tree/main/full-examples/weekly-report-gh-aw) |                                                         mix & match                                                         |                                                            mix & match                                                           |
| **Dead-code cleanup** |                                                           mix & match                                                          |                                                       mix & match                                                      | ✅ [see example](https://github.com/code-hud/hud-agentic-workflows-recipes/tree/main/full-examples/dead-code-cleanup-cursor) |                                                            mix & match                                                           |
| **Rollback check**    |                                                           mix & match                                                          |                                                       mix & match                                                      |                                                         mix & match                                                         | ✅ [see example](https://github.com/code-hud/hud-agentic-workflows-recipes/tree/main/full-examples/rollback-check-claude-routine) |

<br />

***

## Where everything lives

All recipes, runner templates, and fully worked examples are open source in the [**hud-agentic-workflows-recipes**](https://github.com/code-hud/hud-agentic-workflows-recipes/tree/main) repository — the source of truth this documentation is based on. The repo is MIT-licensed and community-extensible.

<br />

## Next steps

* **[Quick Start](https://docs.hud.io/docs/agentic-workflows-quick-start)** — set up your first workflow (PR blast-radius on GitHub Actions) in about 10 minutes.
* **[Choosing a Runner](https://docs.hud.io/docs/agentic-workflows-runners)** — compare runners and get step-by-step setup for each.
* **[Recipe Catalog](https://docs.hud.io/docs/agentic-workflows-recipes)** — the four use cases in detail.
* **[FAQ & Best Practices](https://docs.hud.io/docs/agentic-workflows-faq)** — common questions, cost, security, scoping, model auth, and fixes.

<br />

<HTMLBlock>{`
<b>Need Help?</b>
<a href="https://www.app.hud.io/?support_chat=true" target="_blank">Chat with our support team</a>
or email us at
<a href="mailto:support@hud.io" target="_blank">support@hud.io</a>.
`}</HTMLBlock>