Penghubung untuk definisi Workflows

Konektor Workflows yang menentukan fungsi bawaan yang digunakan untuk mengakses definisi Workflows.

Jelajahi lebih lanjut

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

Contoh kode

YAML

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

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

Langkah selanjutnya

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