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.