> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-ak-docs-20-document-updating-variables-from-outsid.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Code

The Execute Code Card lets you **run custom [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) code within a Node**.

You can use the Execute Code Card to extend the functionality of your bot beyond Studio's built-in Cards. For example, you can:

* Perform complex calculations
* Manipulate data and variables
* Call external APIs

<Note>
  Execute Code Cards allow you to generate one-time code snippets at specific points in your Workflow. For reusable code snippets, use [Actions](/studio/concepts/actions).
</Note>

<Warning>
  You can't import external libraries within an Execute Code Card. To make API requests, you can use [Axios](https://axios-http.com/docs/intro).
</Warning>

## Generate code using AI

The Execute Code card allows you to generate code using AI, so you don't have to write it all from scratch:

<Frame>
  <img alt="Generate code using AI" className="block dark:hidden" src="https://mintcdn.com/botpress-ak-docs-20-document-updating-variables-from-outsid/HkXcHAh4PvnXNVWT/studio/concepts/cards/assets/execute-code.png?fit=max&auto=format&n=HkXcHAh4PvnXNVWT&q=85&s=b73f8c55d9ae9063c5707986c73dc92e" width="1442" height="262" data-path="studio/concepts/cards/assets/execute-code.png" />

  <img alt="Generate code using AI" className="hidden dark:block" src="https://mintcdn.com/botpress-ak-docs-20-document-updating-variables-from-outsid/HkXcHAh4PvnXNVWT/studio/concepts/cards/assets/execute-code-dark.png?fit=max&auto=format&n=HkXcHAh4PvnXNVWT&q=85&s=1ca41d2e3729616d311697f530a78cc4" width="1442" height="262" data-path="studio/concepts/cards/assets/execute-code-dark.png" />
</Frame>

At the top of the code editor, write a prompt and hit enter to generate code using AI. You can then edit this code manually or ask AI to make revisions to it.
