# Create pipeline/steps that runs on specific cron jobs OR promote event with specific target

**URL:** https://drone.discourse.group/t/create-pipeline-steps-that-runs-on-specific-cron-jobs-or-promote-event-with-specific-target/13288
**Category:** Drone Support
**Created:** [January 27, 2023, 1:24am UTC](https://drone.discourse.group/t/create-pipeline-steps-that-runs-on-specific-cron-jobs-or-promote-event-with-specific-target/13288 "2023-01-27T01:24:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DanHamHOD](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@DanHamHOD](https://drone.discourse.group/u/DanHamHOD)
#### Post date: [January 27, 2023, 1:24am UTC](https://drone.discourse.group/t/create-pipeline-steps-that-runs-on-specific-cron-jobs-or-promote-event-with-specific-target/13288/1 "2023-01-27T01:24:52Z")

</div>

Hi,

I would like to have steps in a pipeline execute when either a specific cron job runs OR when I run a promotion with a specific target

I would like to do something like the following

```auto
---
kind: pipeline
type: kubernetes
name: Run on cron or specific promote events

trigger:
  event:
  - cron
  - promote
  target:
    include:
    - foo1
    - foo2

platform:
  os: linux
  arch: amd64

steps:
- name: run_when_cron_job_has_name_cron_foo1_OR_when_promotion_target_is_foo1
  image: alpine:latest
  commands:
  - echo "Triggered by cron job named cron_foo1 OR promotion event with promotion target foo1"
  when:
    cron:
    - cron_foo1
    target:
    - foo1

- name: run_when_cron_job_has_name_cron_foo2_OR_when_promotion_target_is_foo2
  image: alpine:latest
  commands:
  - echo "Triggered by cron job named cron_foo2 OR promotion event with promotion target foo2"
  when:
    cron:
    - cron_foo2
    target:
    - foo2

```

Unfortunately, I cannot seem to get this to work. Any help here would be much appreciated.
