# Events

In Ondeva, workflows don’t just sit idle — they respond to **events**. Events define how and when a workflow starts: clicking a button, submitting a form, loading a page, or on a set schedule. You can also trigger workflows from other workflows or via custom events and exposed APIs.

### **Where to Configure Events**

Button click, file upload completed, API call and form submission events are created automatically when you select the workflow in the respective configuration of the UI component.

Other events you can create in the **Workflow Builder**, leave no step selected in the canvas. You’ll find the **Events** section.

You can assign **one or multiple triggers** per workflow.

***

### **Event Types**

#### **Button Click**

**Trigger:**

The workflow runs when a specific button component is clicked.

**How to Use:**

* Select the workflow in the configuration of the Button UI component.

**When to Use:**

* Submit forms
* Trigger dialogs or conditional flows from user actions
* Add items to cart, save entries, start onboarding steps

***

#### **Form Submission**

**Trigger:**

Runs when a form component is submitted.

**How to Use:**

* Select the workflow in the configuration of the Submit Form Button UI component.
* Pair with [“Read Form Fields”](https://docs.ondeva.com/steps-reference/data#read-form-fields) in the workflow to extract data

**When to Use:**

* Capture user input and persist it
* Trigger follow-ups like emails or redirects

***

#### **Page Load**

**Trigger:**

Fires when a specific page is loaded by the user.

**Options:**

* Set specific pages this should apply to (or leave blank to apply globally)

**When to Use:**

* Prefill data into components
* Set session parameters
* Check licenses

#### **Page Load Completed**

**Trigger:**

Fires on the `DomReady` event of a specific page loaded by the user.

**Options:**

* Set specific pages this should apply to (or leave blank to apply globally)

**When to Use:**

* Execute JavaScript code after a page is loaded.
* Refresh UI components.

***

#### **Time Trigger**

**Trigger:**

Executes the workflow on a scheduled basis.

**Options:**

* **Interval**: every X minutes, hours, or days
* **Fixed Time**: e.g., every day at 07:00
* **Specific Days**: e.g., every Monday and Friday

**When to Use:**

* Clean up stale records
* Send reminder emails
* Sync with third-party APIs on a schedule

***

#### **Custom Events**

**Trigger:**

Responds to an internal event thrown by another workflow (via [“Throw Event”](https://docs.ondeva.com/steps-reference/ux-and-browser-control#throw-event) step) or by the system.

**Options:**

* Set specific pages this should apply to (or leave blank to apply globally)
* Event name to listen for that other actions or the system throws

**When to Use:**

* Decouple logic (e.g., throw `user_created` → handle in multiple places)
* Trigger analytics or secondary flows from one action
* Modularize behavior without chaining logic tightly

***

### Best Practices

* **Execution Conditions**: If you need guardrails, use session parameters and logic steps inside the workflow
* Use **Custom Events** to keep workflows modular and loosely coupled
* Be intentional with **time triggers** — avoid unnecessary load
