# What are supported values for step attribute - "outcome"?

**URL:** <https://forum.buildkite.community/t/what-are-supported-values-for-step-attribute-outcome/1472>\
**Category:** General\
**Created:** [March 3, 2021, 1:49pm UTC](https://forum.buildkite.community/t/what-are-supported-values-for-step-attribute-outcome/1472 "2021-03-03T13:49:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayarjo](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jayarjo/32/934_2.png) [@jayarjo](https://forum.buildkite.community/u/jayarjo)\
**Post date:** [March 3, 2021, 1:49pm UTC](https://forum.buildkite.community/t/what-are-supported-values-for-step-attribute-outcome/1472/1 "2021-03-03T13:49:55Z")

</div>

I’m trying to grab the outcome for the previous step in the pipeline via: buildkite-agent step get “outcome”. Is “passed” the only possible value for attribute “outcome”? I couldn’t find list of supported values anywhere - “outcome” as an attribute is also not mentioned anywhere.

---

<div class="post-metadata">

**Author:** ![Jason](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jason/32/742_2.png) [@Jason](https://forum.buildkite.community/u/Jason)\
**Post date:** [March 3, 2021, 8:45pm UTC](https://forum.buildkite.community/t/what-are-supported-values-for-step-attribute-outcome/1472/2 "2021-03-03T20:45:52Z")

</div>

Hey @jayarjo, great question and welcome! 🎉

You are correct, it looks like we need to update that documentation to include the ‘outcome’ value and it could really use an example also. I have raised this with our docs team so we can fix that!

We do have some documentation here [buildkite-agent step v3 | Buildkite Documentation](https://buildkite.com/docs/agent/v3/cli-step#getting-a-step) and you can also take a peek at the code [agent/step\_get.go at 3c23d4fba201d418974073ecaf7c7010fffd67e8 · buildkite/agent · GitHub](https://github.com/buildkite/agent/blob/3c23d4fba201d418974073ecaf7c7010fffd67e8/clicommand/step_get.go).

I put together an example for you.

Here we are looking for the failure (hard\_failed as opposed to soft\_failed) and you could also check on ‘passed’ as you mentioned. As you will have noticed, you will need to use a step key to identify it:

```
steps:
  - label: 'Step 1'
    command: "false"
    key: 'one'
  
  - wait:
    continue_on_failure: true
    
  - label: 'Step 2'
    command: |
      if [$$(buildkite-agent step get "outcome" --step "one") == "hard_failed"]; then
        buildkite-agent annotate 'this build failed' --style 'error'
      fi
```
