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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Subtract

> Subtract one number from another in an automation.

`subtract` subtracts `b` from `a`.

```ts automations/subtract.automation.ts theme={null}
import { automation, log, onHttpRequest, subtract } from "automate.ax"

export default automation("Calculate remaining capacity", () => {
  onHttpRequest({ scope: "automation" })
  const remaining = subtract({ a: 100, b: 37 })
  log({ value: remaining })
})
```

| Input | Type     | Required | Description                |
| ----- | -------- | -------- | -------------------------- |
| `a`   | `number` | Yes      | Value to subtract from.    |
| `b`   | `number` | Yes      | Value subtracted from `a`. |

Returns `Signal<number>` containing `a - b`. Both inputs accept compatible
signals.
