# Actions

Actions are the key ingredient for adding logic to your applications, and for managing interactions with your datasources. Almost like native JavaScript functions, they are small units of code that perform a specific task. They are particularly useful for:

* Reading and mutating UI component state or app state variables
* Executing interactions with datasources, like fetching data from a database or API, or writing a file to an AWS S3 bucket
* Triggering other actions
* Sending notifications

They could be triggered by UI events which they are associated with, run immediately when the app is loaded, or run periodically at a configured interval. This section covers all you need to know about actions:

1. [Managing actions](/writing-code/actions/managing-actions.md): How to create, organize and configure actions
2. [Execution model](/writing-code/actions/execution-model.md): The internals around how actions are executed and the data they expose after successful or unsuccessful execution
3. [Preview](/writing-code/actions/preview.md): How to test actions without influencing application state
4. [Triggers](/writing-code/actions/triggers.md): Full overview of all events that may trigger actions to be executed


---

# 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.uify.io/writing-code/actions.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.
