# Key elements of a Flow

A Flow is composed of two essential elements: **Triggers** and **Actions**. These elements work together to automate processes, ensuring that workflows are initiated and executed based on defined conditions.

## **1. Trigger** <a href="#id-1.-trigger" id="id-1.-trigger"></a>

A trigger is the starting point of a Flow, determining when and how frequently the Flow is executed. It sets the conditions or events that activate the Flow, ensuring it runs at the right time or in response to specific actions.

### **Types of Triggers:**

* **Schedule Trigger:** Executes the Flow at a specified time or on a recurring schedule, such as daily, weekly, or hourly.
* **Webhook Trigger:** Activates the Flow in response to an external signal, like receiving an HTTP request or a data submission from an external application.
* **Event Trigger:** Starts the Flow based on specific events, such as user actions, data updates, or events from external services.

#### **Trigger Configuration:**

Triggers can be customized to meet specific requirements, such as:

* Setting time intervals for schedule-based triggers.
* Defining API endpoints for webhook triggers.
* Specifying event parameters for event-based triggers.

## **2. Action** <a href="#id-2.-action" id="id-2.-action"></a>

An action represents a specific task or operation that is executed once the Flow is triggered. Actions define what happens after the trigger event occurs, and they are the building blocks of the workflow. They are responsible for executing the desired operations and achieving the objectives of the Flow.

### **Types of Actions:**

* **Data Processing:** Manipulates or processes data, such as transforming, filtering, or enriching datasets.
* **Communication:** Facilitates interaction by sending emails, notifications, or messages to users or systems.
* **Integration:** Connects with external applications or services to retrieve, update, or send data.
* **Decision-making:** Performs logic-based operations, such as conditional branching or applying rules to determine subsequent steps.
* **Custom Operations:** Executes custom tasks, such as running scripts, executing code, or performing specific tasks tailored to unique workflow requirements.

#### **Key Characteristics of Actions:**

* **Sequential Execution:** Actions are executed in a defined order based on the workflow logic, ensuring that each step is carried out in the correct sequence.
* **Flexibility:** Multiple actions can be combined to handle complex workflows, enabling more advanced automation.
* **Outcome-driven:** Each action contributes to a specific objective, such as updating a database, generating a report, or integrating with an API.

By combining well-configured triggers and strategically designed actions, Flows empower users to create complex business logic for developing GenAI-powered apps that automate processes, optimize workflows, and deliver consistent, impactful outcomes.

<figure><img src="/files/gKPfnkv5vJqJg7qDRWRl" alt=""><figcaption></figcaption></figure>


---

# 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.zbrain.ai/zbrain-documentation/zbrain-builder/flows/key-elements-of-a-flow.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.
