Langsung ke langkah tertentu dengan syarat

Beralih ke langkah tertentu bergantung pada nilai yang ditampilkan oleh langkah pertama alur kerja.

Mempelajari lebih lanjut

Untuk dokumentasi mendetail yang menyertakan contoh kode ini, lihat artikel berikut:

Contoh kode

YAML

- first_step:
    call: http.get
    args:
      url: https://www.example.com/callA
    result: first_result
- where_to_jump:
    switch:
      - condition: ${first_result.body.SomeField < 10}
        next: small
      - condition: ${first_result.body.SomeField < 100}
        next: medium
    next: large
- small:
    call: http.get
    args:
      url: https://www.example.com/SmallFunc
    next: end
- medium:
    call: http.get
    args:
      url: https://www.example.com/MediumFunc
    next: end
- large:
    call: http.get
    args:
      url: https://www.example.com/LargeFunc
    next: end

Langkah selanjutnya

Untuk menelusuri dan memfilter contoh kode untuk produk Google Cloud lainnya, lihat Google Cloud browser contoh.