capabilities.work

Drain Running Job

A 3-step recipe with Google Cloud Dataflow. We can help you get access.

Recipe · 3 steps

Drain Running Job

Confirm running, request drain, and poll until JOB_STATE_DRAINED.

  1. Read the job and confirm it is currently in the JOB_STATE_RUNNING state before requesting a drain.
  2. Update the job's requested state to JOB_STATE_DRAINING so it stops ingesting new data while finishing in-flight work.
  3. Poll the job until it reports the terminal JOB_STATE_DRAINED state, retrying while it is still draining.
What you'll need to have ready
  • accessToken: Google Cloud OAuth 2.0 access token used as a Bearer credential.
  • projectId: The Google Cloud project id that owns the job.
  • location: The regional endpoint that contains the job (e.g. us-central1).
  • jobId: The id of the running streaming job to drain.
For your developer

Arazzo workflow google-cloud-dataflow:drain-running-job, 3 operations: getLocationJob → updateLocationJob → getLocationJob. Specs on APIs.io.