Momen Docs
Go to Momen
  • Get Started
    • Introduction
    • Quick Start
    • Software Development Process
    • Editor Overview
  • Changelog
    • Latest Product Update
  • Build UI
    • Pages
    • Components
    • Canvas
    • Layout
    • Component - Display
    • Component - Input
    • Component - View
    • Component - List
    • Component - Tab View
    • Component - Select View
    • Component - Conditional View
    • Component - Others
    • Component - Map
    • Custom Component
  • Data
    • Overview
    • Data Model and Database
    • API
    • Variable
    • Parameter
    • Formula and Conditions
  • Actions
    • Overview
    • Request
    • Navigation
    • Actionflow
      • Custom Code
      • Database Trigger
    • AI
      • AI Data Model
      • AI Point
      • Vector Data Storage and Sorting
    • User Actions
    • Component Management
    • App and Page Management
    • Toast Notifications & Modal
    • Payment
    • SSO
    • Share
    • Location
    • File Management
    • QR Code
    • Clipboard
    • Conditional
    • Loop
  • Release and Growth
    • Publish Application
    • Upgrade Project
    • Multiple Clients
    • Permission
    • Log Service
    • SEO
    • Hosting Files
  • My Account and Community
    • My Wallet
    • Promoting Momen
    • Code Component
    • Collaboration
  • Debugging
    • How to Debug in Momen
    • Request Error Reference
  • Tutorial
    • How to Build an AI Needs Analysis Project?
    • How to Set Up Payment with Stripe Plugin?
    • How to Embed an Iframe Component into Your Momen Project?
    • How to Build Your Login Page?
    • How to Convert Momen App to Native Mobile App?
    • How to Build a CMS (MVP Version) in Hours?
    • How to Set a Countdown Timer When Sending a Verification Code
  • Template
    • AI Mental Health Assistant
    • Angry Dietitian
    • AI Help Center
    • AI Knowledge Base
    • SaaS Corporate Site
    • Blog
    • AI Feedback Tool
    • Feedback Tool, a Nod to Canny
    • Portfolio
    • Online Courses, a Nod to Udemy
    • Mobile Auto Repair AI Scheduler
Powered by GitBook
On this page
  • Introduction
  • Action Configuration Guide
  • View Trigger History
  • Quota and Purchase Limits
  • Notes
  1. Actions
  2. Actionflow

Database Trigger

This feature triggers Actionflows when data changes (insert, update, or delete), enhancing automation within the project.

PreviousCustom CodeNextAI

Last updated 1 day ago

Introduction

This feature triggers Actionflows when data changes (insert, update, or delete), enhancing automation within the project.

Common use cases include:

  • Automatically upgrading to VIP when a user's payment exceeds a specified amount

  • Automatically sending a notification when an order is completed

  • Automatically generating an operation record when user points change, for easier tracking

Action Configuration Guide

Here’s how to set it up using an example: When a user’s payment exceeds $1000, the system will automatically upgrade them to VIP.

  1. Add Actionflow

    • Set the input parameter account_id.

    • Add a "Get Payment mount" node to calculate the total payment for the user.

    • Add an "Update account" node to update the user to "VIP."

  1. Add Trigger

On the actionflow right-sider, under trigger section, add a trigger of database change. It can only be added after the Actionflow is saved.

  1. Select Operation Type and Data Table There are 4 types of supported operations:

  • On Data Insert

  • On Data Update

  • On Data Delete

  • On Data Insert or Update

  1. Set Conditions and Actionflow Parameters

Triggers allow access to both the previous and updated data values. Under Configure Conditions for Updated Data section, you can choose either data after update or data before update to design your trigger logic.

View Trigger History

View the history of triggers in the log system.

Quota and Purchase Limits

Automated actionflows (triggered by scheduled tasks or database changes) have usage limits:

  • Free Tier (resets monthly):

    • Free plan: 1000 executions/month

    • Basic plan: 10000 executions/month

    • Pro plan: 50000 executions/month

  • Paid Option (valid indefinitely):

    • Cost: 10000 executions for $ 10&;

Notes

  1. Cyclic Trigger Prevention

The system ensures that each trigger in a chain is only triggered once. For example, in the sequence: Trigger A → Actionflow A → Trigger B → Actionflow B → Trigger A, the second Trigger A will not be triggered because it has already been executed.

  1. Avoid Concurrent Modifications to the Same Data

Simultaneous updates from multiple Actionflows to the same data may cause deadlock.

  1. Data Imports May Trigger Multiple Events

If an "On data insert" trigger is set on a table and data is imported, each imported record will trigger the flow separately.

add actionflow
add trigger
Select Operation Type and Data Table
Set Conditions and Actionflow Parameters