Is it possible to return a value from a freshworks serverless app webhook?
I’m running a Microsoft flow. I’d like to insert a record in CRM from that. But I’d also like to return the ID of the record in order to allow me to then update it on subsequent steps in flow.
Is it possible to return a value from a webhook?
Below sample simplified:
exports = {
onExternalEventHandler: function (args) {
if(args.data.event=='new_custom_deal_term') {
return createTerms(args).catch(console.error)
} else if(args.data.event=='update_custom_deal_term') {
updateTerms(args).catch(console.error)
}
},
...
}
async function createTerms(args) {
return (await someFunction(args))
}
But I don’t think I can put an await inside the onExternalEventHandler.
I tried calling the web hook and all I get back is {success: true}