Preview every file this package writes on install before you run the command above.
Summary
Create 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.
Skill instructions
Overview
This skill enables the creation of triggers for Huawei Cloud FunctionGraph functions. Two trigger types are supported:
TIMER (scheduled trigger): invokes the function on a schedule described by a Quartz Cron expression or by a fixed Rate value.
OBS (event-driven trigger, new): invokes the function when objects are created or deleted in an OBS bucket, which covers real-time processing scenarios such as masking or sanitizing sensitive data as soon as a file is uploaded.
Typical scenarios:
Periodic data processing, scheduled backup operations, regular monitoring and health checks, time-based notifications (TIMER).
Upload-triggered processing: real-time data masking, thumbnail generation, format conversion, search indexing or malware scanning of newly uploaded objects (OBS).
Supported Trigger Types and Capability Boundaries
Supported trigger types
--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
Trigger types that are NOT supported
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.
Capability boundary: create only
This skill only creates triggers. It does not:
delete a trigger
update or modify an existing trigger
disable or enable an existing trigger
list or query existing triggers
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.
Prerequisites
Before using this skill, ensure the following requirements are met:
Environment Variables: Configure the following environment variables:
HUAWEI_AK: Huawei Cloud Access Key
HUAWEI_SK: Huawei Cloud Secret Key
HUAWEI_REGION: Target region (e.g., cn-north-4)
HUAWEI_PROJECT_ID: Project ID
FunctionGraph Function: Target function must already exist in the specified region
OBS Bucket (OBS triggers only): The bucket must already exist in the same region as the function, and the function must be authorized to read from it
Network Access: Stable network connection to Huawei Cloud API endpoints
Workflow
The 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-4
HUAWEI_PROJECT_ID: Project ID
If 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.
On success, the script prints a JSON response with 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.
On failure, it prints 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.
You can also confirm the result in the FunctionGraph console: Function details → Triggers tab, where the new trigger should be listed with its status.
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
OBS Prefix and Suffix Filters
--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.
Both are optional and can be combined. Leave them out to be notified for every matching event in the bucket.
Prefix/suffix filtering is performed by OBS and reduces function invocations, which also reduces cost.
Cron Expression Format
FunctionGraph uses Quartz Cron format with 6 or 7 fields (the 7th field year is optional):
code
┌───────────── 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.
Parameter Confirmation
Before creating the trigger, confirm the following parameters:
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
Confirmation Checklist
Function URN is correct and the function exists
Trigger type selected (TIMER or OBS)
For TIMER: Cron expression or Rate value has been validated
For OBS: bucket exists in the same region and the events are valid
Trigger name follows naming conventions
IAM permissions are sufficient (including OBS read access for OBS triggers)
Region matches the function location
Output Format
Success Response (TIMER)
json
{"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"}
Success Response (OBS)
json
{"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"}
Error Response
json
{"status":"failed","error_code":"TriggerAlreadyExists","message":"Trigger with the same name already exists"}
After creating the trigger, verify the configuration:
1. List Function Triggers
Navigate to FunctionGraph console → Function details → Triggers tab to view all triggers
2. Check Trigger Details
Navigate to FunctionGraph console → Function details → Triggers → View trigger details
3. Check the OBS Event Source (OBS triggers)
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.
4. Monitor Trigger Execution
Navigate to FunctionGraph console → Function details → Triggers → View execution history
Expected indicators:
Trigger status: Active
TIMER only: next execution time is correctly calculated
OBS only: uploading a matching object (respecting the prefix/suffix filter) produces a function invocation
Best Practices
TIMER Best Practices
Avoid frequent executions: Use intervals ≥ 5 minutes unless necessary
Consider timezone: FunctionGraph uses UTC by default
Use ? for unused day field: Either day-of-month or day-of-week should use ?
Validate before creation: Test expressions using online Cron validators
OBS Best Practices
Filter aggressively: Use --prefix and --suffix so the function runs only for the objects it is meant to process
Keep the function idempotent: OBS notifications are at-least-once; the same object event can be delivered more than once, so mask/replace operations must produce the same result when repeated
Write results to a different bucket or prefix: Avoid writing the function output back into the same prefix that triggers it, which would create an infinite invocation loop
Pick precise events: Use Put/Post for uploads and ObjectRemoved for deletions instead of ObjectCreated/ObjectRemoved when the function only handles one operation
Watch the runtime: Large objects may need more memory and a longer timeout than the default configuration
Naming Conventions
Use descriptive names: daily-data-sync, mask-on-upload
Follow pattern: [frequency|event]-[purpose]
Maximum 64 characters
Use lowercase with hyphens
Security Considerations
Least privilege: Grant minimal IAM permissions, including read access to the OBS bucket for OBS triggers
Enable encryption: Use KMS for sensitive function inputs
Monitor executions: Set up Cloud Eye alarms for failures
Protect notification payloads: OBS events may contain object keys; make sure log and trace settings do not leak sensitive names
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/huaweicloud/huawei-cloud-functiongraph-trigger-create/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@huaweicloud/huawei-cloud-functiongraph-trigger-create@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Create 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 t...
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infrastructure as Terraform, whether they ask explicitly for Terraform or describe goa...
Run aipm add @huaweicloud/huawei-cloud-functiongraph-trigger-create@1.0.0 in a project that has AIPM initialized.
Supported tools
@huaweicloud/huawei-cloud-functiongraph-trigger-create@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.