# Uploaded step in waiting\_failed state

**URL:** <https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402>\
**Category:** Pipelines\
**Created:** [June 6, 2025, 8:40am UTC](https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402 "2025-06-06T08:40:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bunert](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bunert](https://forum.buildkite.community/u/bunert)\
**Post date:** [June 6, 2025, 8:40am UTC](https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402/1 "2025-06-06T08:40:46Z")

</div>

Hi everyone,

One of my pipeline steps uploads a pipeline with a single step to send a notification in slack in case the step fails (see [Setting up notifications within a pipeline step - #10 by john.soo](https://forum.buildkite.community/t/setting-up-notifications-within-a-pipeline-step/2657/10)).

The strange part is that the notify step sometimes ends up in `waiting_failed` state while it succeeds in other builds… Any idea what could cause this?

---

<div class="post-metadata">

**Author:** ![lukasz-buildkite](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/lukasz-buildkite/32/1590_2.png) [@lukasz-buildkite](https://forum.buildkite.community/u/lukasz-buildkite)\
**Post date:** [June 6, 2025, 9:40am UTC](https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402/2 "2025-06-06T09:40:21Z")

</div>

Hey @bunert 👋

By any chance, do you have any `depends_on` defined that are not met? Would you mind sharing your pipeline YAML (with any fragile information masked)?

---

<div class="post-metadata">

**Author:** ![bunert](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@bunert](https://forum.buildkite.community/u/bunert)\
**Post date:** [June 11, 2025, 7:53am UTC](https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402/3 "2025-06-11T07:53:32Z")

</div>

hey @lukasz-buildkite

We don’t have any explicit `depends_on` defined. The initial pipile contains a step running a script:

```auto
steps:
   - label: "..."
     if: build.branch == "..."
    agents: ...
    env: ...
    command:
        - some initial commands...
        - ./script.sh
        - other commands...

```

Where the script.sh checks on a return code and if the return code is not 0 we run:

```auto
notify_failure() {
    buildkite-agent pipeline upload <<YAML
steps:
  - label: "..."
    command: "exit 1"
    notify:
      - slack:
          channels:
            - "#channel"
          message: "slack message..."
YAML
}

```

What seems strange to me is that sometimes it works and someties it doesn’t… What I noticed is that the build where it worked has the ENV `BUILDKITE_SOURCE="webhook"` while the build where it was stuck has `BUILDKITE_SOURCE="schedule"`.

---

<div class="post-metadata">

**Author:** ![lukasz-buildkite](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/lukasz-buildkite/32/1590_2.png) [@lukasz-buildkite](https://forum.buildkite.community/u/lukasz-buildkite)\
**Post date:** [June 11, 2025, 9:51am UTC](https://forum.buildkite.community/t/uploaded-step-in-waiting-failed-state/4402/4 "2025-06-11T09:51:07Z")

</div>

Hey @bunert 👋

Thanks for providing more details regarding the pipeline. Interesting!  
My hunch would be that the branch conditional is not met in all cases.

We’d recommend reaching out to us via email on [support@buildkite.com](mailto:support@buildkite.com) and provide link to the problematic pipeline, so we can examine it in more details.

Thanks!
