Skip to main content
Code Execution blocks allows you to run any Python code in your Flows. The code is executed in a secure sandbox environment that lasts for 5 minutes. In a code execution block, you can:
  • Install packages
  • Make network requests
  • Access variables from previous blocks
  • Export variables to be used in subsequent blocks
Code Execution Overview

Limitations

  • The execution time is limited to 5 minutes.
  • The environment resets after each execution, so any installed packages or variables are not retained.
  • Startup latency is ~200ms.

Example Code Snippet

Here is a simple example of using the Code Execution block:
Console outputs and errors will be visible in the Flows Notebook UI.

Executing Commands

You can execute commands like installing packages using the ! operator before the command.
Keep commands in a separate block from code.

Packages

Several common packages are installed by default.
  • requests
  • pandas
  • json
You can simply import them in your code blocks like this:

Pre-installed Packages