Frontend App Engine Order request Payment Processor Cloud Run Authorize & charge CC Shipper Cloud Functions Prepare & ship items Notifier Cloud Run Notify user
single monolith ➕ Easy to implement: Services simply call each other Cons ➖ Too much coupling ➖ Each service can be a single point of failure ➖ Each service needs its own error / retry / timeout logic ➖ Who ensures the whole transaction is successful? (hint: saga pattern)
➕ Services can be changed/scaled independently ➕ No single point of failure ➕ Events are useful to extend the system Cons ➖ Difficult to monitor ➖ Errors / retries / timeouts are hard ➖ The business flow is not captured explicitly ➖ Who ensures the whole transaction is successful?
and source controlled ➕ Each step can be monitored ➕ Errors / retries / timeouts are centralized ➕ Services are still independent Cons ➖ A new orchestrator service to learn and maintain ➖ Orchestrator could be a single point of failure ➖ Loss of eventing flexibility ➖ How do you compensate for failed steps? (part of saga pattern)
Yes Expressions - string functions Yes Yes Yes Expressions - other functions (SHA..) No Yes No Embedded JS No Yes No Environment Variables No Yes Limited Callbacks Yes Yes Preview Secrets No Yes Yes Bash commands No No No Delay Yes Yes Yes OnError Yes Yes Yes Retry Yes Yes Yes Return output Yes Yes Yes Input / output from a local file No No No echo to stdout No No No Build and run docker container steps No No No Open source runtime No No No User Interface - visualization Yes Yes Yes User Interface - visual editing Yes Yes No Connectors library Some Yes Yes AWS Step Functions Azure Logic Apps Workflows
community-driven ecosystem for defining and running DSL-based workflows that target the Serverless technology domain. • Specification for defining DSL-based workflows • Developer SDKs for different programming languages • Workflow runtimes supporting the specification • Developer tooling support for writing DSL-based workflows
CC Notifier Cloud Run Notify user Shipper Cloud Functions Prepare & ship items MAX: 5 times BACKOFF Payment Processor Cloud Run Authorize & charge CC Notifier Cloud Run Notify user Shipper Cloud Functions Prepare & ship items Pager Cloud Run Escalate to support SUCCESS ERROR Configurable retries Configurable exception handling
Shipper Cloud Functions Prepare & ship items Pager Cloud Run Escalate to support SUCCESS ERROR Out of Stock? No Request from the supplier Yes Read inventory Inventory DB Update inventory Inventory DB Supplier API
formats) ➕ Less code (eg. no event parsing, no Image Analysis & Garbage Collector functions) ➕ Less setup (eg. no Pub/Sub, no Scheduler, no Eventarc) ➕ Easier error handling (eg. the whole chain stops on error)
for best of both worlds 1. Containerize the long-running task, so it can run anywhere. 2. Plan to run the container on a Compute Engine VM with no time limitations. 3. Automate the creation of the VM, running of the container on the VM, and deletion of the VM with Workflows. github.com/GoogleCloudPlatform/workflows-demos/tree/master/long-running-container