# Document Events

A Document Event trigger fires your workflow whenever something specific happens to a record in your system. This is the most common type of trigger — it lets you react automatically when records are created, edited, approved, or cancelled.

For example, you could trigger a workflow every time a new Sales Order is created, or whenever a Purchase Order is submitted for approval.

## Steps

1. **Drag a Document Event trigger onto the canvas** — Find it in the trigger section of the left sidebar.
2. **Click the trigger block** — The settings panel opens on the right.
3. **Choose the record type** — Select which type of record should trigger the workflow (e.g., Lead, Sales Order, Purchase Invoice).
4. **Choose the event** — Pick when the trigger should fire:
   * **After Insert** — When a new record is created for the first time.
   * **On Update** — When an existing record is saved with changes.
   * **On Submit** — When a record is submitted (approved/finalized).
   * **On Cancel** — When a submitted record is cancelled.
   * **On Trash** — When a record is deleted.
   * **On Change** — When specific field values change on a record.
5. **Connect it to the next block** — Draw a line to an action or condition block.

![connection handle](/files/gIBzGzAsJmF8f5UxL64o)

## Common examples

* **New lead notification** — Trigger: Lead + After Insert. Then send an email to your sales team.
* **Invoice approval** — Trigger: Sales Invoice + On Submit. Then notify your accounts department.
* **Order cancellation alert** — Trigger: Sales Order + On Cancel. Then email the customer and your team.
* **Record update tracking** — Trigger: Quotation + On Update. Then log the change or notify someone.

## Related pages

* [What Are Triggers?](/workflow-automation/workflow-builder/triggers.md)
* [Schedules](/workflow-automation/workflow-builder/triggers/schedules.md)
* [Send Email](/workflow-automation/workflow-builder/actions/send-email.md)
* [Notifications](/workflow-automation/workflow-builder/actions/notifications.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.proforgeerp.com/workflow-automation/workflow-builder/triggers/document-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
