# Use steps on Hooks

**URL:** <https://community.codefresh.io/t/use-steps-on-hooks/653>\
**Category:** Pipeline Workflows\
**Created:** [October 22, 2021, 4:31pm UTC](https://community.codefresh.io/t/use-steps-on-hooks/653 "2021-10-22T16:31:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Barahona](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jose_barahona/32/410_2.png) [@Jose\_Barahona](https://community.codefresh.io/u/Jose_Barahona)\
**Post date:** [October 22, 2021, 4:31pm UTC](https://community.codefresh.io/t/use-steps-on-hooks/653/1 "2021-10-22T16:31:48Z")

</div>

I need to know if possible to actually run **steps** on hooks part on the pipeline I need to import and use some custom step at failure or completed pipeline, but following the [documentation](https://codefresh.io/docs/docs/codefresh-yaml/hooks/#controlling-errors-inside-pipelinestep-hooks) seems to be only possible to run `freestyle` steps.

```auto
 on_fail:
   steps: 
     SendToSlack:
       type: slack-notifier
       arguments:
         SLACK_HOOK_URL: '${{SLACK_WEBHOOK_URL}}'
         SLACK_TEXT: '${{SLACK_TEXT}}'
         SLACK_ATTACHMENTS: '${{SLACK_ATTACHMENTS}}'

```

---

<div class="post-metadata">

**Author:** ![laurent.rochette](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/laurent.rochette/32/329_2.png) [@laurent.rochette](https://community.codefresh.io/u/laurent.rochette)\
**Post date:** [October 26, 2021, 6:51pm UTC](https://community.codefresh.io/t/use-steps-on-hooks/653/2 "2021-10-26T18:51:13Z")

</div>

it is now possible to use custom steps in hooks (both step and pipeline)

---

<div class="post-metadata">

**Author:** ![Jose\_Barahona](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/jose_barahona/32/410_2.png) [@Jose\_Barahona](https://community.codefresh.io/u/Jose_Barahona)\
**Post date:** [October 26, 2021, 7:15pm UTC](https://community.codefresh.io/t/use-steps-on-hooks/653/3 "2021-10-26T19:15:53Z")

</div>

@laurent.rochette can you provide a working example or documentation for it, don’t sure about the issue asking syntax error asking for `image`

![image](https://us1.discourse-cdn.com/flex019/uploads/codefreshtest/original/1X/103d62c8ba14b023614a83e9d3df67fa2268c08a.png)

---

<div class="post-metadata">

**Author:** ![laurent.rochette](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/laurent.rochette/32/329_2.png) [@laurent.rochette](https://community.codefresh.io/u/laurent.rochette)\
**Post date:** [October 26, 2021, 9:18pm UTC](https://community.codefresh.io/t/use-steps-on-hooks/653/4 "2021-10-26T21:18:48Z")

</div>

the image is required for a freestyle step so it feels like it does not recognize your custom step call.  
Here is my code

```auto
version: "1.0"
hooks:
  on_fail:
    steps:
      slack_notification:
        type: slack-notifier
        arguments:
          MODE: text
          SLACK_HOOK_URL: https://hooks.slack.com/services/............
          SLACK_TEXT: "Pipeline *${{CF_PIPELINE_NAME}}* failed"
     
steps:
  build:
    image: alpine
    commands:
      - exit 1

```

That looks very similar to yours. I’m wondering if that feature is only for enterprise customers. Please send me your account name at [laurent.rochette@Codefresh.io](mailto:laurent.rochette@Codefresh.io) if you’re not comfortable sharing it here
