---
title: "How can I create a preflight script?"
canonical: "https://support.apollographql.com/space/ETKB/655687807/How%20can%20I%20create%20a%20preflight%20script%3F"
format: markdown
---
To create a preflight script:

1. Open Apollo Studio and then open the Explorer for the graph and variant you want to create a script for.
2. Open the Explorer's Settings tab and scroll down to the **Preflight script** section:

![preflight-script.jpg](media://88d45bde-7edc-4942-a270-f53a9c77bd50)

3. Click **Add script**. The following dialog appears:

![preflight-script-edit.jpg](media://59f9311e-ebf2-4747-9191-1120e6fe8ae9)

1. Click **Show snippets** to display a list of common helpful actions you can perform from your preflight script (such as sending HTTP requests and interacting with Explorer environment variables).
2. Develop your script in the **Script editor** panel. As you develop, you can click **Test script** to test its execution. Console messages are printed in the **Console output** panel.
3. When your script is ready, click **Save**. Studio stores your script.

You can find more information on preflight scripts [here](https://www.apollographql.com/docs/studio/explorer/connecting-authenticating/#preflight-scripts).

**Note that preflight scripts are not available in Apollo Sandbox**