Perform a parallel step using branches

Executes parallel branches concurrently, with the steps in each branch executing sequentially.

Explore further

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

Code sample

YAML

main:
  params: [args]
  steps:
    - init:
        assign:
          - user: {}
          - notification: {}
    - parallelStep:
        parallel:
          shared: [user, notification]
          branches:
            - getUser:
                steps:
                  - getUserCall:
                      call: http.get
                      args:
                        url: ${"https://example.com/users/" + args.userId}
                      result: user
            - getNotification:
                steps:
                  - getNotificationCall:
                      call: http.get
                      args:
                        url: ${"https://example.com/notification/" + args.notificationId}
                      result: notification

What's next

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