谷歌云工作流调用API和加载响应json到GCS桶



我正在尝试使用GCP工作流调用API并将响应加载到GCS桶中。我已经按例使用,但我无法加载json响应到gcs桶。请建议。

main:
params: [input]
steps:
- checkInput:
swicth:
- condition: ${"searchterm" in input}
assign:
- searchTerm: ${input.searchTerm}
next: readwikipedia
- getcurrenttime:
call: http.get
args:
url: https://us-central-workflowsample.cloudfunctions.net/datetime
result: currentDate
- setFromcallResult:
assign:
- searchTerm: ${currentDate.body.dayOfTheWeek}
- readWiki:
call: http:get
args:
url: https://en.wikipedia.org/w/api.php
query:
action: opensearch
search:${searchTerm}
result: wikiResult
- returoOutput:
return: ${wikiResult.body[1]}
- load_gcs
call: googleapis.storage.v1.objects.insert
args:
bucket: "test_buck"
uploadType: "media"
name: "sample.json"
body: ${wikiResult.body[1]}

下面的代码将结束您的工作流:

- returoOutput:
return: ${wikiResult.body[1]}

所以它永远不会到达步骤'load_gcs'。试着把那一步放在最后。