All Products
Search
Document Center

DataWorks:Function Compute node

Last Updated:Mar 26, 2026

Function Compute nodes let you run custom event functions on a periodic schedule and integrate them into DataWorks data processing workflows. This topic explains how to configure, deploy, and monitor a Function Compute node.

Prerequisites

Before you begin, ensure that you have:

  • A RAM user added to your workspace with the Develop or Workspace Administrator role. The Workspace Administrator role has more permissions than necessary. Exercise caution when you assign the Workspace Administrator role. For more information, see Add workspace members and assign roles to them.

  • A serverless resource group associated with your workspace. For more information, see Use serverless resource groups.

  • A Function Compute node created in the DataWorks IDE. For more information, see Create a task node.

Supported regions

Function Compute nodes are available only in workspaces created in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Shenzhen), China (Hong Kong), Singapore, UK (London), US (Silicon Valley), US (Virginia), Germany (Frankfurt), Australia (Sydney), and India (Mumbai).

Limitations

DataWorks invokes only event functions. If you want to periodically schedule a function, create an event function — not an HTTP function. For more information, see Function type selection.

RAM user permissions

If you develop Function Compute nodes as a RAM user, attach the following policies to the RAM user.

Policy type Policies to attach
System policy AliyunFCFullAccess, AliyunFCReadOnlyAccess, and AliyunFCInvocationAccess. See System policies.
Custom policy (Function Compute 3.0) fc:GetAsyncTask, fc:StopAsyncTask, fc:GetService, fc:ListServices, fc:GetFunction, fc:InvokeFunction, fc:ListFunctions, fc:GetFunctionAsyncInvokeConfig, fc:ListServiceVersions, fc:ListAliases, fc:GetAlias, fc:ListFunctionAsyncInvokeConfigs, fc:GetStatefulAsyncInvocation, fc:StopStatefulAsyncInvocation. See Custom policies.
Custom policy (Function Compute 2.0) Same as Function Compute 3.0, except fc:GetAsyncTask and fc:StopAsyncTask are not required.

For more policy examples, see Policies and sample policies and Sample policies.

Configure a Function Compute node

On the configuration tab of the Function Compute node, set the following parameters.

image

Parameter Description
Select Version Or Alias The service version or alias to use for function invocation. If you select Default Version, the Version parameter is displayed and its value is fixed as LATEST. Options: a released service version (a snapshot of the service containing settings and function code, but not trigger information; supports rollback) or a version alias (points to a specific version and supports canary release and rollback). For details, see Manage versions and Manage aliases.
Select Function The event function to invoke. DataWorks supports only event functions — not HTTP functions. If no function is available, create one first. See Manage functions and Function type selection.
Invocation Method How DataWorks calls the function. Options: Synchronous Invocation or Asynchronous Invocation. See Choose an invocation method below.
Variable The JSON payload passed to the function as its event input. Use the ${} format to reference DataWorks scheduling variables (for example, "triggerTime": "${bizdate}"). This corresponds to the content on the Create New Test Event tab of the Configure Test Parameters panel in the Function Compute console. To access this panel, go to the function details page in the Function Compute console and choose Test Function > Configure Test Parameters on the Code tab.

Choose an invocation method

Synchronous Invocation Asynchronous Invocation
How it works DataWorks waits for the function to finish and returns the execution result. DataWorks returns immediately after the request is persisted; the function runs in the background.
Use when The function completes within one hour. The function is time-consuming, resource-intensive, or runs longer than one hour.

Example: function triggered at scheduling time

The following example uses a function named para_service_01_by_time_triggers. The function reads scheduling metadata from the event payload and logs it.

Function code:

import json
import logging

logger = logging.getLogger()

def handler(event, context):
    logger.info('event: %s', event)

    # Parse the JSON event payload
    evt = json.loads(event)
    triggerName = evt["triggerName"]
    triggerTime = evt["triggerTime"]
    payload = evt["payload"]

    logger.info('triggerName: %s', triggerName)
    logger.info("triggerTime: %s", triggerTime)
    logger.info("payload: %s", payload)

    return 'Timer Payload: ' + payload

Variable configuration (set in the Variable field on the node configuration tab):

{
    "payload": "payload1",
    "triggerTime": "${bizdate}",
    "triggerName": "triggerName1"
}

${bizdate} is a DataWorks scheduling variable that resolves to the business date at runtime. For more function code examples, see Sample code.

Configure scheduling and deploy

  1. After configuring the node, set the scheduling properties to define when DataWorks runs it automatically. See Scheduling configurations.

  2. Deploy the node to the production environment. See Node or workflow deployment.

  3. After deployment, go to Operation Center > Auto Triggered Nodes to view the deployed node and monitor its runs. See Getting started with Operation Center.

Troubleshooting

Service list not visible: If the list of created services does not appear when you configure the node, check for these two causes: