Invoke an function within an function

Hi,
Iam trying to invoke an cloud function from another cloud using the below code,but getting error executefunction method is not recognised outside main function.

Error:
node:1) UnhandledPromiseRejectionWarning: TypeError: app.executeFunction is not a function

 at eval (eval at <anonymous> (/app/app.js:894:69), <anonymous>:8:7)

 at getApiResponse (eval at <anonymous> (/app/app.js:894:69), <anonymous>:3:8)

Code:
app.executeFunction(‘logData’,’’,‘test’).then((optional_returned_value) => {

return resolve(optional_returned_value);  

}).catch((e) => {

  app.log("exceptiontestlog",e);

//handle error

});

function name :logData

return new Promise(resolve => {

app.log("newtestlog",'newtest');

  // Your logic goes here

  resolve();

});

1 Like

Hey @ASHOKKUMAR.THANGAVEL ,

On the cloud.yellow.ai platform, it’s not allowed to call another function from a function.

Hi Patrik,
Thanks For the response, So the Functions Can be Invoked only from Main()

1 Like

I’d suggest invoking functions from the function node itself.