All Products
Search
Document Center

IoT Platform:Forward data to Function Compute (FC)

Last Updated:Jun 10, 2026

Use the rules engine to forward device data to Function Compute (FC) for custom business logic processing.

Prerequisites

  • Create a service and a function in Function Compute. Verify that the function is configured and runs as expected. Function Compute documentation.

    Important
    • When you create the function, set the Request Handler Type parameter to Handle Event Request.

    • For an Enterprise Edition instance, the Function Compute service and function must be in the same region as the instance.

  • Create a data forwarding rule and write an SQL query to process the data. Configure a data forwarding rule.

Background

The rules engine forwards device data to Function Compute, where custom function scripts run your business logic.

image

Limitations

  • Both the new and legacy versions of Data Forwarding to Cloud Services support forwarding data to Function Compute. The new version includes a script parser to process complex message data before sending it to other cloud services. Forward data to Function Compute (new version).

  • Region restrictions:

    • Your IoT Platform instance must be in a region that supports data forwarding to FC. Feature availability by region.

    • The Function Compute service must be in the same region as your IoT Platform instance.

Procedure

  1. Log on to the IoT Platform console.

  2. On the Overview page, find the instance that you want to manage and click the instance ID or instance name.

  3. In the left-side navigation pane, choose Message Forwarding > Data Forwarding.

  4. Click View next to the target rule. The Data Forwarding Rule page appears.

    Important

    If the Data Forwarding (New Version) page is displayed, click Back to Previous Version in the upper-right corner, then click View next to the target rule.

  5. In the Forward Data section, click Add Operation.

  6. In the Add Operation dialog box, select Send data to Function Compute (FC), configure the following parameters, and click OK.

    Parameter

    Description

    Operation

    Select Send data to Function Compute (FC).

    Region

    Select the region of your Function Compute service.

    Service

    Select a Function Compute service.

    To create a service in the Function Compute console, click Create Service. Manage services.

    Function Version

    Select a function version:

    • Use Default Version: Invokes the LATEST version of the function.

    • Select Version: Use a specific published version of the service.

      To create a version in the Function Compute console, click Create Version. Manage versions.

    • Select Alias: Use a preconfigured alias for a service version.

      To create an alias in the Function Compute console, click Create Alias. Manage aliases.

    Function

    Select the target function.

    To create a function in the Function Compute console, click Create Function. Manage functions.

    Authorization

    Grants IoT Platform permission to write data to Function Compute.

    If you have not created the required RAM role, click Create RAM Role to go to the RAM console. Then, create a RAM role and an authorization policy. For more information, see Create a RAM role.

  7. On the Data Forwarding page, find the rule and click Start in the Actions column.

  8. Test the rule.

    1. Publish a message to a topic processed by the rule's SQL query (What is a topic?). Use the device emulator to debug device messages.

    2. In the Function Compute console, open the function details page. Check the Invocation Log tab for execution records, or click Monitoring Dashboard to view function metrics.

      Important

      Monitoring data may be delayed up to 5 minutes.

Example

Push device data to DingTalk groups