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.
- Sync 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: Calls wait for execution results. 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: Call first, then listen for results. If an asynchronous Actionflow is triggered by a webhook, use the
fz_listen_action_flow_resultsubscription to listen for results:subscription listenResult { fz_listen_action_flow_result(taskId: "_____") { output status } } -
Detailed Comparison:
Feature Synchronous Asynchronous 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.
Database
Query, insert, update, and delete on a selected table.
Call API
Run an API already configured under API, bind its response to output parameters, and expose the API result on the Actionflow.
Run AI
Run a configured Agent (set the Actionflow execution mode to asynchronous).
Run Actionflow
Call another Actionflow. A synchronous Actionflow cannot call an asynchronous one.
Set Variable
Assign values to declared Actionflow variables.
Current User
Get the current user ID, WeChat Union ID, Open ID, and Access Token.
Permissions
Grant or revoke roles for specific users.
Run Code
Run a custom code block; see the Code Blocks tutorial.
Files
Save external images, videos, and files and convert them to Momen’s native types.
Condition
Add branch logic. Conditions are evaluated left to right. Together with Actionflow variables, you can output the final result of the branch.
Loop
Iterate over each item in a list and run the inner actions for every element. The loop works as follows:
- Input: This node receives a list as its data source.
- Execution: It starts from the first item, runs all actions inside the loop, then moves to the next item until the list is exhausted.
- Output: In each iteration, you can use item data (item) as input for inner nodes.
To loop a fixed number of times, use the SEQUENCE formula to build an array of the desired length and use it as the loop data source.
Gemini Veo 3.1
Video generation node. Veo 3.1 is Google’s flagship model for high-fidelity 8-second 720p, 1080p, or 4K video with strong realism and native audio (set the Actionflow execution mode to asynchronous).
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| prompt | Text prompt for the video. Supports audio prompts. | Text | Yes |
| negativePrompt | What the video should not contain. Cannot be used together with any referenceImage1, referenceImage2, or referenceImage3 input, or the call will fail. | Text | No |
| firstImage | First frame of the video. Cannot be used together with any reference image field (referenceImage1–3), or the call will fail. | Image | No |
| lastImage | Last frame of the video. Cannot be used together with any reference image field, must be used with firstImage, or the call will fail. | Image | No |
| referenceImage1/2/3 | Up to three reference images for style and content. If the matching referenceType is null, that slot has no effect. | Image | No |
| referenceType1/2/3 | Reference type: only "asset" or "style". "asset": reference provides material (scenes, objects, characters). "style": reference provides style (color, lighting, texture); at most one "style" image. If the matching referenceImage field is empty, that slot has no effect. | Text | No |
| aspectRatio | Only "16:9" (default) or "9:16". | Text | No |
| resolution | Only "720p", "1080p", or "4k"; default 720p. | Text | No |
| durationSeconds | Clip length in seconds; only 4, 6, or 8; default 8. | Integer | No |
| video | Generated video output. | Video | Yes |
Send SMS - Twilio
Used for verification codes, logistics SMS, and similar use cases.
To use it for verification during sign in, sign up, reset password, bind/unbind account, or deregistration, add a custom configuration under Settings → Verification code and wire this node’s parameters in your custom send Actionflow. See User Actions – Send verification code.
1. Prerequisites (in the Twilio console)
- Account: Sign up and open the Twilio Console .
- Credentials: Copy Account SID and Auth Token (reveal the token before copying; keep it secret).
- From number: Purchase or use a trial Twilio number enabled for SMS; that value goes in
from_phone_number. Format must meet Twilio requirements (usually E.164 with country code, e.g.+12025550100).
2. Configure the node (in Momen)
The Inputs on the right map one-to-one to Twilio’s send API. See Twilio’s Message resource for limits and behavior.
-
account_sid
- How to fill: Account SID from Account Info in the Twilio console.
- Example:
ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-
auth_token
- How to fill: Auth Token for that account. Do not leak it or commit it to public repos.
-
from_phone_number
- How to fill: The Twilio number that sends SMS; must be SMS-enabled and allowed as a sender in your project.
- Example:
+12025550100
-
to_phone_number
- How to fill: Recipient mobile number.
- Example:
+12025540100
Both
from_phone_numberandto_phone_numbermust be E.164 (with+and country code), e.g.+8613800138000, or sending may fail. -
message
- How to fill: Plain-text body. Length and segmentation follow carrier and Twilio rules—refer to Twilio docs and errors.
Triggers
Triggers are used to start an Actionflow.
Supported triggers:
- Scheduled: Set periodic execution (supports Cron).
- Database Change: See details.
- Webhook: Trigger via webhooks (requires webhook request body configuration).
How to Use Actionflow
- Create an Actionflow
- Click “Create” to add a new Actionflow.
- Define input parameters and output parameters (for results).
- Choose execution mode (sync/async). AI flows require async.
- Declare flow variables for intermediate results.
- Add nodes for your business logic, including conditional branches.
- 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.
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.