Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP Workflows: Easy way to re-run failed execution

Given failed workflow execution (identified by workflow ID and execution ID),
I need a relatively quick and easy way to re-run it using CLI tools (gcloud), with the same input payload.
Asking Google and searching over stackoverflow didn't bring me any easy way to do this.

like image 562
Slava Medvediev Avatar asked Nov 29 '25 13:11

Slava Medvediev


1 Answers

While the UI offers easy ways to rerun an execution, gcloud doesn't have a shortcut (yet). You could build one with a bit of shell scripting, retrieving the previous arguments and passing them to a new execution:

#/bin/sh
# Usage: ./rerun.sh LOCATION WORKFLOW EXECUTION_ID
DATA=`gcloud workflows executions describe $3 --location $1 --workflow $2 | grep "^argument:" | cut -f2 -d' ' | sed -e "s/^'//" -e "s/'$//"`
gcloud workflows run $2 --location $1 --data=$DATA
like image 129
Kris Braun Avatar answered Dec 01 '25 08:12

Kris Braun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!