Working with Google Cloud WorkFlows

Ajay Kumar
Oct 29, 2020

--

Google recently released another API automation and management service and they named it as ‘workflows’. Orchestrate and automate Google Cloud and HTTP-based API services with serverless workflows.

Key features

Reliable workflow execution

Execute workflows with reliability required for enterprise and line-of-business applications.

Built-in error handling

Out-of-the-box error handling for your workflow steps with configurable retry policies.

Passing variable values between workflow steps

Passing information between steps with built-in JSON parsing and expression-based variable manipulations.

Use cases

Automation is the use case. Since I am a DevOps and Workflow helped me automate APIs and execute automations via their response. Here are some basic screenshots of it automations.

How to write Workflow Template:

Here is an example

- getAnalytics:   call: http.get   args:   url: https://domain.works/users-permissions/roles/1   headers:   Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInRwwewewewewpXVCJ9.eyJpZCI6MTksImlzQWRtaW4iOnRydWUsImlhdCI6MTYwMzE4NzI4MSwiZXhwIjoxNjA1Nzc5MjgxfQ.vActa1n-uqOQUcrwoO0hN_kwNR7hCDeMkwdwd"   result: Analytics- conditionalJump:    switch:    - condition:   ${Analytics.body.role.permissions.application.controllers.analytics.create.enabled == false}      next: sendEmail    - condition:  ${Analytics.body.role.permissions.application.controllers.analytics.create.enabled == true}      next: returnOutputnext: returnOutput- sendEmail:   call: http.post   args:    url: https://us-central1-my-project.cloudfunctions.net/api-domain-analytics-role-change-alert    auth:    type: OIDC    - returnOutput:    return: ${Analytics.body.role.permissions.application.controllers.analytics.create.enabled}

--

--