Event

trigger.strava_event
TriggerBusiness appsconnection requiredruns in-engine

Creates the Strava application's push subscription on publish and starts one run per delivered event.

Start a run when Strava reports an activity or athlete event (created, updated or deleted).

Connection

Required
Yes — the node will not save without one
Auth type
OAuth 2.0
Providers
Strava
Secret shape
the Strava {client_id, client_secret, refresh_token} triple
Resolved by
config.connection_id, else node.connection_id
Note
Only client_id and client_secret are used here: Strava's /push_subscriptions endpoints take the raw application credential rather than a bearer token. Publishing also needs MANTLE_APP_PUBLIC_BASE_URL set to an https URL at most 255 characters long that Strava can reach and that answers its validation GET within two seconds.

Configuration

This node takes no configuration beyond its connection.

Output

One shape.

strava event

The flattened Strava webhook event. `updates` carries whatever Strava says changed, so the shape is open below the declared fields.

Extra keys beyond the ones listed can appear.

FieldTypeExample
object_type
What the event is about: an activity, or the athlete themselves.
stringactivity
aspect_type
What happened to it — create, update or delete. Branch on this before reading the activity back: a delete names an activity Strava no longer has.
stringupdate
object_id
Strava id of the activity (or of the athlete, on an athlete event), as a string because Strava's ids are 64-bit and lose precision as JSON numbers. Feed it to strava.get_activity.
string1360128428
owner_id
Strava id of the athlete the object belongs to. On a multi-athlete app this is how you tell whose activity arrived.
string134815
subscription_id
The push subscription that delivered this event — the same id for every delivery while this workflow stays published.
string120475
event_time
When Strava recorded the event, in epoch seconds.
number1516126040
event_at
The same instant as an ISO-8601 UTC string, for nodes that want a date.
string2018-01-16T18:07:20Z
updates
On an activity update, only the fields that changed and their new values (title, type, private, visibility). On an athlete deauthorisation it is {"authorized": "false"}. Empty on every other event.
object{"authorized":"false"}
payload
Strava's webhook body exactly as it arrived, for anything the fields above do not lift out.
object—
{
  "aspect_type": "update",
  "event_at": "2018-01-16T18:07:20Z",
  "event_time": 1516126040,
  "object_id": "1360128428",
  "object_type": "activity",
  "owner_id": "134815",
  "payload": {
    "aspect_type": "update",
    "event_time": 1516126040,
    "object_id": 1360128428,
    "object_type": "activity",
    "owner_id": 134815,
    "subscription_id": 120475,
    "updates": {
      "title": "Messy"
    }
  },
  "subscription_id": "120475",
  "updates": {
    "title": "Messy"
  }
}

Notes

  • Publishing creates the subscription in Strava; unpublishing, disabling or archiving deletes it. A workflow that is off is off at Strava too.
  • A Strava application may hold only ONE push subscription, so one Strava connection can arm one published workflow. Publishing a second is refused rather than stealing the first one's subscription.
  • There is no event filter: the subscription receives every activity and athlete event for every athlete who authorised the application. Filter on object_type and aspect_type in the graph.
  • Strava does not sign its deliveries and offers nothing to verify them with, so the unguessable callback URL is the only secret involved. Treat the events as untrusted and read the activity back through strava.get_activity before acting on it.
  • An aspect_type of 'delete' names an activity Strava has already removed — reading it back returns 404.
  • Strava retries a delivery up to three attempts; every retry carries the same event, so a retry joins the run it already started.

See Event run in a workflow.

In a technical demo we add the Strava connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.