Konektor untuk definisi Workflows

Konektor Alur Kerja yang menentukan fungsi bawaan yang digunakan untuk mengakses definisi Alur Kerja.

Mempelajari lebih lanjut

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

Contoh kode

YAML

# This workflow demonstrates how to use the Workflows connector:
# Create, get, and then delete a workflow
# Expected 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 create and delete using the Workflows connector"
        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.