Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Google Cloud Platform logo

Cloud Workflows Quickstart – Node.js

This sample shows how to execute a Cloud Workflow and wait for the workflow execution results.

Setup

  1. Read Prerequisites and [How to run a sample][run] first.

  2. Deploy the workflow, myFirstWorkflow:

    1. Copy the YAML from this file: https://github.com/GoogleCloudPlatform/workflows-samples/blob/main/src/myFirstWorkflow.workflows.yaml
    2. Paste the YAML into a file called myFirstWorkflow.workflows.yaml.
    3. Run the command: gcloud beta workflows deploy $WORKFLOW --source myFirstWorkflow.workflows.yaml

Run the Quickstart

  1. Run the script, either with environment variables or command-line arguments:

    node . <projectId> [cloudRegion] [workflowName].

    or

    GOOGLE_CLOUD_PROJECT=... node .: The Cloud project with the workflow myFirstWorkflow.

  2. Observe the results:

    In stdout, you should see a JSON response from your workflow like the following:

    ["Wednesday","Wednesday Night Wars","Wednesday 13","Wednesday Addams","Wednesday Campanella","Wednesdayite","Wednesday Martin","Wednesday Campanella discography","Wednesday Night Hockey (American TV program)","Wednesday Morning, 3 A.M."]