Connector for Workflows definitions

Stay organized with collections Save and categorize content based on your preferences.

Workflows connector that defines the built-in function used to access Workflows definitions.

Explore further

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

Code sample


# This workflow demonstrates how to use the Cloud Workflows connector.
# The workflow creates/gets/deletes a workflow.
# Expected successful output: "SUCCESS"

- init:
      - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
      - location: "us-central1"
      - workflow: "dummy-workflow"
- create_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.create
      parent: ${"projects/" + project + "/locations/" + location}
      workflowId: ${workflow}
        name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
        description: "A dummy workflow to be created and deleted."
        sourceContents: "- step:\n    next: end"
- get_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.get
      name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
- delete_workflow:
    call: googleapis.workflows.v1.projects.locations.workflows.delete
      name: ${"projects/" + project + "/locations/" + location + "/workflows/" + workflow}
- the_end:
    return: "SUCCESS"

What's next

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