> For the complete documentation index, see [llms.txt](https://docs.peakcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peakcommerce.com/product/using-peakcommerce/workflows-and-actions/workflows.md).

# Rules & Automation

PeakCommerce's **Rules & Automation** engines apply business logic automatically across commerce — so journeys, pricing, and access behave consistently without custom code. You manage them under **Rules & Automation** in the admin navigation.

## The engines

| Engine                | What it does                                                                                                                                                        |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Business Rules**    | Govern how a subscription change behaves — when it takes effect, how it prorates, whether it co-terms to the base subscription, and whether it is blocked outright. |
| **Plan Dependencies** | Define how plans and add-ons relate — what can be bought together, what requires what, and what conflicts.                                                          |
| **Pricing Rules**     | Apply pricing logic such as discounts, tiers, and promotions within guardrails.                                                                                     |
| **Territory Rules**   | Route customers and assign ownership by region or segment.                                                                                                          |
| **Policy Engine**     | Enforce guardrails — the hard limits (for example a maximum discount) that no channel, including AI agents, can exceed.                                             |

## The engines in the app

Each engine has its own workspace under **Rules & Automation**, with summary counts, search, and a "Create with Mango" shortcut.

<figure><img src="https://318941401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaVlEqhLl6KbOCFwAQfmr%2Fuploads%2Fgit-blob-15a76d6e6d0fc613e57016a186ad3c53abfb5464%2Fscreen_pricing_rules.png?alt=media" alt="The Pricing Rules page showing discount, tier, override, and segment rules as cards, each with its adjustment, priority, and the products or journeys it applies to"><figcaption><p><strong>Pricing Rules</strong> — discounts, tiers, and overrides resolved by priority across plans, segments, and journeys.</p></figcaption></figure>

<figure><img src="https://318941401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaVlEqhLl6KbOCFwAQfmr%2Fuploads%2Fgit-blob-6dde53864ffec0521ef36a94858c65028c39c8ff%2Fscreen_territory_rules.png?alt=media" alt="The Territory Rules page: a table of rules matched by condition and locale, each routing an account to a service profile by priority"><figcaption><p><strong>Territory Rules</strong> — route accounts to the right profile by condition and locale; the highest-priority match wins.</p></figcaption></figure>

Watch a territory rule being built — routing accounts to a service profile by a region condition and priority:

{% embed url="<https://youtu.be/FBLxOAxZ6zw>" %}

<figure><img src="https://318941401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaVlEqhLl6KbOCFwAQfmr%2Fuploads%2Fgit-blob-8356d0b2a5a993233ac7a1a4a98a0c7edc591157%2Fscreen_plan_dependencies.png?alt=media" alt="The Plan Dependencies page: a table of dependencies linking a source charge to its targets, each with a sync flow, calculation, direction, and status"><figcaption><p><strong>Plan Dependencies</strong> — keep linked quantities in sync so targets follow a source charge automatically.</p></figcaption></figure>

## How it fits together

Rules evaluate as customers move through [journeys](/product/journeys-and-pages/journey-basics/journeys-overview.md): pricing and plan dependencies shape what's offered, business rules adjust the flow, territory rules route ownership, and the policy engine sets the ceilings everything else operates within. Because the policy engine binds these limits centrally, the same guardrails apply whether a person, a CSR, a partner, or an AI agent is transacting.

> For multi-system automation (for example post-cancellation billing tasks), PeakCommerce generally recommends building workflows in your system of record — Zuora or Salesforce — when it has a workflow module, for the most flexibility and extensibility.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.peakcommerce.com/product/using-peakcommerce/workflows-and-actions/workflows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
