Cloud Workflow Activity Worker
Infrastructure2024

CLOUDWORKFLOWACTIVITYWORKER

Axum 0.7 worker — eight activity types, Cloud Tasks, Build/Storage/Artifact Registry SDKs, graceful shutdown.

8
Workflow activity types
0.7
Axum service version
30s
Outbound HTTP timeout bound
SCROLL
Client
Stealth Startup
Domain
Infrastructure / GCP
Platform
Cloud Run
Duration
2024
Core Stack
Rust · GCP
The Brief

THE
PROBLEM

Cloud Workflow-style automations needed a Rust Axum 0.7 worker on Cloud Run that executes eight distinct activity types when Cloud Tasks enqueue work — including callbacks into partner systems and GCP SDK operations for build artifacts and storage.

Tokio-driven work queue, Tower middleware for tracing and auth, official google-cloud-rust crates for Cloud Storage, Cloud Build, Artifact Registry, and Cloud Tasks, outbound callbacks through reqwest with timeouts, and graceful shutdown handlers that finish in-flight activities when possible.

Core Engineering Challenge

Coordinate async activity execution under concurrency caps, ship an FFI-bearing Docker image suitable for Cloud Run, drain Cloud Tasks safely on SIGTERM, and authenticate to multiple google-cloud-rust clients without blocking the Tokio runtime.

GCP
Infra
Extended stack
backend
Rust
devops
GCP
Worker
Worker
How we built it

THE ARCHITECTURE

01
Axum service shell

Health endpoints, structured logging, and request IDs for task-triggered invokes.

AxumTower
02
Activity dispatch

Map eight activity types to async handlers with shared context and retries.

TokioRust
03
GCP SDK calls

Storage uploads/downloads, build triggers, artifact metadata — all non-blocking patterns.

google-cloud-rustGCP
04
Outbound callbacks

reqwest clients with bounded timeouts and idempotency keys for partners.

reqwestHTTP
05
Container & SIGTERM

Docker image with FFI deps; signal handling drains in-flight tasks before exit.

DockerCloud Run
System Data Flow
Ingestion
CrawlerContent Hash10K+ pages
Processing
ChunkerDeduplicatorEmbedding API
Storage
pgvectorPostgreSQLRedis Cache
Auth
Identity ProviderJWT BridgeSessions
Query
HNSW SearchRe-rankerLLM Stream
Delivery
Web AppMobile AppUsers
What we delivered

THE RESULTS

GCP

Cloud Run service plus Cloud Tasks, Cloud Build, Cloud Storage, and Artifact Registry integrations — the worker became the glue layer between workflow definitions and imperative GCP APIs without a second Java/Spring stack to maintain.

GCP
Infra

Cloud Run service plus Cloud Tasks, Cloud Build, Cloud Storage, and Artifact Registry integrations — the worker became the glue layer between workflow definitions and imperative GCP APIs without a second Java/Spring stack to maintain.

Engineering decisions

TECH
DEEP DIVE

RS
Rust on Cloud Run

Memory-safe concurrency for mixed IO workloads without JVM cold-start tax.

Tower middleware centralized auth and tracing across heterogeneous activity handlers.

GCP
Official Rust clients

Typed APIs beat REST shims for Storage/Build/Task operations with less drift.

Graceful shutdown prevented duplicate side effects when Cloud Run rotated instances.

Next Case Study
Mobile App
Nuzit

News & social wall

FlutterFirebase
Start a project

LET'S
BUILD
SOMETHING.

We take on a small number of projects at a time. If the problem is hard, we're interested.

Email
hello@techmusketeers.com
Response time
Within 24 hours
Availability
Open for new projects · 2025