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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With