Events
Events are data payloads that are passed to your processes when your Lair’s triggers are invoked. For example, when making a request to a Lair configured with a
http
trigger, your event would contain any query parameters or json data that is included in the request.Events can be accessed using WayScript’s
context
package. Simply import the package and call get_event()
to output your event data (see SDK for more details). The event will be returned as a json dictionary object.Import context package and get event
Python
JavaScript
import wayscript.context as context
event_payload = context.get_event()
const {context} = require("wayscript");
var event_payload = context.getEvent()
{
"created_date":"2022-02-24T18:07:37.513996",
"data":{
"cookies":{...},
"data":"",
"files":{...},
"form":{...},
"headers":{...},
"method":"GET",
"url":"http://emerald-beaver-place-dev.wayscript.cloud/?name=John"
},
"id":"",
"meta":"None",
"trigger_type":"http"
}
Your event payload can be replaced by sample event data during manual invocation of your triggers so you can test processes without using dummy requests or switching between services.
You can pass any valid
json
file to your trigger to use as a test event. You can use the sample event payload as a template for your test event. Select your
json
file in the trigger configuration to use the test event. You must “Push” your file system to pass the configuration to your Lair’s remote instance.Test events are only passed to your process on manual invocations of your Lair’s triggers. Please see Triggers for more details.
Last modified 8mo ago