> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Using hooks

> Hooks allow you to extract stateful logic from a component, so it can be tested and reused independently.

Users with task management permissions can create hooks to trigger specific **process instances**, such as sending notifications when **events** occur. Follow the instructions below to set up roles for hooks scope usage:

<Card title="Manage hooks roles" href="../../../../setup-guides/plugins-access-rights/configuring-access-rights-for-task-management" icon="link" />

<Frame>
  ![Hooks](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/platform-deep-dive/hooks.png)
</Frame>

Hooks can be linked to different events and define what will happen when they are triggered. Below you can find a list of all possible triggers for each hook.

<Tabs>
  <Tab title="Process">
    <ul>
      <li>unique result</li>
      <li>only one rule will match, or no rule</li>
    </ul>
  </Tab>

  <Tab title="Swimlane">
    <ul>
      <li>rule outputs are prioritized</li>
      <li>rules may overlap, but only match with the highest output priority counts </li>
    </ul>
  </Tab>

  <Tab title="Stage">
    <ul>
      <li> unique results </li>
      <li>multiple rules can be satisfied </li>
      <li>all satisfied rules must generate the same output, otherwise the rule is violated</li>
    </ul>
  </Tab>
</Tabs>

## Creating a hook

To create a new hook, follow the next steps:

1. Open **FLOWX.AI Designer**.
2. Go to Task Manager and select **Hooks**.
3. Click **New Hook** (you can also import or export a hook).
4. Fill in the required details.

<Frame>
  ![Create a new hook](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/platform-deep-dive/creating_a_hook.png)
</Frame>

## Types of hooks

There are three types of hooks you can create in Task Manager:

* process hooks
* swimlane hooks
* stage hooks

<Info>
  Swimlane and stage hooks can be configured with an SLA (time when a triggered process is activated).
</Info>

![SLA hooks](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/platform-deep-dive/hook_types.png)

<Info>
  Dismiss SLA is available only for hooks configured with SLA.
</Info>

[Here](../../../building-blocks/node/timer-events/timer-expressions) you can find more information about the SLA - duration formatting.


## Related topics

- [Initiating processes](/4.6.0/docs/flowx-designer/managing-a-process-flow/starting-a-process.md)
- [Kafka send action](/4.6.0/docs/building-blocks/actions/kafka-send-action.md)
- [Task management plugin access rights](/4.6.0/setup-guides/plugins-access-rights/configuring-access-rights-for-task-management.md)
- [Resources](/4.6.0/docs/projects/resources.md)
- [Task management setup](/4.6.0/setup-guides/plugins-setup-guide/task-management-plugin-setup.md)
