> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/custom-trigger/sample-flows.md

## Article Content:

# Sample Flows

This article shares some possible use cases your implementation could support, as well as an example flow that could support each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your implementation.

## Send an email on a button click

Send an email to site collaborators when a visitor to your site clicks a button.

1. In the [Automations](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers) page of your site dashboard, create an automation in the automation builder. Choose **Velo code trigger** as the automation trigger and copy its trigger ID. Choose **Send an email** as an action.
1. In the editor, create a button on your site page and add an [`onClick()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/button/on-click.md) handler for it in the page code.
1. Add a [web method](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/web-modules/about-web-modules.md#web-methods) in your backend code that wraps [`runTrigger()`](https://dev.wix.com/docs/sdk/backend-modules/automations/triggers/custom-trigger/run-trigger.md).
1. Export the web method to your page code. Inside the `onClick()` handler, call the web method.

## Update a Google sheet when a user inputs a value

Update a Google sheet when a text input field loses focus after a site visitor enters data.

1. In the [Automations](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers) page of your site dashboard, create an automation in the automation builder.
1. Choose **Velo code trigger** as the automation trigger and copy its trigger ID. [Configure the trigger payload](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/automations/add-a-custom-trigger.md#define-the-payload-structure-optional) with at least 1 field.
1. Choose **Update Google Sheets** as an action. Connect your Google account if necessary, then select a sheet and match the sheet columns to the payload fields.
1. In the editor, create an input field and add an [`onBlur()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/text-input/on-blur.md) handler for it in the page code.
1. Add a [web method](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/web-modules/about-web-modules.md#web-methods) in your backend code that wraps [`runTrigger()`](https://dev.wix.com/docs/sdk/backend-modules/automations/triggers/custom-trigger/run-trigger.md).
1. Export the web method to your page code. Inside the `onBlur()` handler, call the web method. Pass in a payload that matches the schema structure you defined. Include the input field value in this payload.