Google Cloud Dataflow · Arazzo Workflow

Google Cloud Dataflow Drain Running Job

Version 1.0.0

Confirm a streaming job is running, request a drain, then poll until it is drained.

1 workflow 1 source API 1 provider
View Spec View on GitHub Apache BeamBatch ProcessingBig DataData ProcessingETLStream ProcessingArazzoWorkflows

Provider

google-cloud-dataflow

Workflows

drain-running-job
Confirm running, request drain, and poll until JOB_STATE_DRAINED.
Reads a job to confirm it is running, updates its requested state to JOB_STATE_DRAINING, then polls until it reaches JOB_STATE_DRAINED.
3 steps inputs: accessToken, jobId, location, projectId outputs: finalState, jobId
1
confirmRunning
Read the job and confirm it is currently in the JOB_STATE_RUNNING state before requesting a drain.
2
requestDrain
Update the job's requested state to JOB_STATE_DRAINING so it stops ingesting new data while finishing in-flight work.
3
pollUntilDrained
Poll the job until it reports the terminal JOB_STATE_DRAINED state, retrying while it is still draining.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Google Cloud Dataflow Drain Running Job
  summary: Confirm a streaming job is running, request a drain, then poll until it is drained.
  description: Gracefully stops a running streaming Dataflow job by draining it, which stops ingesting new data
    while finishing in-flight work. The workflow reads the job to confirm it is running, issues an update that sets
    the requested state to JOB_STATE_DRAINING, then polls the job until it reports the terminal JOB_STATE_DRAINED
    state. Every step spells out its request inline, including the inline Bearer authorization Google Cloud requires,
    so the flow can be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: jobsApi
  url: ../openapi/google-cloud-dataflow-projects-api-openapi.yml
  type: openapi
workflows:
- workflowId: drain-running-job
  summary: Confirm running, request drain, and poll until JOB_STATE_DRAINED.
  description: Reads a job to confirm it is running, updates its requested state to JOB_STATE_DRAINING, then polls
    until it reaches JOB_STATE_DRAINED.
  inputs:
    type: object
    required:
    - accessToken
    - projectId
    - location
    - jobId
    properties:
      accessToken:
        type: string
        description: Google Cloud OAuth 2.0 access token used as a Bearer credential.
      projectId:
        type: string
        description: The Google Cloud project id that owns the job.
      location:
        type: string
        description: The regional endpoint that contains the job (e.g. us-central1).
      jobId:
        type: string
        description: The id of the running streaming job to drain.
  steps:
  - stepId: confirmRunning
    description: Read the job and confirm it is currently in the JOB_STATE_RUNNING state before requesting a drain.
    operationId: dataflow.projects.locations.jobs.get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: projectId
      in: path
      value: $inputs.projectId
    - name: location
      in: path
      value: $inputs.location
    - name: jobId
      in: path
      value: $inputs.jobId
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/currentState == 'JOB_STATE_RUNNING'
    outputs:
      currentState: $response.body#/currentState
  - stepId: requestDrain
    description: Update the job's requested state to JOB_STATE_DRAINING so it stops ingesting new data while finishing
      in-flight work.
    operationId: dataflow.projects.locations.jobs.update
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: projectId
      in: path
      value: $inputs.projectId
    - name: location
      in: path
      value: $inputs.location
    - name: jobId
      in: path
      value: $inputs.jobId
    - name: updateMask
      in: query
      value: requestedState
    requestBody:
      contentType: application/json
      payload:
        requestedState: JOB_STATE_DRAINING
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      requestedState: $response.body#/requestedState
  - stepId: pollUntilDrained
    description: Poll the job until it reports the terminal JOB_STATE_DRAINED state, retrying while it is still
      draining.
    operationId: dataflow.projects.locations.jobs.get
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: projectId
      in: path
      value: $inputs.projectId
    - name: location
      in: path
      value: $inputs.location
    - name: jobId
      in: path
      value: $inputs.jobId
    successCriteria:
    - condition: $statusCode == 200
    - condition: $response.body#/currentState == 'JOB_STATE_DRAINED'
    outputs:
      currentState: $response.body#/currentState
    onFailure:
    - name: keepPolling
      type: retry
      retryAfter: 30
      retryLimit: 60
      criteria:
      - condition: $statusCode == 200
      stepId: pollUntilDrained
  outputs:
    jobId: $inputs.jobId
    finalState: $steps.pollUntilDrained.outputs.currentState

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/google-cloud-dataflow-drain-running-job-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.