# Developer Guides (/docs/products/ussd-flows/developers)

These guides cover the flow JSON in detail. If you haven't built a flow yet, start with [Getting Started](/docs/products/ussd-flows/getting-started).

## How a Flow Runs

When a subscriber dials your code, Monime shows the first page of your flow. Each time the subscriber answers, Monime checks the answer, saves it, runs the page's `on_done`, and shows the next page.

Pages run in the order you list them. A page can change that order:

- `on_done.next_page` jumps to another page.
- An `exchange` action or a `dynamic` page asks your server which page comes next.
- `options.skip` passes over a page.

The flow ends when:

- a `display` page is shown
- a page with `options.terminal` finishes
- your server's exchange response stops the flow
- the subscriber answers no to a yes or no prompt that has an `exit_message`
- the subscriber hangs up, or the session times out

Payments are built in. A [`collect_payment`](/docs/products/ussd-flows/developers/templates/collect-payment) page charges the subscriber's mobile money in the session, with no payment integration of your own.

## What a Page Can Read

| Write              | To read                                               |
| ------------------ | ----------------------------------------------------- |
| `$(page.ID.value)` | An earlier answer                                     |
| `$(session.KEY)`   | The subscriber's number and network                   |
| `$(data.KEY)`      | Data your server sent for this page                   |
| `$(sc.KEY)`        | A value saved earlier in this session                 |
| `$(rc.KEY)`        | A value saved for this subscriber on an earlier visit |

See [Variables](/docs/products/ussd-flows/developers/variables) for the details, and [Expressions](/docs/products/ussd-flows/developers/expressions) for comparisons and functions.

## Next Steps

- [**Flow Definition**](/docs/products/ussd-flows/developers/flow-definition)

  The flow JSON: pages, component types, limits, options and `on_done`.

- [**Authoring Conventions**](/docs/products/ussd-flows/developers/conventions)

  Naming, flow shapes, labels, menus and a checklist before publishing.

- [**Page Types**](/docs/products/ussd-flows/developers/page-types/display)

  Display, prompt, menu, dynamic, template and side effect pages.

- [**Variables**](/docs/products/ussd-flows/developers/variables)

  Read answers, session details, server data and saved values.

- [**Context Stores**](/docs/products/ussd-flows/developers/context-stores)

  Save values for the session (`sc`) or for the next visit (`rc`).

- [**Expressions**](/docs/products/ussd-flows/developers/expressions)

  Comparisons, choices and built-in functions inside `$(...)`.

- [**Templates**](/docs/products/ussd-flows/developers/templates/overview)

  Built-in operations such as taking a payment or looking up a KYC name.

- [**Exchange API**](/docs/products/ussd-flows/developers/exchange-api/overview)

  Let your server choose pages and send data into the flow.

- [**Example Flows**](/docs/products/ussd-flows/developers/examples)

  Complete flows to copy: school fees, weekly giving, meter top-up.

- [**Error Handling**](/docs/products/ussd-flows/developers/error-handling)

  What goes wrong, and how to design for it.
