Shortcuts

The app publishes one Shortcuts action. It runs the same export the Export Now button runs — same time ranges, same destination, same format, same bytes — with no screen, so an automation can export on a schedule you choose. What arrives at your endpoint is exactly the JSON or CSV described on those pages.

If you read nothing else:

  1. The action throws on failure. A failed export and an empty time range never look alike.
  2. On a local-network destination, export once in the app first. Until you have, the action refuses and sends nothing.
  3. One export runs at a time. An action that fires while an export is running is refused, not queued.
  4. The action’s name, its parameter and the range identifiers are frozen, so a saved Shortcut keeps working.

The action

FieldValue
Action nameExport Health Data
Parameter nameTime Range

Find it in the Shortcuts action library under the app’s name. It runs on the iPhone that has the app; there is no web or Mac counterpart. It does not open the app when it runs.

Time Range

Time RangeSaved identifierWhat it exports
Last 3 hourslast3Hoursthe 3 hours ending when the action runs
Last 24 hourslast24Hoursthe 24 hours ending when the action runs
Last 7 dayslast7Daysthe 7 days ending when the action runs
Last 30 dayslast30Daysthe 30 days ending when the action runs

A range is a fixed span back from the moment the action fires, not a calendar range: “Last 24 hours” is not “since midnight”. It includes its start and excludes its end, so back-to-back runs tile. There is no custom date range. “Last 3 hours” is the narrowest: a Shortcut that runs less often than every three hours leaves gaps with it.

Every run of the action is a basis window export: overlapping runs resend the overlap by design, and a receiver that upserts on uuid absorbs it.

What it returns

Errors

Every failure throws: your Shortcut stops and shows the app’s own message. Wrap the action in an error handler to handle it yourself.

SituationWhat it means
No destination yetSet the receiver’s address in the app first. Nothing was read or sent.
No metrics chosen yetTurn on at least one group in the app first.
Local network not explained yetThe one-time in-app export has not happened. Open the app and export once.
An export is already runningNothing was read or sent. Safe to retry — after a moment, not in a tight loop.
Nothing arrivedThe first batch was refused or unanswered; the message carries the status. Nothing was delivered, so re-running is safe.
Partly sentSome batches landed, then one failed. The failed batch is retried later on the app’s schedule; the batches after it were never built.
Couldn’t read from HealthUsually a locked phone. The message counts what had already arrived.
Couldn’t read its own settingsThe phone restarted and has not been unlocked yet. Unlock it and run again.

After Partly sent or Couldn’t read from Health, the run is not resumed: exporting the same range again is what fetches the rest, and it resends what already arrived.

What the action does not do

No schedule of its own, no retry or backoff inside the run, no queue in front of it, no entry in a log of its own, no format or metric-group parameter (both come from the app’s settings), no custom date range, and no Siri phrase. It sends nothing anywhere but your endpoint.

A worked automation

Export every hour over the last 24 hours. A missed run — a locked phone, a restart, an export already running — is covered by the next ones, and uuid deduplication makes the overlap free.

Illustrative, not executed
Automation: Time of Day, every hour
    1. Export Health Data
           Time Range: Last 24 hours
       (on error: show notification with the error, stop)
    2. If Result is 0
           (nothing to do)
       Otherwise
           Add "Result" samples to a running log