Runtime Actions as Webhook

The integration between Adobe I/O Runtime and I/O Events lets you create Runtime actions to be set up as webhook endpoints on the Developer Console for receiving events, so that every time an event fires, your Runtime action is executed. Set up your runtime action as webhook only if you have relatively short-running action (that responds within 60 seconds).

For long-running (async) actions and guaranteed event handling you should consider using the journaling approach for consuming events.

Setting up Webhook Integration with Runtime Action

The Runtime cli will let you create a runtime action and hook it up with an integration via Adobe Developer Console. Read here to setup your cli with Runtime plugin which is required as pre-requisite.

Things to Note

Benefits of using Runtime Action as Webhook

Built In Signature Verification

With integration between I/O Events and Adobe I/O Runtime, you don't need to worry about security as your runtime actions configured as webhooks are secured with an out-of-the-box signature verification implementation. So, basically whatever runtime action you use to create an event registration, the handler webhook created due to that will place a signature validator action along with your action as in a sequence. I/O Events signs the event payload using digital signatures generated using its private keys and passes the signatures as well as its public keys as request headers while invoking your webhook. Your business logic runtime action will only be invoked once the validator action successfully verifies any one of the digital signatures using the public keys. You can read more about the digital signatures based authentication mechanism here.

Tracing Actions with Activation Ids

Debug Tracing is a pretty important tool on Developer Console for users who want to be informed whether their runtime action invocation is successful or not or what it responds.

After setting up a runtime action as webhook, upon its successful invocation, you can see custom response returned from your own runtime action in the Debug Tracing webhook response section as below.

Debug Tracing Webhook Response on Adobe Developer Console

However, in case of any failed invocation to your webhook, you will get an error response body with an activation id for the same. This helps users to debug their actions as below

Request Headers

Some of the headers sent in the event delivery request are also available to the target user runtime action:

Header Name
Description
Example Value(s)
x-request-id
The request id used for tracing the request in logs. Different for each request/delivery attempt.
y1FE6aNgRkxXmLstRPfrdjZD27cZw1Kg
x-adobe-delivery-id
The delivery id used for tracing the delivery in logs. Different for each request/delivery attempt.
42d69d83-1732-47b0-9cff-3cd2d8924b1d
x-adobe-event-code
The type (event code) of the event.
com.adobe.test.runtime_headers_test_cloudevents
x-adobe-event-id
The event id used for tracing the event in logs. The same event id is used for all the delivery attempts of a particular event.
9ca7ca63-4ccc-4c74-a84e-304988f25d0b
x-adobe-provider
The event provider name that produced this event.
3rd_party_custom_events_908936ED5D35CC220A495CD4@AdobeOrg_01990f09-74be-73fa-9455-bd0711ad287c
x-adobe-retry-count
The delivery retry count — not present in the first delivery attempt, only present in the subsequent retries. See the event delivery retrying process for more details.
1, 2, ...