huawei-cloud-functiongraph-trigger-create
huaweicloud/huaweicloud-skills
Create and configure scheduled TIMER triggers for Huawei Cloud FunctionGraph functions using Quartz Cron expressions.
What is huawei-cloud-functiongraph-trigger-create?
This skill enables creation of scheduled triggers for Huawei Cloud FunctionGraph serverless functions with flexible Quartz Cron expression support. Use it when you need to set up periodic task execution, automated backups, health checks, or time-based notifications on your cloud functions.
- Create TIMER-type triggers for FunctionGraph functions with Cron or Rate scheduling
- Support Quartz Cron expressions (6-7 field format) for precise scheduling control
- Configure trigger status (ACTIVE/DISABLED) and optional user event data
- Validate and deploy triggers with confirmation checklists before creation
- Monitor trigger execution history and verify configuration in FunctionGraph console
How to install huawei-cloud-functiongraph-trigger-create
npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-functiongraph-trigger-create- Python 3.9 or higher installed
- Huawei Cloud FunctionGraph SDK installed (pip install huaweicloudsdkfunctiongraph)
- Environment variables configured: HUAWEI_AK, HUAWEI_SK, HUAWEI_REGION, HUAWEI_PROJECT_ID
- Target FunctionGraph function already exists in the specified region
- Stable network connection to Huawei Cloud API endpoints
How to use huawei-cloud-functiongraph-trigger-create
- 1.Navigate to the scripts directory and prepare your function URN from the FunctionGraph console
- 2.Construct your Cron expression using Quartz format (e.g., '0 0 8 * * ?' for 8 AM daily) or Rate format (e.g., '5m' for every 5 minutes)
- 3.Run the create_trigger.py script with required parameters: function-urn, name, schedule, schedule-type, and optional status
- 4.Verify the trigger was created successfully by checking the returned trigger ID and status
- 5.Navigate to FunctionGraph console → Function details → Triggers tab to confirm the trigger appears and monitor execution history
Use cases
- Schedule daily data synchronization tasks at specific times using Cron expressions
- Set up periodic health checks and monitoring functions to run at fixed intervals
- Configure automated backup operations to execute on a defined schedule
- Create time-based notification systems that trigger function execution at specified times
- Implement recurring maintenance tasks with flexible scheduling patterns
- Cloud engineers managing serverless functions on Huawei Cloud
- DevOps professionals setting up automated periodic tasks
- Backend developers implementing scheduled data processing pipelines
- System administrators configuring monitoring and health check routines
huawei-cloud-functiongraph-trigger-create FAQ
Cron uses Quartz Cron expressions for precise time-based scheduling (e.g., '0 0 8 * * ?' for 8 AM daily), while Rate uses fixed intervals (e.g., '5m' for every 5 minutes). Cron is better for specific times; Rate is better for regular intervals.
FunctionGraph uses UTC (Coordinated Universal Time) by default for all Cron expression evaluations. Account for timezone differences when scheduling.
Each FunctionGraph function supports up to 10 triggers by default. Contact Huawei Cloud support if you need to increase this limit.
Concurrent executions may occur if a function runs longer than the scheduled interval. Ensure your function completes before the next trigger fires, or use longer intervals to prevent overlap.
Yes, create the trigger with enable_status set to 'DISABLED' for testing, verify the configuration in the console, then enable it once you confirm the schedule is correct.
Full instructions (SKILL.md)
Source of truth, from huaweicloud/huaweicloud-skills.
name: huawei-cloud-functiongraph-trigger-create description: Create and configure scheduled TIMER triggers for Huawei Cloud FunctionGraph functions using Quartz Cron expressions. Use this skill when users ask to create triggers, schedule function execution, set up periodic tasks, or configure timers for functions. Triggered by keywords like "create trigger", "set up trigger", "schedule function", "periodic task", "timer", "cron", "创建云函数触发器", "配置云函数触发器", "云函数定时触发", "定时执行", "定时任务", "创建定时器", "FunctionGraph trigger", "schedule function execution". tags:
- functiongraph
- trigger
- timer
- cron
- huaweicloud
Overview
This skill enables the creation and configuration of scheduled triggers (TIMER type) for Huawei Cloud FunctionGraph functions. It supports Quartz Cron expression format for flexible scheduling configurations.
The trigger allows automatic execution of serverless functions at specified time intervals, making it ideal for:
- Periodic data processing tasks
- Scheduled backup operations
- Regular monitoring and health checks
- Time-based notification systems
Prerequisites
Before using this skill, ensure the following requirements are met:
- Python Environment: Python 3.9+ installed
- SDK Installation: Install FunctionGraph SDK:
pip install huaweicloudsdkfunctiongraph - Environment Variables: Configure the following environment variables:
HUAWEI_AK: Huawei Cloud Access KeyHUAWEI_SK: Huawei Cloud Secret KeyHUAWEI_REGION: Target region (e.g.,cn-north-4)HUAWEI_PROJECT_ID: Project ID
- FunctionGraph Function: Target function must already exist in the specified region
- Network Access: Stable network connection to Huawei Cloud API endpoints
Usage
Basic Command Structure
cd scripts
python create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "daily-trigger" \
--schedule "0 0 2 * * ?" \
--schedule-type "Cron" \
--status "ACTIVE"
Examples
Cron Expression Trigger
cd scripts
python create_trigger.py \
--function-urn "urn:fss:cn-north-4:project_id:function:default:my-function:latest" \
--name "daily-trigger" \
--schedule "0 0 8 * * ?" \
--schedule-type "Cron"
Fixed Rate Trigger
cd scripts
python 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"
Cron Expression Format
FunctionGraph uses Quartz Cron format with 6 or 7 fields:
┌───────────── second (0-59)
│ ┌───────────── minute (0-59)
│ │ ┌───────────── hour (0-23)
│ │ │ ┌───────────── day of month (1-31)
│ │ │ │ ┌───────────── month (1-12)
│ │ │ │ │ ┌───────────── day of week (1-7, 1=Sunday)
│ │ │ │ │ │
* * * * * ?
For detailed Cron expression reference including special characters and common examples, see Cron Expression Reference.
Parameters Confirmation
Before creating the trigger, confirm the following parameters:
| Parameter | Required | Description | Example |
|---|---|---|---|
function_urn | Yes | Target function URN | urn:fss:cn-north-4:xxx:function:default:my-func:latest |
trigger_name | Yes | Trigger name (1-64 chars) | daily-trigger |
schedule | Yes | Cron expression or Rate value | 0 0 2 * * ? or 5m |
schedule_type | No | Cron (default) or Rate | Cron |
enable_status | No | ACTIVE (default) or DISABLED | ACTIVE |
user_event | No | Additional user event data | optional info |
Confirmation Checklist
- Function URN is correct and function exists
- Cron expression has been validated
- Trigger name follows naming conventions
- IAM permissions are sufficient
- Region matches the function location
Output Format
Success Response
{
"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"
}
Error Response
{
"status": "failed",
"error_code": "TriggerAlreadyExists",
"message": "Trigger with the same name already exists"
}
For complete error codes and troubleshooting information, see Cron Expression Reference.
Verification Method
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. Monitor Trigger Execution
Navigate to FunctionGraph console → Function details → Triggers → View execution history
Expected indicators:
- Trigger status: Active
- Next execution time: Correctly calculated
- Execution history: No failed invocations
Best Practices
Cron Expression 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
Naming Conventions
- Use descriptive names:
daily-data-sync,hourly-health-check - Follow pattern:
[frequency]-[purpose] - Maximum 64 characters
- Use lowercase with hyphens
Security Considerations
- Least privilege: Grant minimal IAM permissions
- Enable encryption: Use KMS for sensitive function inputs
- Monitor executions: Set up Cloud Eye alarms for failures
- Rate limiting: Configure appropriate retry parameters
Operational Recommendations
- Start with disabled status for testing
- Document trigger purpose in description field
- Set appropriate retries for transient failures
- Monitor first executions after enabling
Reference Documents
For detailed information, refer to:
- SDK Installation Guide
- IAM Policies
- Verification Method
- Acceptance Criteria
- Cron Expression Reference
Important Notes
Compatibility Notes
This skill is designed to work with Huawei Cloud FunctionGraph API. The tags field helps with skill discovery and categorization, while the version field follows semantic versioning for skill updates.
Limitations
- Maximum triggers: Each function supports up to 10 triggers by default
- Cron precision: Second-level scheduling may have minor delays
- Timeout handling: Function timeout should be less than trigger interval
- Cold start: First executions may have additional latency
Cost Implications
- No additional cost for trigger configuration
- Function execution billed per invocation
- Consider execution frequency for cost optimization
Common Pitfalls
- Wrong timezone: Remember FunctionGraph uses UTC
- Overlapping schedules: Multiple triggers may cause concurrent executions
- Long-running functions: Ensure function completes before next trigger
- Cron syntax errors: Validate expression format before deployment
For troubleshooting and error codes, refer to Cron Expression Reference.
Related Skills:
huawei-cloud-functiongraph-function-createhuawei-cloud-functiongraph-deploy
Related skills
More from huaweicloud/huaweicloud-skills and the wider catalog.

huawei-cloud-iam-query
Query Huawei Cloud IAM resources (users, groups, policies, agencies, credentials, MFA) via read-only Python SDK.

huawei-cloud-monitoring-query
Query Huawei Cloud monitoring, alarms, dashboards, and enterprise projects without write operations.

huawei-cloud-network-query
Query Huawei Cloud network resources (VPC, security groups, load balancers, NAT, VPN, DNS) without write operations.

huawei-cloud-obs-bucket-create
Create and configure Huawei Cloud OBS storage buckets with validation and permission setup.

huawei-cloud-obs-stats
Query Huawei Cloud OBS bucket statistics, download traffic, and request metrics with month-over-month comparison.

huawei-cloud-obs-upload
Upload files and directories to Huawei Cloud OBS buckets, list bucket stats, and schedule periodic syncs.