0
0
GCPcloud~10 mins

Workflows for orchestration in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a simple step in a Google Cloud Workflow.

GCP
steps:
  - sayHello:
      call: http.get
      args:
        url: "https://example.com/api/[1]"
      result: response
Drag options to blanks, or click blank then click option'
Aworld
Bhello
Cgreet
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated words that do not fit the URL path.
2fill in blank
medium

Complete the code to specify the workflow's main entry point.

GCP
main:
  steps:
    - firstStep:
        call: [1]
        args:
          url: "https://example.com"
        result: output
Drag options to blanks, or click blank then click option'
AtriggerEvent
BstartWorkflow
CinitProcess
Dhttp.get
Attempts:
3 left
💡 Hint
Common Mistakes
Using custom function names instead of built-in calls.
3fill in blank
hard

Fix the error in the step that calls a Cloud Function.

GCP
steps:
  - callFunction:
      call: [1]
      args:
        name: projects/my-project/locations/us-central1/functions/myFunction
      result: functionResponse
Drag options to blanks, or click blank then click option'
Acloudfunctions.callFunction
Bcloudfunctions.invokeFunction
Ccloudfunctions.call
Dcloudfunctions.execute
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names that do not exist.
4fill in blank
hard

Fill both blanks to correctly handle a conditional step in the workflow.

GCP
steps:
  - checkStatus:
      switch:
        - condition: ${response.status_code == [1]
          next: successStep
        - condition: ${response.status_code == [2]
          next: failureStep
Drag options to blanks, or click blank then click option'
A200
B404
C500
D302
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing status codes or using non-standard codes.
5fill in blank
hard

Fill all three blanks to correctly define a loop that calls an API for each item.

GCP
steps:
  - processItems:
      for:
        value: item
        in: [1]
      steps:
        - callApi:
            call: http.post
            args:
              url: "https://api.example.com/data"
              body: $[2]
            result: apiResponse
      result: responses
  - returnResults:
      return: [3]
Drag options to blanks, or click blank then click option'
AitemsList
B{"item": item}
Cresponses
DdataArray
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or returning undefined variables.