The most likely cause is that the Trigger Event parameter uses a wildcard (oss:ObjectCreated:*). A wildcard matches every event generated during a single upload operation — not just the final "object ready" event — so a single upload triggers your function multiple times.
Replace the wildcard with the specific event types that match your upload method.
Why wildcards cause repeated triggering
A multipart upload generates multiple OSS events in sequence. When Trigger Event is set to oss:ObjectCreated:*, every one of those events invokes the function.
For example, uploading a 12 MB object using OSS Browser with a part size of 5 MB generates the following 5 events — and triggers the function 5 times:
| # | Event |
|---|---|
| 1 | oss:ObjectCreated:InitiateMultipartUpload |
| 2 | oss:ObjectCreated:UploadPart |
| 3 | oss:ObjectCreated:UploadPart |
| 4 | oss:ObjectCreated:UploadPart |
| 5 | oss:ObjectCreated:CompleteMultipartUpload |
Only event 5 means the object is fully available. Events 1–4 fire while the upload is still in progress.
Solution
Remove the wildcard and configure specific event types based on your upload method:
| Event | Upload method | Description |
|---|---|---|
oss:ObjectCreated:PutObject | Simple upload | Creates or overwrites an object by using simple uploads |
oss:ObjectCreated:PostObject | Form upload | Creates or overwrites an object by using form uploads |
oss:ObjectCreated:CompleteMultipartUpload | Multipart upload | Fires when all parts are assembled and the object is complete |
For multipart uploads, set Trigger Event to oss:ObjectCreated:CompleteMultipartUpload to ensure the function runs exactly once per completed upload.
For workflows that accept objects from multiple upload methods, configure all three event types on the trigger. See OSS trigger events for the full list of supported event types.