> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Form Submission

> Start a workflow when an HTML form is submitted.

The **Form Submission** trigger gives a workflow a public form endpoint. It
accepts `POST` form submissions—including uploaded files—and can optionally
serve an HTML form from the same URL on `GET`.

## Configure the form

<Steps>
  <Step title="Copy the trigger URL">
    Open the trigger configuration and copy its unique endpoint.
  </Step>

  <Step title="Point a form at the URL">
    Set the form's `action` to the trigger URL and its method to `POST`.
  </Step>

  <Step title="Optionally host the form">
    Turn on **HTML Response** and enter HTML content. A `GET` request then
    returns that HTML instead of running the workflow.
  </Step>

  <Step title="Respond after submission">
    Use an HTTP response action to return a confirmation page, file, redirect,
    or status after a `POST`.
  </Step>
</Steps>

```html theme={null}
<form method="post" enctype="multipart/form-data" action="YOUR_TRIGGER_URL">
  <input name="email" type="email" required />
  <input name="attachment" type="file" />
  <button type="submit">Send</button>
</form>
```

## Configuration

| Setting           | Type    | Default | Description                                      |
| ----------------- | ------- | ------- | ------------------------------------------------ |
| **HTML Response** | Boolean | Off     | Serve the configured HTML for `GET` requests.    |
| **HTML Content**  | String  | Empty   | The page returned when HTML Response is enabled. |

## Trigger outputs

| Output     | Type              | Description                                                        |
| ---------- | ----------------- | ------------------------------------------------------------------ |
| **Path**   | String            | The endpoint path.                                                 |
| **Method** | `GET` or `POST`   | The request method.                                                |
| **Fields** | Object            | Submitted fields and uploaded files. Repeated values become lists. |
| **Query**  | Object of strings | Query parameters supplied with a `POST`.                           |

<Note>
  When **HTML Response** is off, a `GET` request runs the workflow and exposes
  its query parameters through **Fields**.
</Note>
