I endeded up using a workaround. This is because of the workflow client libraries limitation. It does not support all capabilities on par with gcloud for example. Hence nothing much we can customize with the configuration.
To simplify, we have to use
https://cloud.google.com/workflows/docs/samples/workflows-cloud-build-run-gcloud
Example
- execute_monitor_job_async:
call: gcloud
args:
args: $${"run jobs deploy " + monitor_job + " --image " + monitor_job_image + " --region " + gcp_region + " --update-env-vars " + full_env_vars + " --task-timeout 86400s --execute-now"}
and defining gcloud:
gcloud:
params: [args]
steps:
- create_build:
call: googleapis.cloudbuild.v1.projects.builds.create
args:
projectId: $${sys.get_env("gcp_project_id")}
parent: $${"projects/" + sys.get_env("gcp_project_id") + "/locations/global"}
body:
serviceAccount: $${"projects/" + sys.get_env("gcp_project_id") + "/serviceAccounts/" + sys.get_env("cloud_build_sa")}
options:
logging: CLOUD_LOGGING_ONLY
steps:
- name: gcr.io/google.com/cloudsdktool/cloud-sdk
entrypoint: /bin/bash
args: $${["-c", "gcloud " + args + " > $$BUILDER_OUTPUT/output"]}
result: result_builds_create
- return_build_result:
return: $${text.split(text.decode(base64.decode(result_builds_create.metadata.build.results.buildStepOutputs[0])), "\n")}
(Note: the "full_env_vars" details are omitted here, it's just various env vars i need for my run jobs to pass in)
The result: It will not block the workflow steps anymore. It will proceed to next step
If anyone want to read more there's a good explanation article by Mark - https://medium.com/@markwkiehl/google-cloud-run-jobs-scheduler-22a4e9252cf0