Clive Wright
Clive Wright

Reputation: 1

How do you start a workflow from another workflow - and pass an argument to the sub or child workflow?

This is a follow on question from how do you start a workflow from another workflow and retrieve the return value of called workflow

Upvotes: 0

Views: 160

Answers (1)

Kris Braun
Kris Braun

Reputation: 1412

Use the workflows.executions.run helper method, which formats the request and blocks until the workflow execution has completed:

- run_execution:
    try:
      call: googleapis.workflowexecutions.v1.projects.locations.workflows.executions.run
      args:
        workflow_id: ${workflow}
        location: ${location}   # Defaults to current location
        project_id: ${project}  # Defaults to current project
        argument: ${arguments}  # Arguments could be specified inline as a map instead.
      result: r1
    except:
      as: e
      steps: ... # handle a failed execution

Upvotes: 1

Related Questions