> For the complete documentation index, see [llms.txt](https://devix.gitbook.io/devix/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devix.gitbook.io/devix/devix-core/triggerservercallback.md).

# TriggerServerCallback

**Side:** Server\
**Source:** [devix-core (GitBook)](https://devix.gitbook.io/devix/devix-core)

## What it does

Triggers a registered server callback. Usually for **internal use**: when the client calls TriggerServerCallback, the server runs the matching handler and sends the result back.

## How to use

```lua
-- Triggering the same callback from another script on server (rare)
local DEVIX = exports['devix-core']:getObjects()
DEVIX.TriggerServerCallback('myjob:getData', requestId, source, function(result)
    -- result
end, extraArg)
```

## Parameters

| Parameter | Type     | Description                                  |
| --------- | -------- | -------------------------------------------- |
| name      | string   | Name registered with RegisterServerCallback. |
| requestId | any      | Request id (matches client).                 |
| source    | number   | Player server id.                            |
| cb        | function | Called with the result.                      |
| ...       | any      | Extra arguments passed to the callback.      |

## Returns

* None; result is passed to cb.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://devix.gitbook.io/devix/devix-core/triggerservercallback.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
