# Code

Code blocks allow for users to execute JavaScript code in a Callable

<figure><img src="/files/xQQydWSUdlkGVHcK4htw" alt=""><figcaption></figcaption></figure>

The env variable passed into the function allows for referencing previous block outputs inside the Code Block. It uses the syntax `env.state.BLOCK_NAME` to reference a block by its name. In the example above, the block name for the code block would be `CODE_1`. User's can name blocks anything as long as it is unique inside the Callable.


---

# Agent Instructions: 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:

```
GET https://docs.trycortex.ai/callable/blocks/control/code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
