SDK
Your Lairs have exclusive access to the WayScript SDK, which offers a the following packages to help with tool development:
  • wayscript.context - access process execution metadata
  • wayscript.triggers - call trigger-specific methods
The WayScript SDK is currently available for Python 3.9+. Our team is working on releasing a version that supports JavaScript (Node) in the near future.
1
import wayscript.context as context
Copied!
Method
Description
Parameters
Return Type
context.get_workspace()
Get workspace name
None
dict
context.get_lair()
Get Lair name
None
dict
context.get_lair_trigger()
Get trigger name
None
dict
context.get_process()
Get process id
None
dict
context.get_event()
Get event payload
None
dict
1
import wayscript.triggers as triggers
Copied!
Method
Description
Parameters
Return Type
triggers.http_trigger.send_response(data=<payload>, headers=<headers>, status_code=<status_code>)
Return response to endpoint generated by http trigger
  • data : dict
  • headers : dict
  • status_code : int
dict

Example

1
# Returns json response to http trigger
2
from wayscript.triggers import http_trigger
3
4
payload = {"hello": "world"}
5
headers = {"content-type": "application/json"}
6
status_code = 200
7
8
http_trigger.send_response(data=payload, headers=headers, status_code=status_code)
Copied!
Last modified 2mo ago
Export as PDF
Copy link