---
title: "plan trip · RUAL Documentation"
description: "Plan a journey between an origin and a destination. Each endpoint accepts a station code, a UIC code, or a geo point."
canonical: https://docs.rual.nl/block-types/NS/nsconnection_trips
language: en
---

# plan trip

This block is part of the [`NS`](https://docs.rual.nl/block-types/NS) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Plan a journey between an origin and a destination. Each endpoint accepts a station code, a UIC code, or a geo point.

- flow `flow`

- Connection required `nsconnection` The NS connection.

- From station code required `value` Origin NS station code (e.g. asd for Amsterdam Centraal). • Hidden when other fields are filled

- From UIC code `value` Origin UIC code. • Hidden when other fields are filled

- From geo point `geo_point` Origin coordinate (for door-to-door planning). • Hidden when other fields are filled

- From name `value` Optional label for the origin coordinate.

- To station code required `value` Destination NS station code. • Hidden when other fields are filled

- To UIC code `value` Destination UIC code. • Hidden when other fields are filled

- To geo point `geo_point` Destination coordinate (for door-to-door planning). • Hidden when other fields are filled

- To name `value` Optional label for the destination coordinate.

- Via station code `value` Optional station code to route via.

- Via UIC code `value` Optional UIC code to route via.

- Via geo point `geo_point` Optional coordinate to route via.

- Date / time `date` Departure (or arrival) moment for the trip. Defaults to now.

- Search for arrival `condition` When true, the date/time is treated as the desired arrival time instead of departure.

Default `false`

- Language `value` Language for localized text (e.g. nl or en). Defaults to Dutch.

- flow `flow`

- Connection `nsconnection` The NS connection.

- Success `condition` True if the request succeeded.

- Trips `array` The trip options, each with planned/actual departure and arrival as unix timestamps, transfers, delays and per-leg details.

- Count `number` Number of trips returned.

- Error `value` Error message if the request failed.

| `reisadvies` |
| --- |
| `trips` |
| `journey` |
| `reisplanner` |

A typical wiring for [plan trip](https://docs.rual.nl/block-types/NS/nsconnection_trips): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [open connection](https://docs.rual.nl/block-types/NS/nsconnection_open) feeds the `connection` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `from_station` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `to_station` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%20ui/state_debug).

![Studio canvas example for the plan trip block: typical wiring for plan trip.](https://docs.rual.nl/canvas-examples/nsconnection_trips.png)

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
