Published at: 2026-10-12

Function Mode Reference


Learn about parameter passthrough and return value formats in the connector function mode.

Overview

If the page UI cannot meet requirements for any API, you can switch to code mode (function mode). Function parameter passthrough corresponds to page configuration parameters and authorization parameters.

Parameter Passthrough

In function mode, you can obtain the following parameters through syncArg:
Parameter Type Description
auth_data Map Authorization configuration parameters and authorization API return parameters
input_data Map Page input parameters
tenantId String Tenant identifier
connectorKey String Connector identifier
operation String Current operation
connectionId String Connection instance identifier
type String Type
extra Map Extension parameters
http Map HTTP context
Map<String, Object> authData = (Map<String, Object>) syncArg.get("auth_data");
Map<String, Object> inputData = (Map<String, Object>) syncArg.get("input_data");

String tenantId = (String) syncArg.get("tenantId");
String connectorKey = (String) syncArg.get("connectorKey");
String operation = (String) syncArg.get("operation");
String connectionId = (String) syncArg.get("connectionId");
String type = (String) syncArg.get("type");

Map<String, Object> extra = (Map<String, Object>) syncArg.get("extra");
Map<String, Object> http = (Map<String, Object>) syncArg.get("http");

Trigger Return Format

A Trigger return must return a data list.
Field description:
  • dataItems: required, the list of data triggered
  • privateKeys: recommended, the deduplication key field
  • nameKeys: recommended, the debug display name field
  • conditions: recommended, used for continuing the next polling query
return [
    outputData: [
        triggerOperation: "instant.created",
        dataItems: [
            [
                id: "1",
                event: "created",
                name: "test order"
            ],
            [
                id: "2",
                event: "created",
                name: "test order 2"
            ]
        ],
        privateKeys: ["id"],
        nameKeys: ["name"],
        conditions: [
            nextCursor: "cursor_123"
        ]
    ]
]

Get the Authorization URL

return [
    outputData: [
        authorizeUrl: "https://example.com/oauth/authorize?client_id=xxx&state=xxx&redirect_uri=xxx"
    ]
]

Get the Token

return [
    outputData: [
        access_token: "access_token_xxx",
        refresh_token: "refresh_token_xxx",
        token_type: "Bearer",
        expires_in: 7200,
        scope: "crm"
    ]
]

Refresh the Token

return [
    outputData: [
        access_token: "new_access_token_xxx",
        refresh_token: "new_refresh_token_xxx",
        token_type: "Bearer",
        expires_in: 7200
    ]
]

Ordinary API Return

An ordinary API function returns outputData:
return [
    outputData: [
        id: "123",
        name: "test",
        status: "success"
    ]
]

Related Topics

Submit Feedback