Easily Schedule StarThinker Recipes On Google Cloud Functions
A new StarThinker deployment is available on Google Cloud Functions combined with Cloud Scheduler. This allows recipes to be copied and pasted from Colaboratory Notebooks into a low cost server-less scheduled environment.
The Cloud Function
The setup consists of 5 lines of StarThinker Cloud Function code that runs one or more recipes. A single code deployment is easier to deploy, maintain, and update. The recipes themselves are defined in the scheduler.
Both these files are created by the StarThinker Cloud Function Deployment.
The Scheduler
The cloud function can run any task from the StarThinker Gallery or Scripts sample library. Notice that the entire recipe is defined in the Cloud Scheduler body parameter…
The resulting recipe has its own schedule, logs, and ability to run and pause. Effectively the Google Cloud Scheduler becomes a job UI for the user.
The sample recipe is created by the StarThinker Cloud Function Deployment.
Credentials
The recipe itself can embed credentials such as service or user credentials in the { ‘setup’:’auth’:{…}} section. These values can be the actual JSON or string encoded JSON of a Service or user credential. For improved security, it is advised to create a custom Service Credential with its own permissions for the recipe that is independent of the Service account specified in the scheduler.
Parameters
The StarThinker Gallery or Scripts recipes are templates, remember to replace al { ‘field’’:{…}} sections of a recipe with actual values that your script will use. For example:
"say":{"field":{ "name":"say_first", "kind":"string", "order":1, "default":"Hello Once", "description":"Type in a greeting." }}
Becomes:
"say":"Hello World"
That’s it, you can now use scheduled workflows to solve really big problems…