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

# Capacity planning

> Forecast volume by lane, identify capacity constraints, and plan ahead for peak periods

Capacity mismatches are expensive in both directions. Too little capacity means missed deliveries, expedited freight costs, and unhappy customers. Too much means you are paying for trucks and warehouse space you do not need. Most logistics teams plan capacity based on last year's numbers plus a gut-feel adjustment, which fails to account for changing demand patterns and seasonal shifts.

Wayak connects your TMS data, runs Python-powered volume forecasting in playbooks, and delivers capacity planning dashboards that show where your network will be tight — before it happens. Your planning team gets forward-looking visibility instead of backward-looking reports.

***

## What you need

<CardGroup cols={2}>
  <Card title="Data sources" icon="database">
    * **TMS database** — Historical shipment records with lane (origin-destination), volume (shipments and weight), dates, and carrier allocation
    * **Warehouse management system** — Outbound volume, dock utilization, and staging capacity by facility
    * **Carrier capacity data** — Contracted capacity by lane, available spot capacity, and rate trends
  </Card>

  <Card title="Knowledge spaces" icon="book-open">
    * **Demand calendar** — Planned promotions, seasonal peaks, product launches, and known volume spikes
    * **Capacity planning guidelines** — Target utilization rates, buffer capacity rules, and lead times for securing incremental capacity
  </Card>
</CardGroup>

**Semantic layer:** Define these in your ontology before setting up the agent.

| Component | Name                  | Definition                                                                                                            |
| --------- | --------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Object    | `Lane`                | Maps to the TMS lane master. Represents an origin-destination pair with its historical volume and carrier assignments |
| Object    | `Facility`            | Maps to the warehouse master. Represents a distribution center with its throughput capacity and current utilization   |
| Metric    | `CapacityUtilization` | Actual volume divided by contracted or available capacity, expressed as a percentage per lane or facility             |
| Metric    | `ForecastedVolume`    | Predicted shipment volume for a future period based on historical trends and known demand events                      |
| Dimension | `PlanningHorizon`     | Time-based categorization: next week, next month, next quarter                                                        |

<Tip>
  See [building a semantic layer](/quickstart/build-semantic-layer) for a step-by-step guide.
</Tip>

***

## Agent setup

<Steps>
  <Step title="Create the agent">
    Go to **Agent Space** → **New agent**.

    | Field    | Value                                                                                      |
    | -------- | ------------------------------------------------------------------------------------------ |
    | **Name** | Capacity Planner                                                                           |
    | **Role** | Network capacity and volume forecasting specialist                                         |
    | **Goal** | Ensure sufficient capacity across lanes and facilities to meet demand without overspending |
  </Step>

  <Step title="Set the description">
    > You forecast shipment volume and identify capacity constraints across the logistics network. When presenting forecasts, always show the methodology: historical baseline, trend adjustment, and known demand events factored in. Present capacity utilization as a percentage with a clear indicator of headroom or shortfall. Use precise numbers — shipment counts, weight, and percentage utilization. When recommending capacity actions, include the lead time required and the estimated cost of securing incremental capacity.
  </Step>

  <Step title="Scope data access">
    Grant access to:

    * TMS database (historical shipments, lanes, carriers)
    * Warehouse management system (outbound volume, dock utilization)
    * Carrier capacity data (contracted capacity, spot rates)
    * Demand calendar knowledge space
    * Capacity planning guidelines knowledge space
    * `Lane`, `Facility` objects and `CapacityUtilization`, `ForecastedVolume` metrics
  </Step>

  <Step title="Add skills">
    <AccordionGroup>
      <Accordion title="Forecast volume by lane">
        **Trigger:** User asks about upcoming volume or quarterly planning

        1. Pull historical shipment volume by lane for the past 12 months.
        2. Identify the baseline trend: is volume growing, stable, or declining on each lane?
        3. Check the demand calendar for known events in the forecast period (promotions, seasonal peaks, new customer onboarding).
        4. Adjust the baseline forecast for each known event based on the expected volume impact.
        5. Calculate the forecasted volume for each lane for the requested horizon (week, month, or quarter).
        6. Compare forecasted volume against contracted carrier capacity on each lane.
        7. Flag any lane where forecasted volume exceeds 85% of contracted capacity as "capacity at risk."
      </Accordion>

      <Accordion title="Identify capacity constraints">
        **Trigger:** User asks about capacity risks or monthly planning review

        1. Run the volume forecast for all lanes and facilities for the next 30 days.
        2. Calculate capacity utilization for each lane (forecasted volume versus contracted capacity) and each facility (forecasted outbound versus throughput capacity).
        3. Identify constraints: lanes or facilities where utilization exceeds 85%.
        4. For each constraint, calculate the gap in units (shipments or pallets) and estimate the cost of securing spot capacity to cover the shortfall.
        5. Present a prioritized list of constraints ranked by gap size and cost impact, with recommended actions: secure spot capacity, shift volume to alternate lanes, or negotiate temporary capacity increases.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Automation

### Playbook: Quarterly capacity forecast

<Steps>
  <Step title="Set the trigger">
    Schedule: **First business day of each quarter at 9:00 AM** (runs for Q2 planning on April 1, Q3 on July 1, etc.).
  </Step>

  <Step title="Build the workflow">
    1. **Query** the TMS for historical shipment volume by lane for the past 12 months.
    2. **Query** the demand calendar for all known events in the upcoming quarter.
    3. **Query** carrier capacity data for contracted capacity by lane.
    4. **Run Python analysis** to:
       * Fit a trend line to each lane's historical volume using linear regression.
       * Apply seasonal adjustment factors derived from the prior year's quarterly patterns.
       * Add event-driven volume spikes from the demand calendar.
       * Compute the forecasted weekly volume for each lane across the quarter.
       * Calculate capacity utilization percentage: forecasted volume versus contracted capacity.
       * Identify weeks and lanes where utilization exceeds 85%.
    5. **Condition:** If more than 20% of lanes are projected to hit capacity constraints during the quarter, flag the report as "action required" and recommend a capacity procurement review.
    6. **Aggregate** into a formatted forecast report: network-level summary, lane-level detail with weekly projections, constraint heatmap, and recommended actions.

    <Info>
      The **volume forecasting** step uses a Python code block to run linear regression on historical data, apply seasonal adjustment factors, and project weekly volumes. You can customize the regression lookback window, seasonal adjustment methodology, and the capacity utilization threshold.
    </Info>
  </Step>

  <Step title="Configure delivery">
    Send an email to the VP of Logistics and the capacity planning team with the subject line: "Quarterly capacity forecast — \[Quarter Year]". Attach the full forecast report. Post a summary of the top 5 constrained lanes to the `#capacity-planning` Slack channel.
  </Step>

  <Step title="Test and activate">
    Click **Run now** to test with live data, then toggle to **Active**.
  </Step>
</Steps>

***

## What's next

<CardGroup cols={2}>
  <Card title="Route efficiency analysis" icon="arrow-right" href="/use-cases/logistics/route-efficiency-analysis">
    Optimize the routes within your network to make the most of the capacity you have.
  </Card>

  <Card title="All logistics use cases" icon="list" href="/use-cases/logistics">
    See the full list.
  </Card>
</CardGroup>
