Install
openclaw skills install @huaweicloudskill/huawei-cloud-functiongraph-trigger-createCreate FunctionGraph triggers on Huawei Cloud. Supports scheduled TIMER triggers (Quartz Cron expressions or fixed Rate values) and event-driven OBS triggers that run a function when objects are created or deleted in an OBS bucket. Use this skill when users ask to create a trigger, schedule function execution, set up periodic tasks, configure a timer, or run a function as soon as a file is uploaded to OBS. Triggered by keywords like "create trigger", "set up trigger", "schedule function", "periodic task", "timer", "cron", "OBS trigger", "object storage trigger", "event trigger", "event-driven", "trigger on upload", "bucket notification", "FunctionGraph trigger", "创建云函数触发器", "配置云函数触发器", "云函数定时触发", "定时执行", "定时任务", "创建定时器", "OBS触发器", "对象存储触发器", "事件触发器", "上传触发".
openclaw skills install @huaweicloudskill/huawei-cloud-functiongraph-trigger-createThis skill enables the creation of triggers for Huawei Cloud FunctionGraph functions. Two trigger types are supported:
Typical scenarios:
--trigger-type | Trigger | Configuration parameters | Typical use |
|---|---|---|---|
TIMER (default) | Scheduled trigger | --schedule with --schedule-type (Cron or Rate), optional --user-event | Periodic function execution |
OBS | Object storage event trigger | --bucket and --events, optional --prefix and --suffix | Run the function when an object is created or deleted |
This skill implements only TIMER and OBS. The FunctionGraph service also offers other trigger types, but this skill does not support them and does not document them:
For those types, use the FunctionGraph console or the KooCLI hcloud FunctionGraph trigger commands.
This skill only creates triggers. It does not:
Triggers that need to be removed, changed or inspected must be handled by the user in the FunctionGraph console (Function details → Triggers) or with the KooCLI hcloud FunctionGraph commands. Every run of this skill creates a new trigger; running it again with the same trigger name for the same function fails with TriggerAlreadyExists instead of updating the existing trigger.
Before using this skill, ensure the following requirements are met:
pip install huaweicloudsdkfunctiongraphHUAWEI_AK: Huawei Cloud Access KeyHUAWEI_SK: Huawei Cloud Secret KeyHUAWEI_REGION: Target region (e.g., cn-north-4)HUAWEI_PROJECT_ID: Project IDThe complete workflow consists of the following steps.
Step 1: Load environment variables and authenticate(加载环境变量/鉴权)
The script reads the following environment variables at startup:
HUAWEI_AK: Huawei Cloud Access Key (required)HUAWEI_SK: Huawei Cloud Secret Key (required)HUAWEI_REGION: Target region, defaults to cn-north-4HUAWEI_PROJECT_ID: Project IDIf HUAWEI_AK or HUAWEI_SK is missing, the script prints Config error: Please set environment variables HUAWEI_AK and HUAWEI_SK and exits before any API call.
Step 2: Confirm the target function URN(确认 function_urn)
Pass the target function URN via --function-urn, e.g. urn:fss:cn-north-4:project_id:function:default:my-function:latest. Before creating the trigger, the script verifies that the function exists by calling ShowFunctionConfig. If the function is not found, it returns FunctionNotFound and stops without creating anything.
Step 3: Choose the trigger type(选择触发器类型)
Pass --trigger-type TIMER (the default) or --trigger-type OBS. The type determines which parameters are required in the next step:
TIMER requires --schedule; --bucket, --events, --prefix and --suffix are ignored.OBS requires --bucket and --events; --schedule, --schedule-type and --user-event are ignored.Step 4: Confirm the trigger configuration(确认触发配置)
Verify the trigger parameters (see Parameter Confirmation):
For a TIMER trigger:
--name: Trigger name, 1-64 characters--schedule: Quartz Cron expression (6-7 fields) for Cron, or a rate value such as 5m for Rate--schedule-type: Cron (default) or Rate--user-event: Optional additional user event dataFor an OBS trigger:
--name: Event notification name, 1-64 characters--bucket: Name of the existing OBS bucket that acts as the event source; it cannot be changed after the trigger is created--events: Comma-separated object events, e.g. ObjectCreated:* or Put,Post (see OBS Event Types)--prefix / --suffix: Optional filters that limit the notification to object keys starting with / ending with the given string--status: use ACTIVE; OBS triggers cannot be disabled after creationThe script validates all parameters (required fields per trigger type, Cron syntax, name length, status value) before calling the API.
Step 5: Execute the creation script(执行 create_trigger.py)
Run from the skill directory. TIMER example:
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "TIMER" \
--name "daily-trigger" \
--schedule "0 0 2 * * ?" \
--schedule-type "Cron" \
--status "ACTIVE"
OBS example:
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "OBS" \
--name "mask-on-upload" \
--bucket "my-input-bucket" \
--events "ObjectCreated:*" \
--prefix "uploads/" \
--status "ACTIVE"
Step 6: Verify the result(验证结果)
status: "success", the created trigger_id, trigger_name, trigger_type (TIMER or OBS) and enable_status. A TIMER response also contains schedule; an OBS response also contains bucket and events.status: "failed" with an error_code (InvalidParameter, FunctionNotFound, NetworkError, TriggerAlreadyExists, TriggerLimitExceeded, InternalError) and exits with a non-zero code. Fix the corresponding parameter and re-run the script.python3 scripts/create_trigger.py \
--function-urn "<function-urn>" \
--trigger-type "<TIMER|OBS>" \
--name "<trigger-name>" \
--status "<ACTIVE|DISABLED>" \
<type-specific parameters>
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "hourly-report" \
--schedule "0 0 8 * * ?" \
--schedule-type "Cron"
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "every-5min" \
--schedule "5m" \
--schedule-type "Rate"
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "TIMER" \
--name "nightly-job" \
--schedule "0 30 1 * * ?" \
--schedule-type "Cron" \
--user-event "{\"mode\": \"full\"}" \
--status "ACTIVE"
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "OBS" \
--name "on-object-created" \
--bucket "my-input-bucket" \
--events "ObjectCreated:*" \
--status "ACTIVE"
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "OBS" \
--name "mask-uploads" \
--bucket "my-input-bucket" \
--events "Put,Post" \
--prefix "uploads/" \
--suffix ".csv" \
--status "ACTIVE"
python3 scripts/create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--trigger-type "OBS" \
--name "on-object-removed" \
--bucket "my-input-bucket" \
--events "ObjectRemoved:*" \
--status "ACTIVE"
Pass one or more events as a comma-separated list, e.g. --events "Put,Post" or --events "ObjectCreated:*".
| Event | Meaning |
|---|---|
ObjectCreated | All object creation operations: Put, Post, Copy and multipart upload completion. ObjectCreated:* also matches them |
Put | Object uploaded with the Put method |
Post | Object uploaded with the Post method |
Copy | Object created by copying another object |
CompleteMultipartUpload | Multipart upload (segments) merged into a complete object |
ObjectRemoved | Object deleted. ObjectRemoved:* also matches Delete and DeleteMarkerCreated |
Delete | Object version deleted with an explicit version ID |
DeleteMarkerCreated | Delete marker created when no version ID is specified |
--prefix limits notifications to object keys that start with the given string, e.g. uploads/.--suffix limits notifications to object keys that end with the given string, e.g. .csv.FunctionGraph uses Quartz Cron format with 6 or 7 fields (the 7th field year is optional):
┌───────────── second (0-59)
│ ┌───────────── minute (0-59)
│ │ ┌───────────── hour (0-23)
│ │ │ ┌───────────── day of month (1-31)
│ │ │ │ ┌───────────── month (1-12)
│ │ │ │ │ ┌───────────── day of week (1-7, 1=Sunday)
│ │ │ │ │ │ ┌───────────── year (optional, e.g. 2026)
│ │ │ │ │ │ │
* * * * * ? *
Only this subset is supported: numbers, *, ? (day or day-of-week only), ranges (a-b), steps (*/n) and lists (a,b,c). Quartz modifiers such as L, W and # are not supported and are rejected with an explicit error message instead of a generic numeric error.
For detailed Cron expression reference including special characters and common examples, see Cron Expression Reference.
Before creating the trigger, confirm the following parameters:
| Parameter | CLI Argument | Required | Description | Example |
|---|---|---|---|---|
function_urn | --function-urn | Yes (always) | Target function URN | urn:fss:cn-north-4:xxx:function:default:my-func:latest |
trigger_type | --trigger-type | No (default TIMER) | TIMER or OBS | OBS |
trigger_name | --name | Yes (always) | TIMER: trigger name; OBS: event notification name (1-64 chars) | daily-trigger |
enable_status | --status | No (default ACTIVE) | ACTIVE or DISABLED; OBS triggers cannot be disabled after creation (only TIMER, DDS, DMS, KAFKA and LTS trigger types support disabling), so use ACTIVE with --trigger-type OBS | ACTIVE |
schedule | --schedule | Yes for TIMER, ignored for OBS | Cron expression or Rate value | 0 0 2 * * ? or 5m |
schedule_type | --schedule-type | No (default Cron) | Cron or Rate; TIMER only | Cron |
user_event | --user-event | No (default empty) | Additional user event data; TIMER only | optional info |
bucket | --bucket | Yes for OBS, ignored for TIMER | OBS bucket name that acts as the event source | my-input-bucket |
events | --events | Yes for OBS, ignored for TIMER | Comma-separated object events | ObjectCreated:* or Put,Post |
prefix | --prefix | No; OBS only | Object key prefix filter | uploads/ |
suffix | --suffix | No; OBS only | Object key suffix filter | .csv |
TIMER or OBS){
"status": "success",
"trigger_id": "timer-xxx-xxx-xxx",
"trigger_name": "daily-trigger",
"trigger_type": "TIMER",
"schedule": "0 0 2 * * ?",
"enable_status": "ACTIVE",
"message": "Trigger created successfully"
}
{
"status": "success",
"trigger_id": "obs-xxx-xxx-xxx",
"trigger_name": "mask-uploads",
"trigger_type": "OBS",
"bucket": "my-input-bucket",
"events": ["Put", "Post"],
"enable_status": "ACTIVE",
"message": "Trigger created successfully"
}
{
"status": "failed",
"error_code": "TriggerAlreadyExists",
"message": "Trigger with the same name already exists"
}
Error codes: InvalidParameter, FunctionNotFound, NetworkError, TriggerAlreadyExists, TriggerLimitExceeded, InternalError.
For complete error codes and troubleshooting information, see Cron Expression Reference.
After creating the trigger, verify the configuration:
Navigate to FunctionGraph console → Function details → Triggers tab to view all triggers
Navigate to FunctionGraph console → Function details → Triggers → View trigger details
Navigate to the OBS console → the target bucket → Events/Notification rules, and confirm the rule that matches the trigger name, bucket, events, prefix and suffix.
Navigate to FunctionGraph console → Function details → Triggers → View execution history
Expected indicators:
? for unused day field: Either day-of-month or day-of-week should use ?--prefix and --suffix so the function runs only for the objects it is meant to processPut/Post for uploads and ObjectRemoved for deletions instead of ObjectCreated/ObjectRemoved when the function only handles one operationdaily-data-sync, mask-on-upload[frequency|event]-[purpose]For detailed information, refer to:
This skill is designed to work with Huawei Cloud FunctionGraph API. The tags field helps with skill discovery and categorization.
For troubleshooting and error codes, refer to Cron Expression Reference.