Execute Code

The Execute Code Card lets you run custom 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 (see variables in code)
  • Call external APIs
  • Add guardrails such as custom error handling, rate limits, permission checks, and fallbacks

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:

Generate code using AI

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.