Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.26 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.26 KB

Cloud function for triggering Dataform workflows

dataformTrigger Cloud Run Function

This function may be triggered by a PubSub message or Cloud Scheduler and triggers a Dataform workflow based on the trigger configuration provided.

Configuration

Trigger types:

  1. event - immediately triggers a Dataform workflow using tags provided in configuration.

  2. poller - first triggers a BigQuery polling query. If the query returns TRUE, the Dataform workflow is triggered using the tags provided in configuration.

See available trigger configurations.

Request body example with trigger name:

{
  "name": "cwv_tech_report"
}

Local testing

Run the following command to test the function locally:

npm run start

Then, in a separate terminal, run the following command to trigger the function:

curl -X POST http://localhost:8080/ \
  -H "Content-Type: application/json" \
  -d '{
    "message": {
      "name": "cwv_tech_report"
    }
  }'

Deployment

When you're under src/ run:

npm run deploy