---
canonical: "https://agi-labo.com/en/tools/wings/docs/first-handler"
title: "Your first Handler"
description: "Run a small function, deploy it, and inspect the result."
section: "Get started"
order: 3
pageType: "tutorial"
lastVerifiedVersion: "1.4.16"
lastVerifiedAt: "2026-10-15"
draft: false
surfaces: ["cli", "console"]
plans: ["free", "member"]
---

[Sign in](/en/tools/wings/docs/getting-started), then save this as `handler.js`:

```js
export default async function (event) {
  return { message: `Hello, ${event.name ?? 'Wings'}` }
}
```

## Run without deploying

```sh
wings run --file handler.js --event '{"name":"Wings"}'
```

The result should contain `message: "Hello, Wings"`.
This command runs the code in the cloud too.

## Deploy a Handler

```sh
wings handler deploy --name hello --file handler.js
wings handler list
```

Replace `<handler-id>` below with the ID shown in the list:

```sh
wings run <handler-id> --event '{"name":"Wings"}'
wings handler logs <handler-id>
```

You should get the same `Hello, Wings` result and a successful Run.
You can also inspect the Handler and its Runs in the [Console](https://console.wings.agi-labo.com/).

Set up a [Connection](/en/tools/wings/docs/connections) to call an external API.
Add a [Schedule](/en/tools/wings/docs/schedules) to run the Handler regularly.
