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

# action-no-implicit-enqueue-retries

> Require explicit retries option on api.enqueue calls to avoid unintended retry behavior.

| Recommended                                  | Strict                                     | Auto-fixable                                | Scope                                                 |
| -------------------------------------------- | ------------------------------------------ | ------------------------------------------- | ----------------------------------------------------- |
| <Badge color="orange" size="sm">warn</Badge> | <Badge color="red" size="sm">error</Badge> | <Badge color="gray" size="sm">false</Badge> | All files (any file containing `api.enqueue()` calls) |

<Tip>
  Related Gadget documentation: [Gadget
  docs](https://docs.gadget.dev/guides/actions/background-actions#retrying-on-failure)
</Tip>

**What the linter reports:**

> Set api.enqueue retries explicitly. Gadget defaults to 6.

## Examples

<Tabs>
  <Tab title="Incorrect">
    ```ts title="api/models/widget/actions/create.ts" theme={null}
    // missing retries option - Gadget silently defaults to 6 retries
    api.enqueue(api.publish, {});
    ```
  </Tab>

  <Tab title="Correct">
    ```ts title="api/models/widget/actions/create.ts" theme={null}
    // always set retries explicitly to avoid unexpected retry behavior
    api.enqueue(api.publish, {}, { retries: 0 });
    ```
  </Tab>
</Tabs>
