OAuth authentication workflow

Hi all, there are many services that requires OAuth authentication before to work with their API, I mean, do some
Get request or Put some data in their accounts. Google and Microsoft are good examples of this kind of API’s. I’m trying to design a workflow to cover Google OAuth. On this link there is a good explanation of this procedure. https://developers.google.com/identity/protocols/OAuth2WebServer#creatingcred

A complete OAuth procedure have different task, one for “code” request, next one for “exchange a code” for a valid “token” and with this you can build http request during a valid period of time and after this expires you also must to renew this “token” periodically before this expires. So, seems to be razonable to create a workflow for each of them or not?. Is this possible to share data between workflows ?. “Store value” and “Get value” nodes only have a workflow environment but does not possible to share in between? . What it is the best strategy to solve this?

An a second questions is related with a solution deploy. If I want provide this solution for many devices, I mean, many devices connected to many different calendars accounts, then I’ll need one set of workflows for each of them ?? or I can execute this workflow (with the different parameter call for each of them) one time for any device ?.

thanks,

It is not currently possible to easily share data between workflows. Workflows can have multiple triggers, so you could add a timer trigger the same workflow that periodically updates the token.

The workflow device trigger can trigger on a device tag, which means if you tag every device with the same value, all of them will trigger the same workflow. The device’s ID, name, and tags are added to the workflow payload so you can properly identify the device when it runs. A common way to do this would be to add a customer id tag to the device, then when the workflow triggers you’ll get the customer id, which you can then use to request the appropriate data from the calendar.