Skip to main content

Event Overview

The Train Departure webhook fires when a train departs from a station, customer location, or serving location in your network. It delivers equipment details, the departure station, customer and serving location (when applicable), loaded/empty status, the train number, and the associated work order (if any). This webhook supports the “early departure” scenario where a train leaves directly from a customer location rather than the main yard. In that case, customer_location and serving_location are populated so your integration can distinguish between a normal yard departure and a customer-site departure.
This webhook is triggered through ARMS workflow automation. Configure it in your workflow rules to notify external systems when trains depart from specific locations.

Payload Schema

{
  "event_type": "TrainDeparture",
  "event_timestamp": "2026-06-17T09:30:00+00:00",
  "work_order_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "linked_resources": {
    "equipment": [
      {
        "resource_id": 100001,
        "car_number": "GCGO 995823",
        "is_loaded": true
      },
      {
        "resource_id": 100002,
        "car_number": "GCGO 726451",
        "is_loaded": false
      }
    ],
    "event_station": {
      "resource_id": 1001,
      "name": "Göteborg Hamn",
      "grouping_type": "station"
    },
    "customer_location": {
      "resource_type": "CustomerLocation",
      "resource_id": 7777,
      "name": "Volvo Torslanda",
      "customer_identification_numbers": ["VOL-001"],
      "general_ledger_number": "GL-12345"
    },
    "serving_location": {
      "resource_id": 5050,
      "name": "Torslanda Plant",
      "grouping_type": "customer_location"
    }
  },
  "attributes": {
    "is_loaded": null,
    "train_number": "T-8800"
  },
  "actor": {
    "resource_type": "User",
    "resource_id": 12345,
    "display_name": "ops@customer.com"
  }
}

Field Reference

Top-level Fields

FieldTypeRequiredDescription
event_typestringYesAlways "TrainDeparture" for this event.
event_timestampstring (ISO 8601)NoWhen the train departed. null if unavailable.
work_order_idstringNoID of the associated work order. null if the event has no work order.
linked_resourcesobjectYesEquipment, station, and locations involved in the event.
attributesobjectYesEvent-specific attributes.
actorobject or nullYesWho caused the triggering event. null for system-initiated events. See Shared Payload Fields -> actor.

linked_resources.equipment

An array of equipment items on the departing train. Each item includes per-car loaded/empty status. Always an array, even for a single car.
FieldTypeDescription
resource_idintegerInternal equipment identifier.
car_numberstring or nullRailroad car number (e.g. "GCGO 995823").
is_loadedboolean or nulltrue if this car was loaded, false if empty. null if unknown.

linked_resources.event_station

The station where the train departed from. null if no station could be resolved.
FieldTypeDescription
resource_idintegerInternal station identifier.
namestringHuman-readable station name.
grouping_typestringType of location (e.g. "station", "track").

linked_resources.customer_location

The customer location associated with the departure, if any. The entire object is null for departures not associated with a customer location (normal yard departures).
FieldTypeDescription
resource_typestringAlways "CustomerLocation" when present.
resource_idintegerInternal customer location identifier.
namestringHuman-readable customer location name.
customer_identification_numbersarray of stringsCarrier-side identifiers for this customer (may be an empty array).
general_ledger_numberstring or nullGeneral ledger number associated with this customer. null if not configured.

linked_resources.serving_location

The serving location associated with the departure, if any. The entire object is null when the departure is not tied to a serving location.
FieldTypeDescription
resource_idintegerInternal serving location identifier.
namestringHuman-readable serving location name.
grouping_typestringType of location (e.g. "customer_location").

attributes

FieldTypeDescription
is_loadedboolean or nulltrue if cars were loaded, false if empty. null when status is mixed or unknown.
train_numberstring or nullTrain identifier (e.g. "T-8800"). null if no train ID is set.

Example HTTP Request

This is the full HTTP request your endpoint receives:
POST /your-webhook-endpoint HTTP/1.1
Content-Type: application/json
X-Webhook-Timestamp: 1718614200
X-Webhook-Signature: <base64-encoded-ed25519-signature>
X-Webhook-KeyId: cedar-webhooks-2026
X-Webhook-Id: 550e8400-e29b-41d4-a716-446655440000

{"actor":{"display_name":"ops@customer.com","resource_id":12345,"resource_type":"User"},"attributes":{"is_loaded":null,"train_number":"T-8800"},"event_timestamp":"2026-06-17T09:30:00+00:00","event_type":"TrainDeparture","linked_resources":{"customer_location":{"customer_identification_numbers":["VOL-001"],"general_ledger_number":"GL-12345","name":"Volvo Torslanda","resource_id":7777,"resource_type":"CustomerLocation"},"equipment":[{"car_number":"GCGO 995823","is_loaded":true,"resource_id":100001},{"car_number":"GCGO 726451","is_loaded":false,"resource_id":100002}],"event_station":{"grouping_type":"station","name":"G\u00f6teborg Hamn","resource_id":1001},"serving_location":{"grouping_type":"customer_location","name":"Torslanda Plant","resource_id":5050}},"work_order_id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890"}
The JSON body is canonically serialized (sorted keys, no extra whitespace) so the signature can be verified deterministically. See the Webhook Overview for verification instructions.

Differences from Train Arrival

AspectTrain ArrivalTrain Departure
event_type"TrainArrival""TrainDeparture"
customer_locationNot included in payloadIncluded (with name, identifiers, GL number)
serving_locationNot included in payloadIncluded (with name, grouping_type)
linked_resources.trackIncluded (arrival track)Not included
is_final_locationIncluded in attributes (arrival-only)Not included
Per-car is_loadedNot included per equipment itemIncluded per equipment item
TriggerTrain arrives at a stationTrain departs from a station or customer location
The Train Arrival webhook does not currently include customer_location or serving_location, even though the underlying event carries them. This asymmetry is intentional — if your integration needs location context on both arrival and departure, use the Train Departure webhook for location-aware routing.

Setting Up This Webhook

1

Configure Workflow

In ARMS, create or edit a workflow rule that triggers on train departure events.
2

Add Webhook Effect

Add the Train Departure Webhook effect to the workflow. Provide your endpoint URL.
3

Implement Your Endpoint

Build an HTTPS endpoint that receives the POST, verifies the signature, and processes the event.
4

Test

Trigger a test event and confirm your endpoint receives and verifies the payload correctly.

Webhook Overview

Signing, verification, public key, and shared HTTP headers.

Train Arrival

Webhook for train arrival events at stations.