Automate budget follow-up

Learn how to send Ternary budget alerts to an AI agent or workflow tool, so the alert explains itself, reaches the right owner and lands where finance already works.

A budget alert tells you a budget is at risk. It doesn't tell you why, who owns the change, or whether it matters for the whole department. Finding that out usually means a chase across email threads, often after the money is spent.

Ternary Webhooks close that gap. When a budget alert fires, Ternary sends the alert to a tool you choose, at the same moment it emails the budget owner and posts to Slack. That tool can then do the follow-up for you: investigate the cause in Ternary, write the finding into your budget sheet, open a ticket, or start an approval.

How it works

  1. Ternary evaluates your budgets once a day.
  2. A threshold is crossed. For example, projected spend for the month exceeds 100% of the budget.
  3. Ternary sends the alert to everyone and everything subscribed to it: email recipients, Slack channels and Webhooks.
  4. The Webhook delivers the alert to your tool, such as a Claude routine, a ChatGPT workspace agent, or a workflow in Zapier, Make or Power Automate.
  5. Your tool takes the next step. An AI agent can investigate with Ternary MCP; a workflow can create a ticket or request an approval.
📘

A Webhook is a destination

A Ternary admin creates a Webhook once. After that, anyone with permission to set up notifications can select it on a budget alert, next to the people and Slack channels the alert already goes to. People keep getting the same emails and Slack messages they get today.

Choose a Webhook

WebhookWhat the alert startsGood for
Claude RoutineA Claude agent that investigates the alert using Ternary MCPExplaining the overrun: what drove it, who owns it, how much it matters
OpenAI Workspace AgentA ChatGPT workspace agent that investigates the alert using Ternary MCPThe same investigation, if your team works in ChatGPT
Custom HTTPSAny tool that accepts a webhook, such as Zapier, Make, Power Automate or your own serviceRouting: tickets, approvals, Teams messages, ERP or planning-tool updates

You can attach more than one Webhook to the same alert. For example, a Claude routine can investigate while a Power Automate flow opens an approval.

Before you start

  • A Ternary admin needs to create the Webhook. See Who can set up and use webhooks?
  • Permission to set up notifications on the budget, to attach the Webhook to its alerts.
  • For a Claude Routine: a claude.ai Pro plan or above with Claude Code on the web, and the Ternary connector connected in claude.ai (Settings › Connectors). See Connect Claude.
  • For an OpenAI Workspace Agent: a ChatGPT workspace where you can create and publish workspace agents, with the Ternary connector. See Connect ChatGPT.
  • For Custom HTTPS: an account in your workflow tool, or a public HTTPS endpoint your team runs.

Set up a Webhook

Every workflow on this page follows the same three steps:

  1. Create the destination in the other tool, and copy its endpoint URL and token. Each example workflow below shows how.
  2. Create the Webhook in Ternary. A Ternary admin does this in Admin › Integrations › Webhooks. See Webhooks for each field and how to test the connection.
  3. Attach the webhook to a budget alert, as described below.
🚧

Treat the URL and token like a password

Anyone with both can start your workflow. If an admin is creating the webhook for you, share them through your password manager rather than email or chat.

Attach the Webhook to a budget alert

  1. Open Budgets from the Cost Assist section and create or edit a budget. See Budgets.
  2. In the alerts step, add a rule. For early warning, use projected spend, for example Monthly, 100% of projected period total. You can add a second rule on actual spend, such as 80%.
  3. Select Add Subscribers › Webhooks and choose your webhook.
  4. Review and submit the budget.
📘

When will the first alert arrive?

Ternary sends an alert once per threshold per budget period. Creating or editing a budget evaluates it straight away, but that evaluation doesn't send alerts.

So if a budget is already past a threshold when you add the webhook, the webhook receives nothing until a new threshold is crossed or the next period starts. To see the workflow run sooner, add a threshold the budget hasn't crossed yet.

Alerts on sub-budgets (allocations of a hierarchical budget) aren't sent to webhooks. Add the webhook to the parent budget instead.

What Ternary sends

Each webhook receives the same content as the budget alert email, as plain text: the headline, a summary of spend or projected spend against the budget, a link to the budget in Ternary, and a footer. For example:

Spend Is Forecasted to Exceed 100% of "Data Platform – Google Cloud" Budget

Highlights
- Your spend for budget "Data Platform – Google Cloud" in tenant "Acme" is forecasted
  to reach $49,900 for November 2026, exceeding 100% of your $45,000 budget.

Next steps
- View budget: https://my.ternary.app/budgets/<budget ID>?tenant_id=<tenant ID>

How the alert is packaged depends on the webhook kind:

  • Claude Routine: the alert text starts a new routine session as its input.
  • OpenAI Workspace Agent: the alert text is sent as the agent's input. Every alert for the same budget continues the same agent conversation, so the agent can refer back to earlier alerts for that budget.
  • Custom HTTPS: a signed JSON message with the alert's headline, summary and link as separate fields, ready to map into your workflow.

For exact request formats, retries and delivery timeouts, see What does Ternary send?

Example workflow 1: An AI agent explains the overrun (Claude Routine)

The situation: your CFO tracks the Data Platform budget in a Google Sheet. Cloud spend comes from Ternary; contractors, licenses and hardware come from the ERP. On day 2 of the month, projected Google Cloud spend passes the $45,000 budget.

What the routine does overnight:

  1. Where are we? Reads the budget in Ternary: $49,900 projected against $45,000, at risk.
  2. What changed? Compares spend by service with last month and finds a new marketplace subscription costing about $400 a day since the 1st. The largest service is below its usual rate, so it's ruled out.
  3. Who owns it? Finds no owner label on the new charge.
  4. Does it matter overall? Reads the ERP lines from the sheet: $106k projected against a $114k department plan.

What finance sees in the morning: cloud is over budget, but the department is within plan. There's a specific new charge with no owner yet, so the Data Platform lead has time to decide before close.

Figures are illustrative.

Set up the routine

  1. In claude.ai, go to Code › Routines and select New routine. No repository is needed.
  2. Under Connectors, add Ternary. The routine sees exactly what you can see in Ternary, no more.
  3. To have the routine post its summary somewhere, add that connector too (for example Slack or Gmail) and say where to post in the prompt.
  4. Paste a prompt. Use the template below as a starting point.
  5. Edit the routine, select Add another trigger › API, then select Generate token. Copy the fire URL and the token. The token is shown only once.
  6. Create a Claude Routine webhook in Ternary with the fire URL and token, or ask an admin to. See Webhooks.
  7. Attach the webhook to the budget alert.

Prompt template. Replace the label names with the ones your organization uses:

You investigate Ternary budget alerts for the finance team. The alert text is in the
message that started this run.

If the message is "Ternary webhook test", reply "Test received" and stop.

Use the Ternary connector to read data only. Do not create, change or delete anything
in Ternary.

1. Find the budget named in the alert. Report its amount, spend to date, projected
   period-end spend and health status.
2. Compare spend in the budget's scope by service: this period to date against the same
   days last period. Name the service or charge that moved most. Say whether the largest
   service is behaving normally.
3. Check whether the spend that moved has a "team" or "cost-centre" label. If not, say
   that no owner is labelled.
4. Write a summary of five lines or fewer for finance: what drove it, who owns it, how
   much it matters for the budget, and one suggested next step.

Every number must come from a Ternary result. If you cannot get a figure, say what is
missing instead of estimating.
📘

Usage and limits

Each run uses the plan of the person who owns the routine. A routine can be started up to 30 times an hour, including Run now, and an account can make up to 100 API starts an hour. If an alert hits the limit, Ternary waits and retries automatically.

In rare cases, a retry after a server error can start a second session for the same alert. If your routine writes somewhere, such as a sheet, tell it to check for an existing entry first.

Advanced: write the finding into your budget sheet

To put the routine's finding next to the budget line, as in the example above:

  • Keep the cloud line live with the Ternary Sheets add-on. Install it, select Connect in its sidebar with a Ternary API key, then use a formula such as =TERNARY_QUERY("FOCUS_SPEC_FIELD/ProviderName","Google Cloud","MTD"). If a cell shows TERNARY_AUTH_REQUIRED, the add-on isn't connected to this sheet yet. TODO: link to Sheets add-on docs.
  • Add an Alert log tab with columns for the date, budget, main driver, owner, department total and suggested action. A lookup on the Budget tracker shows the newest finding for each line. Name each line in the sheet exactly as the budget is named in Ternary.
  • Let the routine write to the sheet through a small Apps Script web app bound to the sheet. Your sheet admin or IT team can deploy it in a few minutes from our sample. TODO: link to sample receiver script. In the routine's environment, allow network access to script.google.com and script.googleusercontent.com, and store the script's token as an environment variable rather than in the prompt.
  • Add a write-back step to the prompt: send one row, once, with short fields, and never print the token.

Example workflow 2: Route the alert to an owner (Custom HTTPS)

The situation: when a budget is at risk, your process requires the cost-centre owner to acknowledge it, and FP&A wants a ticket for anything over $5,000.

Example with Zapier:

  1. Create a Zap with the trigger Webhooks by Zapier › Catch Hook and copy the webhook URL.
  2. Create a Custom HTTPS webhook in Ternary with that URL, or ask an admin to. See Webhooks. If your team wants to verify that requests come from Ternary, keep the signing secret shown when the webhook is saved.
  3. Select Test Connection on the webhook so Zapier receives a sample message to map fields from: the alert's headline, summary and link.
  4. Attach the webhook to the budget alert.
  5. Add actions to the Zap, for example:
    • Jira › Create issue in the FinOps project, with the headline as the summary and the alert text as the description.
    • Microsoft Teams › Send channel message to the cost-centre channel.

The same pattern works in Make (Webhooks › Custom webhook) and Power Automate (When an HTTP request is received), where you can add an Approvals step.

Your workflow should acknowledge the message quickly and do the rest afterwards. Each alert carries a unique ID, and retries reuse it, so your workflow can skip duplicates.

Example workflow 3: Investigate in ChatGPT (OpenAI Workspace Agent)

The situation: your finance team uses ChatGPT and wants the same investigation as workflow 1 without a second AI tool.

  1. In ChatGPT, create a workspace agent with the Ternary connector. See Connect ChatGPT.
  2. Give it instructions like the prompt template in workflow 1.
  3. Publish the agent. Ternary can't start an unpublished agent.
  4. Open the agent's API channel and copy the API URL and access token.
  5. Create an OpenAI Workspace Agent webhook in Ternary with these, or ask an admin to. See Webhooks.
  6. Attach the webhook to the budget alert.

Because every alert for the same budget continues one conversation, you can ask the agent to compare each new alert with the last one. For example, add to its instructions: "If you investigated this budget before, say whether the driver is the same and whether it has grown."

More ideas

One alert can start as many next steps as your process needs. Start with one, then add steps to the agent's instructions or the workflow.

Next stepHow
Draft the variance note for month-endAsk the agent for a two-paragraph note in your FP&A template
Suggest savings in the same scopeAsk the agent to list current savings recommendations for the budget's provider or service
Find unowned spendAsk the agent to check label coverage for the moved spend and name the accounts with no owner
Get sign-off from the budget ownerCustom HTTPS to Power Automate, with an Approvals step
Confirm a vendor's pricingHave the agent draft an email for a person to review and send

See What you can do with Ternary MCP for everything an agent can look up.

Good to know

  • Agents see what their owner sees. The Ternary connector signs in as a real Ternary user and respects that user's permissions and scoped views.
  • Ask for read-only investigation. Ternary MCP can save private reports, but only when asked. Tell the agent not to change anything.
  • Budget figures are a snapshot from the last evaluation. Projected period-end spend uses the budget's own method, not Ternary Forecasting. See Capabilities and limitations.
  • A change that moved with the total isn't automatically the cause. Ask the agent to compare against a baseline and to rule out the largest service, as in the prompt template.
  • To pause a workflow, ask an admin to Disable the webhook. Budgets keep their subscriptions, and alerts resume when it's enabled again.
  • Webhooks currently carry budget alerts.

Troubleshooting

SymptomLikely causeWhat to do
No alert after adding the webhookThe budget had already crossed that threshold this period, or the alert is on a sub-budgetAdd a threshold the budget hasn't crossed yet, wait for the next period, or attach the webhook to the parent budget
The webhook isn't listed under Add Subscribers › WebhooksIt hasn't been created, or it's disabledAsk an admin to create or enable it
The routine replied "Test received"It received Ternary's test messageExpected. Real alerts arrive when a budget crosses a threshold
The agent ran but nothing reached the sheetToken, network allowlist, or sheet script not authorisedOpen the run's log in claude.ai to see the response from the sheet
Two rows for one alert in the sheetA retry started a second sessionTell the routine to check for an existing row before writing
Cells show TERNARY_AUTH_REQUIREDThe Sheets add-on isn't connected to this sheetConnect in the sidebar, then re-enter the formulas

For connection test errors and the Warning and Disabled statuses, see Webhooks › Troubleshooting.



Did this page help you?