Run a workflow that executes other workflows in parallel

Uses a parent workflow that invokes a child workflow through a connector. Each iteration of the child workflow is passed an iteration argument. The parent workflow waits for and stores the result of each child workflow execution.

Explore further

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

Code sample

YAML

try:
  steps:
    - execute_child_workflow:
        call: googleapis.workflowexecutions.v1.projects.locations.workflows.executions.run
        args:
          workflow_id: workflow-child
          #location: ...
          #project_id: ...
          argument:
            iteration: ${iteration}
        result: execution_result
    - save_successful_execution:
        assign:
          - execution_results.success[string(iteration)]: ${execution_result}
except:
    as: e
    steps:
      - save_failed_execution:
          assign:
            - execution_results.failure[string(iteration)]: ${e}

What's next

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