diff --git a/.changelog/8369.txt b/.changelog/8369.txt new file mode 100644 index 00000000000..4bb1b2e783c --- /dev/null +++ b/.changelog/8369.txt @@ -0,0 +1,5 @@ +```release-note:none + +docs: Update the example for `google_workflows_workflow` + +``` diff --git a/google/resource_workflows_workflow_generated_test.go b/google/resource_workflows_workflow_generated_test.go index 44ff27880a7..7f6e94fc3d3 100644 --- a/google/resource_workflows_workflow_generated_test.go +++ b/google/resource_workflows_workflow_generated_test.go @@ -62,31 +62,32 @@ resource "google_workflows_workflow" "example" { description = "Magic" service_account = google_service_account.test_account.id source_contents = <<-EOF - # This is a sample workflow, feel free to replace it with your source code + # This is a sample workflow. You can replace it with your source code. # # This workflow does the following: # - reads current time and date information from an external API and stores - # the response in CurrentDateTime variable + # the response in currentTime variable # - retrieves a list of Wikipedia articles related to the day of the week - # from CurrentDateTime + # from currentTime # - returns the list of articles as an output of the workflow - # FYI, In terraform you need to escape the $$ or it will cause errors. + # + # Note: In Terraform you need to escape the $$ or it will cause errors. - getCurrentTime: call: http.get args: - url: https://us-central1-workflowsample.cloudfunctions.net/datetime - result: CurrentDateTime + url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam + result: currentTime - readWikipedia: call: http.get args: url: https://en.wikipedia.org/w/api.php query: action: opensearch - search: $${CurrentDateTime.body.dayOfTheWeek} - result: WikiResult + search: $${currentTime.body.dayOfWeek} + result: wikiResult - returnOutput: - return: $${WikiResult.body[1]} + return: $${wikiResult.body[1]} EOF } `, context) diff --git a/website/docs/r/workflows_workflow.html.markdown b/website/docs/r/workflows_workflow.html.markdown index 7e17cf4a80d..deaf422a71e 100644 --- a/website/docs/r/workflows_workflow.html.markdown +++ b/website/docs/r/workflows_workflow.html.markdown @@ -48,31 +48,32 @@ resource "google_workflows_workflow" "example" { description = "Magic" service_account = google_service_account.test_account.id source_contents = <<-EOF - # This is a sample workflow, feel free to replace it with your source code + # This is a sample workflow. You can replace it with your source code. # # This workflow does the following: # - reads current time and date information from an external API and stores - # the response in CurrentDateTime variable + # the response in currentTime variable # - retrieves a list of Wikipedia articles related to the day of the week - # from CurrentDateTime + # from currentTime # - returns the list of articles as an output of the workflow - # FYI, In terraform you need to escape the $$ or it will cause errors. + # + # Note: In Terraform you need to escape the $$ or it will cause errors. - getCurrentTime: call: http.get args: - url: https://us-central1-workflowsample.cloudfunctions.net/datetime - result: CurrentDateTime + url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam + result: currentTime - readWikipedia: call: http.get args: url: https://en.wikipedia.org/w/api.php query: action: opensearch - search: $${CurrentDateTime.body.dayOfTheWeek} - result: WikiResult + search: $${currentTime.body.dayOfWeek} + result: wikiResult - returnOutput: - return: $${WikiResult.body[1]} + return: $${wikiResult.body[1]} EOF } ```