The Moflow platform provides powerful integration with Alibaba Cloud Function Compute. This lets you seamlessly connect to Function Compute APIs and exchange data using simple configurations. This topic describes how to create and use an Alibaba Cloud Function Compute integration.
Features
The Alibaba Cloud Function Compute integration on the Moflow platform has the following features:
Custom trigger methods: You can set integration operations to trigger manually or run automatically to meet various business needs.
Callbacks and data transformation: You can execute specific integration operation events on query success or failure, and transform the returned data.
Advanced settings: You can use advanced settings, such as debouncing and conditional execution, to optimize integration operations.
For more information about events, see Integration operation events.
Use the Alibaba Cloud Function Compute integration
Step 1: Create an Alibaba Cloud Function Compute integration
Log on to the Moflow platform and go to the console.
Navigate to Resources > Integrations, and click Create Integration.
Select Alibaba Cloud Function Compute, and enter a name and description for the integration.
Configure the Alibaba Cloud Function Compute integration information for different environments, including the
RegionandAccessKey pair.Click OK to create the Alibaba Cloud Function Compute integration.
Step 2: Create an integration operation in an application
Open the Code panel. In the desired scope, click + and select Integration Operation.
For Resource, select the integration that you created. Select an operation type to display its parameters, and then configure the parameters.
Click Run to preview the query result.
Configuration panel
Integration configuration
For more information about Alibaba Cloud Function Compute, see What is Function Compute?.
Region: The region where your Alibaba Cloud Function Compute service is deployed. For more information about Function Compute regions, see Available regions.
AccessKey pair: The AccessKey pair used to make OpenAPI requests. For more information, see Create an AccessKey pair.
General configurations
Function name: The name of the function to invoke.
Function version/alias: The version or alias of the function to invoke. For more information, see Version management and Alias management.
Invocation parameters: The parameters to pass to the function when it is invoked.
Callback configuration
Data transformation: A script that processes the data returned by the API. By default, this is set to
return data, which means the data is not transformed.Success callback: The event to trigger when the API call succeeds.
Failure callback: The event to trigger when the API call fails.
Advanced Configuration
Debounce: A conditional expression that prevents frequent API calls.
Execution prevention condition: A conditional expression that determines whether to execute the integration operation.
Trigger an integration manually
Event trigger
In the component that you want to use to trigger the integration operation, configure an event handler.
Set Action Type to Integration Operation and select the integration operation.
You can enter the configured parameters as an object.
API trigger
If the integration operation is named action1, you can use the action1.trigger() method to trigger the operation from any script. If the operation requires parameters, pass them as an object.