> For the complete documentation index, see [llms.txt](https://docs.2pm.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2pm.network/model-inference/getting-inference-results-on-chain.md).

# Getting Inference Results on Chain

Typically, node operators are required to be deployed for oracle adapters. After the adapters are launched locally or on the node, users need to find the corresponding contract address for their subnet.&#x20;

The following is the workflow of Chainlink Function:

<figure><img src="/files/4f15rOKabm8fvcvcre1T" alt=""><figcaption><p>Chainlink Function Workflow</p></figcaption></figure>

1. User initiates the Chainlink Function embedded in the dApp: This is the starting point of the process, where the user triggers the Chainlink Function by interacting with the decentralized application (dApp).
2. The dApp sends a request to the Chainlink Functions smart contract: This request contains three key elements:
   * API endpoint: Specifies the external source from which to fetch data
   * Data transformation logic: Defines how to process the retrieved data
   * Encrypted credentials (if required): Used for secure access to APIs that require authentication
3. The Decentralized Oracle Network (DON) processes the request:
   * The DON continuously monitors the Chainlink Functions smart contract
   * When a request is detected, each node independently performs the following operations:  ***a.*** Triggers its runtime environment. ***b.*** Retrieves external data ***c.*** Executes specified data computations d. Returns the result
4. Reaching consensus and returning results using OCR 2.0:
   * Nodes reach consensus on the final answer using the Off-Chain Reporting (OCR) 2.0 protocol
   * One node is selected to transmit the result back on-chain
   * If the selected node fails to publish the data, another node is chosen for transmission
   * This mechanism ensures high reliability and trust-minimized security


---

# 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://docs.2pm.network/model-inference/getting-inference-results-on-chain.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.
