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.

Accessing events within your Lair

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
1
import wayscript.context as context
2
event_payload = context.get_event()
Copied!
1
const wayscript = require("wayscript");
2
var event_payload = context.getEvent()
Copied!

Format of event payload

1
{
2
"created_date":"2022-02-24T18:07:37.513996",
3
"data":{
4
"cookies":{...},
5
"data":"",
6
"files":{...},
7
"form":{...},
8
"headers":{...},
9
"method":"GET",
10
"url":"http://emerald-beaver-place-dev.wayscript.cloud/?name=John"
11
},
12
"id":"",
13
"meta":"None",
14
"trigger_type":"http"
15
}
Copied!
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.

Creating test event json file

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.

Attaching test events to triggers

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.

Passing test event data to your processes

Test events are only passed to your process on manual invocations of your Lair’s triggers. Please see Triggers for more details.
Export as PDF
Copy link