Help to configure HTTP request trigger(s)

Hi guys !

as the Title says iā€™m trying to build a workflow using a trigger that will fire when a specific endpoint is called ( Http request), without successā€¦

Hereā€™s what i want to achieve:

i want to update some record in some namespace, but i need that the new ā€œdataā€ is coming from an external system, letā€™s say i want to update the status of an User ( like online-offline but no so frequent).
My tough was that i can use a webapp to make an http request with the information i need in the body and then i want to ā€œcatchā€ that http req inside the corteza workflow to update the record.

Using an example trigger ( system- onManual) the flow is working fine, now i want to complete it using the Http request trigger but i canā€™t find any docs ( i found it but regarding the nodejs code witch is fine but not what iā€™m trying to do now)ā€¦ any suggestion ?

Thanks

EDIT:

i find this Link and i managed to make the workflow work close to expectation, now the ā€œonlyā€ problem is that i canā€™t find out how to parse the body of the Request, in the example it uses ā€œpayloadā€ as variable, i believe itā€™s because the endpoint is /example/payload ?
so in my case iā€™ve /battManag

the full endpoint is $CORTEZA_BASE/api/gateway/battManag

iā€™ve got this error :
" could not exec workflow: workflow 290874736160800771 step 47 execution failed: expression ā€œbattManagā€ failed: failed to select ā€˜payloadā€™ on *expr.Vars: no such key ā€˜battManagā€™".

any suggestions ?
Thanks

Edit:

iā€™m using ā€œrequestā€ as the scope of the function and seems fine but know i got an error during the execution of the js script, somehow it canā€™t JSON.parse(input) so an error is thrownā€¦iā€™m using the script in the example linked, so i donā€™t understandā€¦

Final EDIT:

I found the answer to the problem here, in the new version of Corteza the payload system variable is gone.