durable operation2–3 hr5 stages8 code languages

Operating journey: A delivery promise customers can trust

Fewer failed deliveries and a live, explainable ETA from checkout to doorstep.

The real-world moment

At 18:05 a customer places a same-evening grocery order to a loosely formatted apartment address. The promise engine has eight minutes to validate serviceability and a two-hour window; dispatch must combine it with 37 stops, the driver may lose connectivity, and support needs one explainable timeline when the entrance is hard to find.

Make ownership visible before code.

Operate the full lifecycle with versioned state, hostile-path recovery, audit, and release evidence.

Application state
stateful
Planning calls
0
Credentials accepted
No
Write authority
None
01
Order system of record

Normalize the destination and retain its Mappls Pin

Owns order, customer promise, consent, service window, package constraints, payment, and terminal delivery outcome.

Order ↔ destination Mappls Pin and acceptance timestamp

GETAutoSuggest API/api/places/search/jsonThis normalized operation matches the stage intent and remains subject to its source, lifecycle, authentication, entitlement, host, and regional gates.

Record stage 1 with the application identity, source fingerprint, request or aggregate identity, timestamp, and observable outcome.

Ambiguous apartment entrance

Offer landmark/entrance candidates, let the customer confirm one stable pin, and preserve the original address plus every selection revision.

02
Location normalization

Optimize stops against capacity and time windows

Search and address services produce candidates; the accepted Mappls Pin becomes the durable destination identity rather than repeatedly geocoding text.

Record stage 2 with the application identity, source fingerprint, request or aggregate identity, timestamp, and observable outcome.

Driver telemetry goes silent

Show last verified progress and age, alert dispatch after policy threshold, and avoid inventing a moving ETA.

03
Planning and guidance

Navigate with live rerouting

Route and matrix boundaries sequence eligible stops, preserve route revisions, and provide driver guidance without making the map UI authoritative.

Telemetry event ↔ source/event/content identity, event time, receipt time, accuracy

GETRouting API/{REST_KEY}/{resources}/{profile}/{geopositions}This normalized operation matches the stage intent and remains subject to its source, lifecycle, authentication, entitlement, host, and regional gates.

Record stage 3 with the application identity, source fingerprint, request or aggregate identity, timestamp, and observable outcome.

Provider accepts a route/trip command after timeout

Reconcile by idempotency/provider identity before issuing another command or closing locally.

04
Trip evidence

Stream driver and order state

InTouch observations are deduplicated by source identity and event time; ETA revisions and exceptions are derived without rewriting raw telemetry.

Proof submission ↔ consent purpose, media hashes, location evidence, reviewer decision

GETGets the live data of devices./deviceThis normalized operation matches the stage intent and remains subject to its source, lifecycle, authentication, entitlement, host, and regional gates.

Record stage 4 with the application identity, source fingerprint, request or aggregate identity, timestamp, and observable outcome.

Ambiguous apartment entrance

Offer landmark/entrance candidates, let the customer confirm one stable pin, and preserve the original address plus every selection revision.

05
Customer and operations views

Capture geotagged proof and reconcile exceptions

A privacy-reduced tracking projection serves the customer while dispatch/support retain the attributable full journey and proof-review queue.

Order ↔ destination Mappls Pin and acceptance timestamp

GETGeocode API/api/places/geocodeThis is a supporting operation from the selected product stack, not proof of an exact provider contract for this stage. Resolve the stage through its product source or adapter boundary before live implementation.

Record stage 5 with the application identity, source fingerprint, request or aggregate identity, timestamp, and observable outcome.

Driver telemetry goes silent

Show last verified progress and age, alert dispatch after policy threshold, and avoid inventing a moving ETA.

Edit once. Generate eight trusted-runtime implementations.

The recipe starts from the normalized GET /api/places/search/json contract. Execute six deterministic fixture outcomes before an issued account is involved.

Local request composerCode stays local · fixtures are explicit
GETRequest inputs
7 editable · 1 protected
Generated in eight languages
Environment-backed credentials
GEThttps://atlas.mapmyindia.com/api/places/search/json?query=mapmyindia&location=28.612964%2C77.229463&region=IND&pod=CITY&filter=pin%3A110001&bridge=true&hyperLocal=true
Credential-free sandboxExecute this contract without a provider call
How fixtures work
Generated from your inputs
curl --request GET \
  --url 'https://atlas.mapmyindia.com/api/places/search/json?query=mapmyindia&location=28.612964%2C77.229463&region=IND&pod=CITY&filter=pin%3A110001&bridge=true&hyperLocal=true' \
  --header "Accept: application/json" \
  --header "Authorization: Bearer ${MAPPLS_ACCESS_TOKEN}"

Credential-safe by constructionSet MAPPLS_ACCESS_TOKEN only in your trusted runtime. Code generation stays local. Sandbox execution sends only bounded fixture inputs to this developer platform and never reads a credential or calls Mappls.

Break the journey before customers do.

These controls are required at this operating depth; deeper recipes add durable truth rather than merely more API calls.

Idempotent commandsOptimistic aggregate versionsEvent and receipt timeTransactional outboxUnknown-outcome reconciliationIndependent human decisionsRestart recoveryImmutable audit evidence

Definition of done

Every aggregate has an invariant, expected version, stable command identity, and attributable actor.

Duplicate, late, reordered, invalid, stale, timed-out, and restarted execution preserve one durable truth.

Unknown provider outcomes reconcile by original identity before replay or compensation.

Terminal decisions, human review, audit, outbox delivery, privacy, retention, and rollback remain independently evidenced.

Contracts, tutorials, and journeys stay linked.

Contract set

GETAutoSuggest API/api/places/search/jsonGETRouting API/{REST_KEY}/{resources}/{profile}/{geopositions}GETGets the details of a single trip/trips/{id}GETGeocode API/api/places/geocodeGETRoute Optimization API/{rest_key}/{resources}/{profile}/{geopositions}GETThis API will get all the trips for a user./tripsGETReverse Geocode API/{REST_KEY}/rev_geocodeGETRouting API with driving profile/{REST_KEY}/{resources}/driving/{geopositions}GETGets the live data of devices./deviceGETNearby API/api/places/nearby/jsonGETRouting API with trucking profile/{REST_KEY}/{resources}/trucking/{geopositions}GETGets the historical location events of a device./devices/{deviceId}/events

Durable state machines

statefulConnected fleet trip6 states · 7 transitionsstatefulFleet geofence exception6 states · 5 transitionsstatefulCoordinated incident response7 states · 8 transitionshybridRecoverable navigation session6 states · 6 transitionshybridDurable multi-stop itinerary6 states · 9 transitionsstatefulConsented address verification9 states · 11 transitionshybridiOS direction planning and navigation handoff8 states · 8 transitionshybridiOS geofence draft and publication boundary6 states · 6 transitionshybridiOS feedback report and review9 states · 9 transitionshybridConsent-bound location capture evidence8 states · 9 transitionsstatefulGoverned place contribution and publication7 states · 8 transitions

Care Transfer Desk

Confirm the correct receiving entrance, assign eligible transport, preserve courier custody, review condition exceptions, and reconcile receiver acceptance without retaining patient or clinical data.

Source-grounded, not authority-granting

This recipe composes source-derived contracts, application architecture, fixtures, and maintained learning evidence. It does not prove package availability, provider payload shape, account entitlement, regional behavior, production compatibility, or release approval.