# Functions in the Console

> Create functions, save deployments, activate versions and recover drafts.

Functions requires access for the selected project. Select the correct team and
project before opening **Functions**. Read-only access lets you inspect functions;
creating deployments and running tests require write access and execution availability.

## Find a function

Use the list's search, status filters and sort controls on desktop or on a phone.
Search, filters and sorting apply to the functions loaded in the list. Choose
**Load more** when it appears to include another page.

## Create and save

1. Open **Functions** and choose **New function**.
2. Enter a function name and choose a template. Edit the code or HTTP request.
3. In **Settings**, enter the region and review the compatibility date and allowed
   HTTPS origins. On a phone, expand **Settings** to show these fields.
4. Choose **Save** to create the function and save its deployment without
   activating it. The function opens with the saved deployment.

**Deploy and activate** saves and activates the deployment. It is a separate
action from saving. On the create form, Enter submits a save; inside the source
editor, Enter inserts a new line. Cmd/Ctrl+S saves without activation.

## Edit and activate

Open a function from the searchable list. Its detail page has **Code**,
**Deployments**, **Invocations**, **Secrets** and **Settings** tabs.

Choosing a tab updates the address. Copy that address to share a link to the
same tab, such as `?tab=deployments`. **Back** and **Forward** move between
selected tabs, and refreshing keeps the tab in the address. A missing or
unrecognized tab opens **Code**.

A shared link selects a tab; it does not include unsaved editor changes or
grant access to the function. Save your changes before refreshing: the tab
returns, but unsaved drafts are lost as described below.

Use **Save deployment** to save editor changes without changing the active
version. On the **Code** tab, Cmd/Ctrl+S also saves without activation. The
shortcut does not save the editor while the mobile Test panel covers it.

Choose **Deploy and activate** to save and activate your changes, or use
**Make active** in **Deployments** to activate an existing deployment. If a
revision conflict appears, refresh the function before trying again. A failed
refresh keeps writes unavailable until a fresh function read succeeds.

## Test a saved deployment

Open **Test**, choose a saved deployment and enter the test input as JSON. A test
runs that saved deployment, including its saved secret bindings, rather than
unsaved editor changes.

If the result is uncertain, choose **Check the same attempt**. Do not start a
replacement test while the original attempt is unresolved. Invocation receipts
show the recorded outcome; a response body may no longer be available.

## Keep or discard drafts

Unsaved editor changes return after navigating to the list, another Console
page or another project in the same team. Returning to the list restores its
search, filters, sort order and the function row's focus.

Drafts stay only in memory while the Console page remains open. Reloading or
closing the page loses them after the browser's leave-page warning. The same
warning protects unsettled test attempts. Signing out or switching teams clears
held work. Save the deployment before leaving if you need to keep the source.

**Discard changes** asks before replacing unsaved edits. Secret values are
write-only and are never restored with a draft.
