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.