WayScript 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, such as event payload
  • wayscript.triggers - call trigger-specific methods

Python

wayscript.context

from wayscript import context
Method
Description
Parameters
Return Type
context.get_event()
Get request event payload
None
dict
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_user_by_application_key(<application_key>)
Get metadata for workspace member from application key
application_key: str
dict
The get_user_by_application_key method requires fetching the application key from the header of the request made to your Lair. We provide an example on how to access the request header in your tool.

wayscript.triggers

import wayscript.triggers as triggers
Method
Description
Parameters
Return Type
triggers.http_trigger.send_response(data, headers, status_code)
Return response to endpoint generated by http trigger Example: send response to http trigger
  • data : dict (json) or other specified type
  • headers : dict
  • status_code : int
dict

JavaScript

const wayscript = require("wayscript");

wayscript.context

context.getWorkspace()
Get workspace name
None
obj
context.getLair()
Get Lair name
None
obj
context.getLairTrigger()
Get trigger name
None
obj
context.getProcess()
Get process id
None
obj
context.getEvent()
Get event payload
None
obj
context.getUserByApplicationKey(application_key)
Get metadata for workspace member from application key
application_key: str
obj
The get_user_by_application_key method requires fetching the application key from the header of the request made to your Lair. We provide an example on how to access the request header in your tool.
wayscript.http_trigger
http_trigger.sendResponse(data, headers, status_code)
Return response to endpoint generated by http trigger Example: send response to http trigger
  • data : obj (json) or other specified type
  • headers : obj
  • status_code : num
obj

Golang

We are working on creating a Go SDK. In the meantime, code snippets for common WayScript methods can be found here: https://github.com/wayscript/wayscript-golang
Export as PDF
Copy link
Outline
Python
JavaScript
Golang