---
title: Actions Examples
description: Practical examples and common workflow patterns for the Actions system
date: 2026-02-27
tags:
  - actions
  - examples
  - workflows
---

This page walks through common workflow patterns using the visual flow editor. Each example describes what the workflow does, what triggers it, and how to connect the blocks.

→ For step-by-step instructions on using the editor, see the [Actions User Guide](/actions/user-guide).

→ For building custom blocks, see the [Actions Developer Guide](/developer/actions-developer-guide).

---

## Email notification when a record is created

**What it does:** Sends an email to an admin when a new document (or any other record) is created.

**Setup:**
1. Add a **Document Created** trigger
2. Add a **Send Email** block — configure: recipient, subject, body template
3. Connect the trigger's output socket to the email block's input socket

**Variations:**
- Use Text Replacer syntax (e.g. `#{show data.title}`) in the email subject and body fields to include the created document's values
- Filter the **Document Created** trigger by `collectionName` to only notify for documents of a specific type

---

## Multi-step data processing

**What it does:** Validates and transforms incoming data before saving it to a collection.

**Setup:**
1. Add a **Document Created** or **Webhook** trigger
2. Add a **Data Mapper** block — map fields from the trigger data to the target schema
3. Add a **Save Entity** block — configure the target collection
4. Connect: trigger → data mapper → save entity

**Error handling:**
- The **Save Entity** block has an `error` output socket — connect it to a **Send Email** block to capture failures

→ See [Data Mapper Block](/developer/actions-blocks/data-mapper) for field mapping configuration.

---

## Chat platform notifications

**What it does:** Posts a message to Slack, Discord, or Microsoft Teams when a record changes.

**Setup:**
1. Add a **Document Created** or **Document Updated** trigger (filter by collection as needed)
2. Add a **Send Chat Message** block — configure: platform (`slack` / `discord` / `teams`), webhook URL, and message (supports Text Replacer syntax such as `#{show data.title}`)
3. Connect: trigger → send chat message

**Tips:**
- Store the webhook URL in Application configuration rather than hardcoding it in the block
- The block supports optional `username` and `iconUrl` overrides (both support Text Replacer syntax)

---

## AI-generated summaries

**What it does:** Uses an AI model to generate a summary of a document and writes it back to a chosen field.

**Setup:**
1. Add a **Document Created** or **Document Updated** trigger
2. Add an **AI Summary** block — configure: `targetProperty` (e.g. `aiSummary`) and a prompt template that references `#{show data}` / `#{show typeSchema}` / `#{show typeLabel}`
3. Connect: trigger → AI summary

The block reads the trigger's entity data, generates the summary, and updates the target property on the same document.

---

## Scheduled workflows (cron triggers)

**What it does:** Runs a workflow on a recurring schedule — for example, a nightly data cleanup or a weekly report email.

**Common cron expressions:**

| Schedule | Expression |
|---|---|
| Every day at midnight | `0 0 * * *` |
| Every Monday at 8 AM | `0 8 * * 1` |
| Every hour | `0 * * * *` |
| Every 15 minutes | `*/15 * * * *` |
| First day of each month | `0 9 1 * *` |

**Setup:**
1. Add a **Cron** trigger — enter the cron expression
2. Add the blocks for the recurring task
3. Connect them

**Example — daily reminder email:**
1. **Cron** trigger: `0 9 * * *` (daily at 9 AM)
2. **Send Email** block — send a reminder to the team with a fixed subject and body

> Cron-triggered workflows fire on the schedule without any entity context, so downstream blocks work with configured values rather than queried data.

---

## Document approval notification

**What it does:** When a document moves into `pending_review`, notify the approver by email.

**Setup:**
1. **Document Updated** trigger — filter by the review collection
2. **Send Email** block — configure subject and body with `#{show data.title}` so the approver sees which document needs review

---

## Tips for building workflows

**Start simple.** Build and test the happy path first — a single trigger connected to a single output block. Add error handling and branching once the core flow works.

**Use meaningful block labels.** In the flow editor, rename blocks to describe what they do (e.g., "Notify admin" instead of "Send Email"). This makes complex workflows readable.

**Connect error sockets.** Blocks that can fail (for example **Save Entity**, **Send Email**, **Send Chat Message**, **AI Summary**) expose an `error` output socket. Always connect it to a notification block (such as another **Send Email** or **Send Chat Message**) so failures are visible.

**Test with real data.** Trigger your workflow manually with a known test record to verify the data mapping and conditions are working as expected before enabling it in production.
