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.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample


- getCurrentTime:
    call: http.get
    result: currentTime
- conditionalSwitch:
      - condition: ${currentTime.body.dayOfWeek == "Friday"}
        next: friday
      - condition: ${currentTime.body.dayOfWeek == "Saturday" or currentTime.body.dayOfWeek == "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.