This sample shows how to execute a Cloud Workflow and wait for the workflow execution results.
-
Read Prerequisites and [How to run a sample][run] first.
-
Deploy the workflow,
myFirstWorkflow:- Copy the YAML from this file: https://github.com/GoogleCloudPlatform/workflows-samples/blob/main/src/myFirstWorkflow.workflows.yaml
- Paste the YAML into a file called
myFirstWorkflow.workflows.yaml. - Run the command:
gcloud beta workflows deploy $WORKFLOW --source myFirstWorkflow.workflows.yaml
-
Run the script, either with environment variables or command-line arguments:
node . <projectId> [cloudRegion] [workflowName].or
GOOGLE_CLOUD_PROJECT=... node .: The Cloud project with the workflowmyFirstWorkflow. -
Observe the results:
In stdout, you should see a JSON response from your workflow like the following:
[ "Wednesday", "Wednesday Night Wars", "Wednesday 13", "Wednesday Addams", "Wednesday Campanella", "Wednesdayite", "Wednesday Martin", "Wednesday Campanella discography", "Wednesday Night Hockey (American TV program)", "Wednesday Morning, 3 A.M." ]