Conditional jump to a specific step

Jumps to a specific step depending on the day of the week returned by the first step of the workflow.

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample


- getCurrentTime:
    call: http.get
    result: currentTime
- conditionalSwitch:
      - condition: ${currentTime.body.dayOfTheWeek == "Friday"}
        next: friday
      - condition: ${currentTime.body.dayOfTheWeek == "Saturday" OR currentTime.body.dayOfTheWeek == "Sunday"}
        next: weekend
    next: workWeek
- friday:
    return: "It's Friday! Almost the weekend!"
- weekend:
    return: "It's the weekend!"
- workWeek:
    return: "It's the work week."

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.