'How to invoke an action of its own service as soon as the service is up in moleculer js?

I am working in moleculer js, in which there is a requirement to call action/handler function of its own service to prepopulate the values from the DB and ecternal API call. If I do using started() method, service throwing below error.

[Runner] Service 'serviceName.actionName' is not found. ServiceNotFoundError: Service 'serviceName.actionName' is not found.

Could you share the beginner documentation/resources for reference? TIA



Solution 1:[1]

The service can call its own actions via this.actions.myAction(params, opts). It's available before the service started/registered.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Icebob