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

Format of event payload

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.
Last modified 8mo ago