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

# Production Batch Numbers: Full End-to-End Traceability

> Understand what a Production Batch Number (PBN) is, how the batch lifecycle works, and how PBNs connect your production, inventory, and labels.

A **Production Batch Number (PBN)** is the unique identifier that Avstarna assigns to every production run. From the moment a batch is created to the moment finished goods leave your facility, the PBN acts as the single thread that connects tasks, inventory records, printed labels, and outbound shipments — giving you full traceability at every step.

## What Is a PBN?

A PBN is automatically generated when you start a new production run. It serves two purposes:

1. **Internal tracking** — links all activity within Avstarna (tasks, stock movements, label prints) to a specific batch of a specific product.
2. **External reference** — each PBN has a unique **hash ID** that you can share with customers, auditors, or logistics partners for traceability without exposing internal data.

PBNs follow a structured format. For example, a batch produced in 2024 might look like **RNU22012024**, where the trailing digits encode the year of production.

<Info>
  Every label printed for a batch carries the PBN alongside the LOT number and expiration date. This means you can trace any unit back to its exact production run just by scanning a label.
</Info>

## The PBN Lifecycle

<Steps>
  <Step title="Create the PBN">
    Open a new production batch from the Production module. Avstarna generates a unique PBN and hash ID. You select the product sub-variant being produced and the target output quantity.
  </Step>

  <Step title="Assign Tasks">
    Break the batch into tasks — for example, mixing, filling, baking, and cooling — and assign them to team members or production lines. Task completion is tracked against the PBN in real time.
  </Step>

  <Step title="Record Inventory Output">
    When production is complete, you record the finished goods output. Avstarna adds the produced quantity directly to inventory, linked to the PBN so the stock origin is always traceable.
  </Step>

  <Step title="Print Labels">
    Generate product labels and box labels for the batch. Labels automatically pull the PBN, LOT number, expiration date, and allergen data from the batch and product records — no manual entry required.
  </Step>

  <Step title="Distribute">
    Attach batch inventory to outbound orders. The PBN is recorded on transactions and shipping documents, so you always know which orders received goods from which production run.
  </Step>
</Steps>

## What a PBN Connects To

The PBN is the central reference across several areas of Avstarna:

| Connected Record | How the PBN Is Used                                                                    |
| ---------------- | -------------------------------------------------------------------------------------- |
| **Inventory**    | Finished stock is recorded against the PBN so you know which batch each unit came from |
| **Tasks**        | Production tasks are grouped under the PBN for progress tracking                       |
| **Labels**       | Product and box labels print the PBN for full unit-level traceability                  |
| **Transactions** | Outbound distribution records reference the PBN for audit trails                       |
| **Orders**       | When fulfilling orders, the PBN links delivered goods back to their batch              |

## Why PBNs Matter for Traceability

If a quality issue is ever identified, the PBN lets you act quickly. You can immediately see:

* **What was produced** — the exact product sub-variant and quantity
* **When it was produced** — batch creation and task completion timestamps
* **Where it went** — which orders and customers received stock from that batch

<Note>
  Regulatory and retail audits often require lot-level traceability. Keeping PBNs consistent and complete in Avstarna means you're always audit-ready without extra manual record-keeping.
</Note>

<Tip>
  Use the PBN hash ID when communicating with external parties. It gives them a reference they can verify without requiring access to your internal Avstarna system.
</Tip>
