Run on Event

Pipeline enables you to configure pipelines to run automatically in response to events from connected services like GitHub stars or Slack messages. This automation is configured through the on section in your pipeline recipe.

Configure Run-on-Event

To set up event-based pipeline execution:

  1. Define the event trigger in the on section of your pipeline recipe:

    • Specify a unique event ID to reference this trigger.
    • Set the component type (e.g., github, slack).
    • Define the specific event to listen for (e.g., EVENT_STAR_CREATED, EVENT_NEW_MESSAGE).
    • Configure event-specific config parameters.
    • Include authentication via a connection reference.
      • See here for setting up connections.
  2. Capture event data using the listen field in variable:

    • Define variables with descriptive titles and appropriate formats.
    • Add a listen array under each variable.
    • Reference event data using ${on.<event-id>.message.<data-path>}.
  3. When the specified event occurs, the pipeline automatically executes with variables populated from the event data.

Example Recipe

Here's an example recipe showing how to configure a pipeline to respond to GitHub star events:

version: v1beta

on:
  slack-0:
    type: slack
    event: EVENT_NEW_MESSAGE
    config:
      channel-names:
        - channel-to-be-listened
    setup: ${connection.my-slack-connection}

variable:
  message:
    title: message
    type: string
    listen:
      - ${on.slack-0.message.text}
  user:
    title: user
    type: string
    listen:
      - ${on.slack-0.message.user.name}
  channel:
    title: channel
    type: string
    listen:
      - ${on.slack-0.message.channel.name}

component:
  slack-0:
    type: slack
    input:
      channel-name: channel-for-notification
      message: Message received in #${variable.channel} from @${variable.user}: ${variable.message}
      as-user: false
    condition:
    setup: ${connection.my-slack-connection}
    task: TASK_WRITE_MESSAGE