Interdependent RESTful Sensors

Hey guys,

I have a curious one I hope someone can help me out with. I’ve created multiple RESTful templates to:

  1. Log into an API’s auth endpoint, authenticate and store the bearer token as a sensor
  2. Use the above-retrieved bearer token to retrieve a list of components associated with the account.
  3. Use the component’s ID from point 2 to retrieve details of said component.

Now, the problem I’m running into is the dependency of the templates on each other. Both 2 and 3 requires the bearer token, while 3 requires the id from 2 in order to retrieve its details.

Any idea how to make 2 and 3 wait for the data to be populated before firing?

Cheers!