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

# Create an Action

> Create a smart contract action that executes automatically in response to Hacken Extractor monitoring events, or manually on demand from the dashboard.

A **Smart Contract Action** defines a specific contract function call that Extractor can trigger automatically when a monitoring event fires, or that you can run manually at any time.

## Prerequisites

Before creating an action:

1. An [Action Provider](/smart-contract-actions/action-providers/create-action-provider) must exist on the **same network** as the contract.
2. The provider must have been [granted the required role](/smart-contract-actions/action-providers/connect-action-provider) on your contract.
3. The provider must have [sufficient balance](/smart-contract-actions/action-providers/deposit) to pay gas fees.

## Create an action

<Steps>
  <Step title="Open the Actions tab">
    In the left sidebar, navigate to your monitored contract and click **Actions**. Then click **Create Action**.
  </Step>

  <Step title="Enter a name">
    Give the action a descriptive name (e.g., `Pause Contract`, `Emergency Withdraw`).
  </Step>

  <Step title="Select the contract function">
    In the **Function** dropdown, choose the function you want to execute. Functions are loaded from the contract's ABI and shown in the format `functionName() returnType`.
  </Step>

  <Step title="Choose a trigger and/or detector (optional)">
    Select a **trigger** and/or a **detector** that should automatically fire this action when an event is detected.

    * **Trigger** — fires the action based on on-chain conditions (e.g., a specific function call, ERC-20 transfer, failed transaction).
    * **Detector** — fires the action based on on-chain or off-chain signals (e.g., price drop, AML alert, balance threshold, contract hash change).

    Both can be selected together. If left empty, the action can only be run manually.
  </Step>

  <Step title="Configure gas settings (optional)">
    | Field         | Description                                                                           |
    | ------------- | ------------------------------------------------------------------------------------- |
    | **Gas price** | Override the network's default gas price (in gwei). Leave blank to use market values. |
    | **Gas limit** | Maximum gas units for the transaction. Leave blank to use the estimated value.        |
    | **Gas Tip**   | Priority fee for EIP-1559 networks to speed up transaction inclusion.                 |
    | **Value**     | Amount of native token to send with the call (usually `0`).                           |
  </Step>

  <Step title="Save">
    Click **Create Action**. The action appears in the Actions tab with status `ENABLED`.
  </Step>
</Steps>

<Info>
  The action will execute automatically when the selected trigger fires **and** the linked Action Provider has enough balance to cover gas. If no provider is linked for the contract's network, the action will appear as **Unlinked** and will not run until a matching provider is added.
</Info>

***

## Enable / Disable an action

Open the action's [detail page](/smart-contract-actions/action-details) and use the **Monitoring** dropdown to switch between `ENABLED` and `DISABLED`. Disabling pauses automatic execution without deleting the action.

***

## Run an action manually

You can trigger any action on demand, regardless of monitoring events.

<Steps>
  <Step title="Open the action row menu">
    On the Actions tab, find the action and click **···** → **View Details**, then use the **Run Manually** option. Alternatively, click the run icon directly in the action row.
  </Step>

  <Step title="Configure the manual run">
    | Field             | Description                                                                      |
    | ----------------- | -------------------------------------------------------------------------------- |
    | **Severity**      | Severity label to attach to this manual execution (default: Info).               |
    | **Alert message** | Custom message for the execution log (defaults to the detector/trigger message). |
    | **Gas price**     | Override gas price for this run only (defaults to market value).                 |
    | **Gas limit**     | Override gas limit for this run only.                                            |
  </Step>

  <Step title="Click Run">
    Click **Run** to submit the transaction. The execution will appear in the **Executions** tab and the action's **Action History**.
  </Step>
</Steps>

***

## Delete an action

On the Actions tab, click **···** → **Delete Action** on the action row. This permanently removes the action and cannot be undone.
