Calling "process" method in pipeline components

Hi! I’m new to Rasa, and I need to know why the first 5 components (their “process” methods)are called more than one time in the pipeline as showed in the figure below and if I need to add a custom component to the pipeline without calling it’s “process” method more than one time what can I do:

thanks in advance

@esraa It seems the issue is because we are also using the components to add additional features when predicting the next action of the bot. Why is it an issue for your component if it is called multiple times?

Because my custom component is calling an API and I pay for each call so when it is called multiple times without using it, it will be wasting money. So I ask if there is a solution to prevent multiple calls or another solution to call an API once before entering the pipeline? And I have another question: are there docs that are explaining more about the mechanism of calling components and the codes?

thanks in advance.

@Tobias_Wochinger your help will be highly appreciated !!

So I ask if there is a solution to prevent multiple calls or another solution to call an API once before entering the pipeline?

How about using a cache inside your component?

And I have another question: are there docs that are explaining more about the mechanism of calling components and the codes?

What do you mean exactly?