Amazon EventBridge Pipes · Arazzo Workflow

EventBridge Pipes Create Pipe and Await Running

Version 1.0.0

Create a pipe with DesiredState RUNNING, then poll DescribePipe until it reports CurrentState RUNNING.

1 workflow 1 source API 1 provider
View Spec View on GitHub Amazon Web ServicesEvent-DrivenIntegrationMessagingServerlessArazzoWorkflows

Provider

amazon-eventbridge-pipes

Workflows

create-pipe-await-running
Create a pipe and poll until it reaches the RUNNING state.
Creates a pipe connecting a source to a target via a role, requesting the RUNNING desired state, then polls DescribePipe and loops while the pipe is still transitioning, ending once CurrentState is RUNNING.
2 steps inputs: description, name, roleArn, source, target outputs: finalState, pipeArn, stateReason
1
createPipe
CreatePipe
Create the pipe wiring the source to the target through the supplied role and request that it move to the RUNNING desired state.
2
pollState
DescribePipe
Read the current state of the pipe. If it is still transitioning toward RUNNING, loop back and poll again; once it is RUNNING the workflow ends.

Source API Descriptions

Arazzo Workflow Specification

amazon-eventbridge-pipes-create-pipe-await-running-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: EventBridge Pipes Create Pipe and Await Running
  summary: Create a pipe with DesiredState RUNNING, then poll DescribePipe until it reports CurrentState RUNNING.
  description: >-
    Provisioning an EventBridge pipe is asynchronous: CreatePipe returns
    immediately with the pipe in a CREATING state, and the pipe only begins
    moving events once it transitions to RUNNING. This workflow creates a pipe
    that wires a source to a target through an IAM role with DesiredState set to
    RUNNING, then repeatedly calls DescribePipe and branches on the reported
    CurrentState until the pipe is RUNNING. Each step spells out its request
    inline so the flow can be read and executed without opening the underlying
    OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: pipesApi
  url: ../openapi/amazon-eventbridge-pipes-openapi.yml
  type: openapi
workflows:
- workflowId: create-pipe-await-running
  summary: Create a pipe and poll until it reaches the RUNNING state.
  description: >-
    Creates a pipe connecting a source to a target via a role, requesting the
    RUNNING desired state, then polls DescribePipe and loops while the pipe is
    still transitioning, ending once CurrentState is RUNNING.
  inputs:
    type: object
    required:
    - name
    - roleArn
    - source
    - target
    properties:
      name:
        type: string
        description: The name of the pipe to create (1-64 chars, ^[\.\-_A-Za-z0-9]+$).
      roleArn:
        type: string
        description: The ARN of the IAM role that allows the pipe to send data to the target.
      source:
        type: string
        description: The ARN of the source resource for the pipe.
      target:
        type: string
        description: The ARN of the target resource for the pipe.
      description:
        type: string
        description: An optional description of the pipe.
  steps:
  - stepId: createPipe
    description: >-
      Create the pipe wiring the source to the target through the supplied role
      and request that it move to the RUNNING desired state.
    operationId: CreatePipe
    parameters:
    - name: Name
      in: path
      value: $inputs.name
    requestBody:
      contentType: application/json
      payload:
        RoleArn: $inputs.roleArn
        Source: $inputs.source
        Target: $inputs.target
        Description: $inputs.description
        DesiredState: RUNNING
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      pipeArn: $response.body#/Arn
      currentState: $response.body#/CurrentState
      desiredState: $response.body#/DesiredState
      creationTime: $response.body#/CreationTime
  - stepId: pollState
    description: >-
      Read the current state of the pipe. If it is still transitioning toward
      RUNNING, loop back and poll again; once it is RUNNING the workflow ends.
    operationId: DescribePipe
    parameters:
    - name: Name
      in: path
      value: $inputs.name
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentState: $response.body#/CurrentState
      desiredState: $response.body#/DesiredState
      stateReason: $response.body#/StateReason
      arn: $response.body#/Arn
    onSuccess:
    - name: stillStarting
      type: goto
      stepId: pollState
      criteria:
      - context: $response.body
        condition: $.CurrentState != 'RUNNING'
        type: jsonpath
    - name: running
      type: end
      criteria:
      - context: $response.body
        condition: $.CurrentState == 'RUNNING'
        type: jsonpath
  outputs:
    pipeArn: $steps.createPipe.outputs.pipeArn
    finalState: $steps.pollState.outputs.currentState
    stateReason: $steps.pollState.outputs.stateReason