Actionflow
Introduction
Actionflow is Momen’s tool for building custom workflows and automations. It helps achieve complex business logic and boosts reusability. Also, because they operate entirely on the server, security is guaranteed.
- Free projects: 1 Actionflow
- Basic and above: Unlimited Actionflows
Use Cases
Actionflows are ideal for automating complex data processing and business logic, such as:
- E-commerce Loyalty Program: Automatically upgrade users to “Gold Member” when their total purchases exceed $10,000.
- Order Reminders: Send notifications every 24 hours for unpaid orders.
- Payment Processing: After a successful payment, update inventory and notify the user.
Actionflow Structure
Attributes
- ID: A unique identifier. You can paste it directly into the log service search bar to view its runtime information and errors. See: Log Service for details.
- Version: Each save creates a new version.
- Preview: Takes effect on both the backend and frontend.
- Update Backend: Takes effect only on the backend.
⚠️If only the backend is updated, while the frontend still calls the old version of the Actionflow, it will lead to unexpected behavior.
- Execution Method: Supports both synchronous and asynchronous execution methods (refers to the Actionflow itself, not individual nodes).
-
Synchronous: Actionflows execute sequentially, with each Actionflow waiting for the previous one to complete before starting. Synchronous Actionflows have ACID properties:
- Atomicity: The entire Actionflow is treated as an indivisible unit. Database modifications either all succeed or all fail, ensuring data reliability.
- Consistency: Ensures database data is always in a valid state, preventing dirty data.
- Isolation: Actionflows do not interfere with each other, avoiding data conflicts and ensuring predictable results.
- Durability: Once an Actionflow completes, database modifications are permanently effective, ensuring data security.
-
Asynchronous: Actionflows do not block other Actionflows and can run in parallel. If an asynchronous Actionflow is triggered by a callback, use the
fz_listen_action_flow_result
subscription to listen for results:subscription listenResult { fz_listen_action_flow_result(taskId: "_____") { output status } }
-
Detailed Comparison:
Feature Synchronous Asynchronous Execution Order Sequential Can execute in parallel Blocking Other Actionflows Yes No Timeout Duration Entire flow: 15s (unlimited for paid projects). Each node: 15s (unlimited for paid projects). Error Handling All database data modifications will be rolled back. Database changes on the error node will be rolled back.
-
Variables
Defined variables are accessible to all nodes and can be assigned using the “Assign Actionflow Variable” node.
Nodes
Nodes include database operations, AI execution, permission changes, API calls, code blocks, loops, and conditionals.
Triggers
Trigger types: database change, scheduled, and callback.
How to Use
- Create & Configure Nodes: Add and arrange nodes for your business logic, including conditional branches.
- Configure Triggers: Configure triggers to start the Actionflow.
- Set Permissions: Define which user roles can execute the Actionflow.
- Use the Actionflow: Configure a “Request – Actionflow” action on a component, or use the triggers you have set up to execute the Actionflow.
How to Configure
1. Create an Actionflow
- Click “Create” to add a new Actionflow.
- Add and arrange nodes, including conditional branches.
- Define input parameters and output parameters (for results).
- Choose execution mode (sync/async). AI flows require async.
- Declare flow variables for intermediate results.
2. Action Nodes
Add nodes by clicking ”+”. Supported types:
- Database Operations: Query, insert, update, delete.
- API Calls: Execute pre-configured APIs and bind responses.
- AI Execution: Run an AI agent configured in Momen.
- Set Actionflow Variable: Assign values to Actionflow variables.
- Permission Management: Grant or revoke user roles.
- Conditional Branch: Add decision logic. Branches are evaluated left to right, and once a condition is met, no further conditions are checked.
- Custom Code: Execute code blocks.
3. Triggers
Supported triggers:
- Scheduled: Set periodic execution (supports Cron).
- Database Change: See details.
- Webhook: Trigger via webhooks (requires callback body configuration).
Log Management
View execution logs in Editor > Logs. Search by Actionflow ID for troubleshooting.
Notes
- Automation requires purchasing execution credits.
- Ensure all nodes are configured, saved, and published before setting up triggers.
- Formula support in Actionflows is currently limited.