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

# Modeling transportation

> How transport Elements model lanes with multiple legs, and how inputs use them by weight

Transportation typically appears as **A2** (transport to manufacturing) and **A4** (distribution to customer) in a product's life-cycle. In Variable, transport is modeled differently from other Elements: a **transport Element** is a *modeled lane* from origin to destination, and an **input** that points to a transport Element only specifies the **weight** being moved. Variable derives the rest - modes, distances, per-unit impact data - from the lane.

## Transport Lanes (transport Elements)

A **transport Element** ("lane") is a reusable, named route that lives in your Inventory just like a Material, Energy, or Process Element. Each lane is composed of one or more **legs**, end-to-end:

| Concept                      | Description                                                                                                                                                                                   |
| :--------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Lane** (transport Element) | A complete route, e.g. *Shanghai supplier → Hamburg factory*. Reusable across many inputs.                                                                                                    |
| **Leg**                      | A single section of the lane with its own **origin**, **destination**, **distance**, and **mode**. A lane needs at least one leg, and can have many.                                          |
| **Mode** (transport Element) | The transport mode used on a leg - truck, rail, ship, air, ferry, etc. Modes are themselves Elements in your Inventory under transport, and the **Dataset** is connected to the mode Element. |

<Note>
  **The mode carries the Dataset.** Modes are reusable transport Elements with their own Dataset connection - the same way a Material Element carries its Dataset. A leg references a mode, and the mode supplies the per-unit impact data. Update the Dataset on a mode Element once, and every leg (across every lane) that uses it picks up the change.
</Note>

## How inputs use a lane

When you add transport to a Product, you create an **input** that points at a transport Element and set a single value: the **weight** of material being moved over that lane.

| What you set on the input                 | What Variable derives from the lane                    |
| :---------------------------------------- | :----------------------------------------------------- |
| The lane (which transport Element to use) | All legs in the lane                                   |
| **Weight** (and weight unit)              | Each leg's distance and mode (with the mode's Dataset) |
| Notes / Stage / etc.                      | Per-leg tonne-km × mode impact data → leg impact       |

The total impact for the input is the sum of each leg's `(weight × distance × mode impact data)`. You don't re-enter modes or distances on each input - that's the point of the lane being reusable.

<Info>
  If your factory imports the same component from a single supplier across many products, model the supplier-to-factory lane **once** and reference it from every input that uses it. When the route changes (new supplier, new port), update the lane and every input picks up the change.
</Info>

## Building a lane

<Steps>
  <Step title="Create the transport Element">
    From your Inventory, create a new transport Element. Give it a descriptive name based on the route - e.g., *Shanghai supplier → Hamburg factory* - not on a specific shipment, since it'll be reused.
  </Step>

  <Step title="Add legs end-to-end">
    Add one leg per stop in the journey, in order. For each leg, set:

    * **Origin** - address, city, port, coordinates, or a [supplier's saved location](/docs/help/supplier-locations)
    * **Destination** - same options
    * **Mode** - pick a transport Element (truck, rail, ship, air, ferry, etc.) from your Inventory. The mode carries its own Dataset, so picking the mode is what wires the per-unit impact data into the leg.
    * **Distance** - calculated automatically (Google Maps for road, SeaRoutes for ocean) or entered manually

    The destination of each leg is typically the origin of the next.
  </Step>

  <Step title="Make sure each mode has a Dataset">
    Modes are transport Elements, so they need a Dataset just like a Material or Energy Element. If you pick a mode that doesn't have one connected yet, open the mode and assign one - see [Assigning datasets](/docs/getting-started/assign-datasets) for the search and assignment workflow. Every leg (across every lane) that references that mode picks up the change.

    <Note>
      Re-use modes across lanes. A single *Regional truck - EU* mode Element with a Dataset connected can power the inland legs of every European lane you build. Different legs in the same lane will typically use different modes - a truck mode for inland legs, an ocean-container mode for the sea leg.
    </Note>
  </Step>

  <Step title="Reference the lane from an input">
    In your Product's model, add a transport input at the appropriate stage (A2 for inbound, A4 for outbound) and pick the lane. Then enter the **weight** of material being moved on this input - that's the only quantity you set. Variable computes the impact across all legs using the weight you provided.
  </Step>
</Steps>

## Common patterns

### Inbound (A2) - supplier to factory

```mermaid theme={"system"}
flowchart TB
    S[Supplier warehouse] -->|Truck - 150 km| P1[Shanghai port]
    P1 -->|Ship - 19,000 km| P2[Rotterdam port]
    P2 -->|Truck - 400 km| F[Factory]
```

Three legs, two distinct mode Elements (a regional-truck mode used twice, plus an ocean-container-ship mode) - each mode brings its own Dataset. Inputs pointing at this lane just set the weight of material being delivered.

### Outbound (A4) - factory to customer

A typical distribution lane:

| Leg | Mode  | Example                                 |
| :-- | :---- | :-------------------------------------- |
| 1   | Truck | Factory → distribution center (200 km)  |
| 2   | Truck | Distribution center → retailer (100 km) |

### Multi-modal with rail

Lower-emission long-distance transport using rail for the long leg:

| Leg | Mode  | Example                         |
| :-- | :---- | :------------------------------ |
| 1   | Truck | Factory → rail terminal (50 km) |
| 2   | Rail  | Terminal → terminal (800 km)    |
| 3   | Truck | Terminal → destination (75 km)  |

## Distance calculation

Each leg can derive its distance automatically or accept a manual entry:

| Method          | How it works                                    | Best for                                                                  |
| :-------------- | :---------------------------------------------- | :------------------------------------------------------------------------ |
| **Google Maps** | Road distance via the Google Maps API           | Truck legs with known addresses                                           |
| **SeaRoutes**   | Port-to-port distance via actual shipping lanes | Ocean-freight legs                                                        |
| **Manual**      | You enter the distance directly                 | Air freight, custom routes, generic lanes, or when you have measured data |

<Info>
  Use specific addresses (street + city) where possible. Google Maps will pick the optimal road route, and SeaRoutes uses real shipping lanes between ports - both produce more accurate numbers than rough city-to-city estimates.
</Info>

### Generic lanes

You don't need an origin and destination on every leg. A common pattern is a **generic distribution lane** - a single leg with a manually entered distance and a mode Element, and no specific addresses. For example, *Distribution by truck (500 km)* is a one-leg lane with a truck mode and a 500 km manual distance, ready to be referenced from any product where you don't know (or don't need to model) exact destinations. Inputs that point at it just set the weight, the same as any other lane.

## Stage assignment

Transport inputs are assigned to a life-cycle stage on the input (not the lane), so the same lane can be re-used in either inbound or outbound contexts:

* **A2** - Inbound transport. Materials, components, or fuels being delivered into your manufacturing operation.
* **A4** - Outbound transport. Finished goods being distributed to customers, retailers, or installation sites.

Variable doesn't enforce a direction on the lane itself - the same Hamburg-to-Rotterdam route could be A2 for one product and A4 for another.

## Best practices

* **Re-use lanes across Products.** Modeling supplier-to-factory once and pointing many inputs at it keeps your data consistent and makes route changes trivial.
* **Match mode geography to the leg.** Use mode Elements with the right regional Dataset - a European regional-truck mode for an inland EU leg, an ocean-container mode for the sea leg, etc. Matching mode geography per leg is more accurate than a single global average.
* **Get specific addresses from suppliers.** Auto-calculated distances are only as good as the input addresses.
* **Account for return trips when relevant.** Dedicated transport with empty backhauls effectively doubles distance - model the return as its own leg, or pick a Dataset that already accounts for it.
* **Document manual distances.** When you override an auto-calculated distance, leave a note on the leg so reviewers know why.

## Related topics

* [Life-cycle stages explained](/docs/help/life-cycle-stages) - A2 and A4 in context
* [Adding inputs to your model](/docs/getting-started/add-materials) - adding a transport input to a Product
* [Assigning datasets](/docs/getting-started/assign-datasets) - the Dataset search and assignment workflow
* [Data quality ratings](/docs/help/data-quality) - assessing transport data quality
