Google Cloud Workflows ⇄ Pulse
Cloud Workflows possède l'orchestration et parle HTTP nativement (call: http.post / http.get) — contrairement à Step Functions, Pulse n'a besoin d'aucune fonction de glue. Deux call steps, c'est le bridge. Exemple du repo : examples/gcp-workflows-pulse-bridge/.
sendToPulse (http.post → /x/order-scoring/in) → sys.sleep 2s → readVerdict (http.get) → scanEvents (for) → decide (switch) → escalate | auto-approve
Lancez-le en local — le vrai workflow.yaml
pulse server start --dev
mkdir app && cp pulse.yaml app/ && (cd app && pulse deploy .)
pip install requests pyyaml
PULSE_URL=http://localhost:9090 PULSE_TOKEN=$(jq -r '.profiles[.currentProfile].token' ~/.pulse/credentials.json) \
python run_local.py
run_local.py est un mini-interpréteur GCW qui exécute le même workflow.yaml que vous déploieriez avec gcloud — assign, les call steps, la boucle for, switch, return, et les expressions ${...}. Sortie validée :
amount= 2500 -> decision=escalate
amount= 300 -> decision=auto-approve
Déployer sur le vrai GCP
gcloud workflows deploy pulse-order-scoring --source=workflow.yaml
Il lit PULSE_URL/PULSE_TOKEN depuis l'environnement d'exécution. Le statut 🧪 : la définition est prouvée contre un Pulse vivant ; le run hébergé GCP demande votre projet.